aboutsummaryrefslogtreecommitdiff
path: root/gcc/d
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2024-03-03 02:26:37 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2024-03-03 02:26:37 +0100
commit623f52775e677bb3d6e9e7ef97196741dd904b1e (patch)
tree76d8a6f16c75b289f8413fe5557486653dab03a8 /gcc/d
parentef1b7885843d73c94313f5e693fa48ecd793043e (diff)
downloadgcc-623f52775e677bb3d6e9e7ef97196741dd904b1e.zip
gcc-623f52775e677bb3d6e9e7ef97196741dd904b1e.tar.gz
gcc-623f52775e677bb3d6e9e7ef97196741dd904b1e.tar.bz2
d: Fix gdc -O2 -mavx generates misaligned vmovdqa instruction [PR114171]
PR d/114171 gcc/d/ChangeLog: * d-codegen.cc (lower_struct_comparison): Keep alignment of original type in reinterpret cast for comparison. gcc/testsuite/ChangeLog: * gdc.dg/torture/pr114171.d: New test.
Diffstat (limited to 'gcc/d')
-rw-r--r--gcc/d/d-codegen.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/d/d-codegen.cc b/gcc/d/d-codegen.cc
index 5bc2339..43d7739f 100644
--- a/gcc/d/d-codegen.cc
+++ b/gcc/d/d-codegen.cc
@@ -1006,6 +1006,7 @@ lower_struct_comparison (tree_code code, StructDeclaration *sd,
if (tmode == NULL_TREE)
tmode = make_unsigned_type (GET_MODE_BITSIZE (mode.require ()));
+ tmode = build_aligned_type (tmode, TYPE_ALIGN (stype));
t1ref = build_vconvert (tmode, t1ref);
t2ref = build_vconvert (tmode, t2ref);