------- Comment #13 from matz at gcc dot gnu dot org 2009-05-10 02:09 ------- Created an attachment (id=17843) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17843&action=view) type-correct version
This is a type-corrected version of the same C testcase. Two structs are different types even if they contain the same members, so the casts and accesses as 'struct a' where the object really was 'struct b' are not valid. That can be solved by modeling the same as in C++, via proper subobjects of base-type. This testcase still exhibits the abort() with -O2 with 4.3.2 on i386 and x86_64. It doesn't fail with current trunk, but most probably for the same coincidence since a-i merge. I haven't checked 4.4.x. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39604