[PATCH, rtl-optimization]: Fix PR 51821, 64bit > 32bit conversion produces incorrect results with optimizations

Eric Botcazou ebotcazou@adacore.com
Thu Jan 12 23:04:00 GMT 2012


> The solution is to fix the scanning loop to look into the insn pattern
> itself for all set and clobbered hard registers. This way, all
> registers, clobbered by the pattern, will be correctly marked in the
> "live" bitmap, including FLAGS register that is ignored by current
> approach.
>
> 2012-01-12  Uros Bizjak  <ubizjak@gmail.com>
>
> 	* recog.c (peep2_find_free_register): Determine clobbered registers
> 	from insn pattern.

Is that a complete solution though?  Don't we need to do more, for example 
because of peep2_reg_dead_p and peep2_update_life?  These are not rhetorical 
questions, but genuine ones; it's a little disturbing to discover such a flaw 
in this kind of code after all these years (I can reproduce the problem with 
all the compilers of the 4.x series, so this didn't work with flow.c either).

Thanks for debugging this in any case.

-- 
Eric Botcazou



More information about the Gcc-patches mailing list