This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with peephole optimizing the register
- From: Ian Lance Taylor <iant at google dot com>
- To: "Naveen H. S" <Naveen dot S at kpitcummins dot com>
- Cc: "gcc-help\ at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Tue, 04 Oct 2011 09:30:11 -0700
- Subject: Re: Problem with peephole optimizing the register
- References: <5CD0E437A05A514A90A1B12527F331540E4182@KCHJEXMB02.kpit.com> <mcrhb4os4lw.fsf@coign.corp.google.com> <5CD0E437A05A514A90A1B12527F33154176B9EAB@KCHJEXMB02.kpit.com>
"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