This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix twolf -funroll-loops -O3 miscompilation (a semi-latent web.c bug)
- From: Markus Trippelsdorf <markus at trippelsdorf dot de>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 12 Oct 2012 22:14:38 +0200
- Subject: Re: Fix twolf -funroll-loops -O3 miscompilation (a semi-latent web.c bug)
- References: <20121012194333.GA8987@kam.mff.cuni.cz>
On 2012.10.12 at 21:43 +0200, Jan Hubicka wrote:
> I finally tracked down twolf misoptimization triggered by my loop-unroll.c
> changes. It has turned out to be semi-latent wrong code issue in webizer.
> What happens is:
>
> 1) gcse.c drop REG_EQUAL note on the induction variable
> 2) loop optimizer unrolls the loop enabling webizer to cleanup
> 3) webizer do not track reaching refs into REG_EQUAL note because
> the variable is dead and renames it to unused pseudo
> Program is stil valid but the REG_EQUAL is bogus.
> 4) CSE eventually takes the value and put it back into the code
> 5) init-regs initializes it to 0
>
> and result is a segfault on the following testcase.
> Fixed by making webizer to not prune dead regs.
> Will commit it after testing on x86_64-linux.
FYI this also fixes the lto/profiledbootstrap breakage, PR 54885.
Thanks.
--
Markus