Hi, This patch addresses some of the failing tests on x86_64-linux/-m32. The failing tests in question checked that data with 'long' was sufficiently aligned.
assert((&var.longfield % long.alignof) == 0); Where long.alignof was replaced with the result of TYPE_ALIGN_UNIT. The D language expects the minimum alignment from .alignof, so on -m32 alignof should return 4 instead of 8. Bootstrapped and ran D2 testsuite on x86_64-linux-gnu with {-m64,-m32/-mno-sse/-mno-mmx,-mx32} runtest flags. Committed to trunk as r266234. --- gcc/d/ChangeLog: 2018-11-17 Iain Buclaw <ibuc...@gdcproject.org> PR d/87824 * d-target.cc (Target::alignsize): Return min_align_of_type.
diff --git a/gcc/d/d-target.cc b/gcc/d/d-target.cc index 3ae791b5f70..86b042938af 100644 --- a/gcc/d/d-target.cc +++ b/gcc/d/d-target.cc @@ -189,7 +189,7 @@ unsigned Target::alignsize (Type *type) { gcc_assert (type->isTypeBasic ()); - return TYPE_ALIGN_UNIT (build_ctype (type)); + return min_align_of_type (build_ctype (type)); } /* Return GCC field alignment size for type TYPE. */