This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with peephole optimizing the register


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]