This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, avr]PING^2 Fix PR36609 incorrect RTL for test reversal pattern
- From: Andy H <hutchinsonandy at aim dot com>
- To: gcc-patches at gcc dot gnu dot org, Anatoly Sokolov <aesok at post dot ru>
- Cc: Denis Chertykov <chertykov at gmail dot com>
- Date: Sun, 07 Sep 2008 11:05:32 -0400
- Subject: [PATCH, avr]PING^2 Fix PR36609 incorrect RTL for test reversal pattern
Anatoly,
Third posting - no comment received.
Can you please approve?
Andy
Andy H wrote:
The attach patch fixes
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36609
where incorrect code is created by AVR test reversal insn pattern when
signed oveflow behavior is specified.
New reversed _tst insn is defined for cc0=CMP 0, r pattern. RTL
generated by avr_reorg is changed to use this for test and jump
optimizations. No changes occur in the assembler created. This RTL is
always correct regardless of overflow behavior.
The negated_tst patterns are changed to a single define and split for
modes QI-SI. This split is conditional on compiler options allowing
undefined behavior for signed overflow such as Neg -32768. Tests such
as that used in PR24493-1, are now correct and the existing
optimization is retained.
Tested on avr-unknown-none target hosted on i686-pc-linux-gnu with no
regressions. Test PR24493-1, now pass.
Ok for 4.4 head?
2008-07-04 Andy Hutchinson <hutchinsonandy@aim.com>
PR target/36609
* config/avr/avr.c (avr_reorg) : Create RTL for reversed compare
with 0.
* config/avr/avr.md (QISI) : Define mode iterator.
(negated_tst<mode>) : Redefine as split using mode macro.
(reversed_tstqi): Define insn as reversed compare with zero.
(reversed_tsthi): Ditto.
(reversed_tstsi): Ditto.