Skip to content
Snippets Groups Projects
Commit 0cff083a authored by Cheng Shao's avatar Cheng Shao Committed by Marge Bot
Browse files

compiler: emit NaturallyAligned when element type & index type are the same width

This commit fixes a subtle mistake in alignmentFromTypes that used to
generate Unaligned when element type & index type are the same width.
Fixes #24930.
parent c8ece0df
No related branches found
No related tags found
No related merge requests found
......@@ -2302,8 +2302,8 @@ alignmentFromTypes :: CmmType -- ^ element type
-> CmmType -- ^ index type
-> AlignmentSpec
alignmentFromTypes ty idx_ty
| typeWidth ty < typeWidth idx_ty = NaturallyAligned
| otherwise = Unaligned
| typeWidth ty <= typeWidth idx_ty = NaturallyAligned
| otherwise = Unaligned
doIndexOffAddrOp :: Maybe MachOp
-> CmmType
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment