Commit d7815fc4 by Iain Buclaw Committed by Iain Buclaw

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  <ibuclaw@gdcproject.org>

	PR d/87824
	* d-target.cc (Target::alignsize): Return min_align_of_type.

From-SVN: r266234
parent 95c0a210
2018-11-17 Iain Buclaw <ibuclaw@gdcproject.org>
PR d/87824
* d-target.cc (Target::alignsize): Return min_align_of_type.
2018-11-05 Iain Buclaw <ibuclaw@gdcproject.org>
PR d/87865
......
......@@ -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. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment