------- Additional Comments From rakdver at atrey dot karlin dot mff dot cuni dot cz 2004-11-28 09:17 ------- Subject: Re: [4.0 Regression] linux kernel loop gets miscompiled
> > ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-11-28 > 01:28 ------- > Confirmed, this looks like a jump threading bug. > Before we have: > goto <bb 9> (<L10>); > > <L8>:; > D.7815_42 = pathp_2->node; > tag_43 = tag_27; > idx_44 = idx_6; > D.7819_45 = D.7815_42->tags[tag_43][idx_44]; > if (D.7819_45 != 0) goto out; else goto <L9>; > > <L9>:; > idx_46 = idx_6 + 1; > > # idx_6 = PHI <idx_39(6), idx_46(8)>; > <L10>:; > if (idx_6 == 0) goto <L8>; else goto <L11>; > > > But after: > goto <bb 8> (<L10>); > > <L9>:; > idx_46 = 1; > goto <bb 10> (<L15>); > > # idx_57 = PHI <0(6)>; > <L10>:; > D.7815_42 = pathp_2->node; > tag_43 = tag_27; > idx_44 = 0; <---- this is just plainly wrong. this seems OK to me (note the "weird" condition that ends the loop -- this loops iterates exactly once, with idx being 0). > D.7819_45 = D.7815_42->tags[tag_27][0]; > if (D.7819_45 != 0) goto out; else goto <L9>; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18241