Deadly optimization bug (all gcc versions!)

Joern Rennecke amylaar@cygnus.co.uk
Mon Aug 16 15:54:00 GMT 1999


> After the call to try_combine the instructions are deleted. try_combine is
> entered with:
> (gdb) p debug_rtx(i3)
> 
> (insn 22 20 24 (set (reg:SI 86)
>         (lshiftrt:SI (reg:SI 3 r3)
>             (const_int 1 [0x1]))) 52 {*addsi3_internal1} (insn_list 14 (insn_list 20 (nil)))
>     (expr_list:REG_DEAD (reg/v:SI 85)
>         (expr_list:REG_DEAD (reg:SI 87)
>             (nil))))
> $134 = void
> (gdb) p debug_rtx(i2)
> 
> (insn 20 17 22 (set (reg:SI 87)
>         (lshiftrt:SI (reg/v:SI 84)
>             (const_int 1 [0x1]))) 211 {lshrsi3_no_power} (insn_list 17 (nil))
>     (expr_list:REG_DEAD (reg/v:SI 84)
>         (nil)))
> $135 = void
> (gdb) p debug_rtx(i1)
> 
> (insn 14 11 17 (set (reg/v:SI 85)
>         (lshiftrt:SI (reg:SI 3 r3)
>             (const_int 1 [0x1]))) 211 {lshrsi3_no_power} (nil)
>     (expr_list:REG_DEAD (reg:SI 3 r3)
>         (nil)))

try_combine assumes that i2 feeds i3, and i1 feeds i2 and/or i3.
This is clearly not the case here, the the call is in error.
Look for the cause, probably some bogus LOG_LINKS.


More information about the Gcc mailing list