------- Additional Comments From dberlin at gcc dot gnu dot org 2005-08-29 13:54 ------- Subject: Re: [4.1 Regression] ICE: in first_vi_for_offset, at tree-ssa-structalias.c:2585 with -O3
On Mon, 2005-08-29 at 12:13 +0000, rguenth at gcc dot gnu dot org wrote: > ------- Additional Comments From rguenth at gcc dot gnu dot org 2005-08-29 > 12:13 ------- > Try > > Index: tree-ssa-structalias.c > =================================================================== > RCS file: /cvs/gcc/gcc/gcc/tree-ssa-structalias.c,v > retrieving revision 2.27 > diff -c -3 -p -r2.27 tree-ssa-structalias.c > *** tree-ssa-structalias.c 14 Aug 2005 19:23:56 -0000 2.27 > --- tree-ssa-structalias.c 29 Aug 2005 12:12:21 -0000 > *************** do_simple_structure_copy (const struct c > *** 2317,2322 **** > --- 2317,2324 ---- > q = get_varinfo (temprhs.var); > fieldoffset = p->offset - pstart; > q = first_vi_for_offset (q, q->offset + fieldoffset); > + if (!q) > + continue; > temprhs.var = q->id; > process_constraint (new_constraint (templhs, temprhs)); > } > > to workaround this. > This will generate bad code. This is one of the places where first_vi_for_offset should *never* fail. (it's not okay for it to fail during constraint generation. it's okay to fail during solving). As i noted in the bug, the real problem here seems to be the FE is generating overlaps when it shouldn't be (or it's using magic that we aren't to calculate the offsets, and hten is lying about it to the middle end :P) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22488