https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69217
Bug ID: 69217 Summary: ICE at var-tracking.c:5038 Segmentation fault Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: ibuclaw at gdcproject dot org Target Milestone: --- Starting from this commit, I have been seeing segfaults in the D frontend. https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/var-tracking.c?r1=231897&r2=231896&pathrev=231897 The equivalent C++ code is: --- struct S1 { }; void __dtor (S1& pthis) { return; } S1& opAssign (S1& pthis, S1 p) { S1 __tmp1 = pthis; pthis = p; __dtor (__tmp1); return pthis; } --- However g++ does something that I don't, remove empty aggregate assignments. While I should get round to fixing the gimplify stage to conform, I think the middle-end should do something other than SEGV when this happens. e.g: if (TYPE_FIELDS (type) == NULL_TREE || DECL_CHAIN (TYPE_FIELDS (type)) == NULL_TREE) return false;