Problem with peephole optimizing the register

Ian Lance Taylor iant@google.com
Tue Oct 4 16:30:00 GMT 2011


"Naveen H. S" <Naveen.S@kpitcummins.com> writes:

> It can be noted that the value at Fdi(label ref) is copied into r7 
> register. The r7 register is modified and the branch depends on r7.
> However, with tbit peepholes; r7 register is optimized away.
>
> In an application, r7 register is being used as source in the
> sequence after tbit instruction. The above snippet shows that
> the r7 value is moved into r2. However, as the r2 value is optimized
> away; wrong value is moved into r2 and hence application crashes.
> The peep2_reg_dead_p, find_reg_note and other functions were tried 
> out without much use.

Show us the RTL and the define_peephole2.

>From what you have described so far peep2_reg_dead_p ought to work.

Also, which version of gcc?

Ian



More information about the Gcc-help mailing list