[Bug 215] Failing ARM test case on master (ICE)

via D.gnu d.gnu at puremagic.com
Sat May 14 03:39:52 PDT 2016


http://bugzilla.gdcproject.org/show_bug.cgi?id=215

--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject.org> ---
(In reply to Johannes Pfau from comment #1)
> OK, found the problem:
> 
> We should never set DECL_OFFSET_ALIGN to 0. The backend divides by
> DECL_OFFSET_ALIGN. If it divides by zero the result is a null tree which
> will then likely lead to a segfault.
> 
> In types.cc(visit(TypeStruct *t)) we set TYPE_SIZE, TYPE_ALIGN etc. But for
> the union in the test case 'structsize' and 'alignsize' are 0. This is
> probably because of the string mixin in the union? I guess setting TYPE_SIZE
> and TYPE_ALIGN to 0 could not cause other issues as well.
> 
> Anyway, we then have a struct with this union as a field. For this struct we
> call layout_aggregate_type which calls layout_aggregate_members,
> layout_aggregate_members again and finally insert_aggregate_field. There we
> set DECL_OFFSET_ALIGN to 0:
> 
> SET_DECL_OFFSET_ALIGN (field, TYPE_ALIGN (TREE_TYPE (field)));
> 
> Always fascinating how such issues only show up on some architectures. It's
> clearly not architecture specific code, it just seems to be different
> optimizations can completely hide such problems.
> 
> 
> 
> @Iain would be great if you could have a look at this. Once this is fixed
> we'll have master/ updated gdc-5 working 100% on ARM again.
> 

Looks like this is set in the frontend (AnonDeclaration::setFieldOffset.

I'll raise a fix upstream and commit locally too.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the D.gnu mailing list