PR 28634: dbr_schedule makes an invalid FP transformation

Jeffrey Law law@redhat.com
Mon Aug 14 12:31:00 GMT 2006


On Mon, 2006-08-14 at 07:07 +0100, Richard Sandiford wrote:
> This patch fixes PR rtl-optimization/28634, a 4.1 and 4.2 regression.
> The bug has actually been there for a long time, but whether it triggers
> for this testcase or not depends on how the loop is optimised.
> 
> If a branch is likely taken, dbr_schedule will consider filling its
> delay slot with an addition from the branch target.  If it does so,
> it will insert a compensating subtract for when the branch isn't taken.
> 
> The problem is, it assumes A + X - X == A for floating-point modes too,
> which is of course not true.  This patch makes the optimization conditional
> on flag_unsafe_math_optimizations for FP modes.
> 
> Regression tested on mipsisa64-elf (all multilibs).  Also bootstrapped
> & regression tested on x86_64-linux-gnu as a sanity check.  OK for
> trunk and 4.1?  Given the nature of the bug, it is likely to be a
> 4.0 regression for _some_ testcase, but as I haven't got an example
> to hand, I won't push for 4.0.
> 
> Richard
> 
> 
> gcc/
> 	PR rtl-optimization/28634
> 	* reorg.c (fill_slots_from_thread): Do not assume A + X - X == A
> 	for floating-point modes unless flag_unsafe_math_optimizations.
> 
> gcc/testsuite/
> 	PR rtl-optimization/28634
> 	* gcc.c-torture/execute/ieee/pr28634.c: New test.
Approved for mainline.  Also approved for 4.1 assuming we're in a state
where random regression fixes can be installed.

Jeff




More information about the Gcc-patches mailing list