------- Additional Comments From dberlin at gcc dot gnu dot org 2005-07-11 12:33 ------- Subject: Re: [4.1 Regression] ACATS ICE cc40001 in first_vi_for_offset, at tree-ssa-structalias.c:2566
On Mon, 2005-07-11 at 08:48 +0000, reichelt at gcc dot gnu dot org wrote: > ------- Additional Comments From reichelt at gcc dot gnu dot org 2005-07-11 > 08:48 ------- > More compact C++ testcase: > > ====================================== > struct A > { > char c; > int i; > }; > > A a; > > struct B > { > char c, d; > }; > > union C > { > A *p; > B *q; > > C() : p(&a) {} > char& foo() { return q->d; } > }; > > void bar() { C().foo() = 0; } Yes, that will work too. Note the part that bugs me severely is that you are accessing padding in A. :) This is true in the original testcase as well I'm not sure whether i should bother trying to do something sane in this case. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22277