From: ibuclaw Date: Sat, 17 Nov 2018 11:01:00 +0000 (+0000) Subject: Fix wrong alignment returned by .alignof property. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c1e903927fc763ef0538295a65c9f9f1830e4edf;p=thirdparty%2Fgcc.git Fix wrong alignment returned by .alignof property. The D language expects the value to be the minimum alignment required for the type, not the preferred alignment. gcc/d/ChangeLog: 2018-11-17 Iain Buclaw PR d/87824 * d-target.cc (Target::alignsize): Return min_align_of_type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266234 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog index d534f36bb3f8..c706d085a3eb 100644 --- a/gcc/d/ChangeLog +++ b/gcc/d/ChangeLog @@ -1,3 +1,8 @@ +2018-11-17 Iain Buclaw + + PR d/87824 + * d-target.cc (Target::alignsize): Return min_align_of_type. + 2018-11-05 Iain Buclaw PR d/87865 diff --git a/gcc/d/d-target.cc b/gcc/d/d-target.cc index 3ae791b5f70d..86b042938af6 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. */