re PR target/84209 ([avr] Don't split SP in split2)
authorGeorg-Johann Lay <avr@gjlay.de>
Wed, 7 Feb 2018 09:59:52 +0000 (09:59 +0000)
committerDenis Chertykov <denisc@gcc.gnu.org>
Wed, 7 Feb 2018 09:59:52 +0000 (12:59 +0300)
PR target/84209
* config/avr/avr.h (GENERAL_REGNO_P, GENERAL_REG_P): New macros.
* config/avr/avr.md: Only post-reload split REG-REG moves if
either register is REGERAL_REG_P.

From-SVN: r257440

gcc/ChangeLog
gcc/config/avr/avr.h
gcc/config/avr/avr.md

index 088aa47757457b4f91ca395d8203faa3175b2583..7bcda10e22cb6909386a6379180f03be9c9e926c 100644 (file)
@@ -1,3 +1,10 @@
+2018-02-07  Georg-Johann Lay  <avr@gjlay.de>
+
+       PR target/84209
+       * config/avr/avr.h (GENERAL_REGNO_P, GENERAL_REG_P): New macros.
+       * config/avr/avr.md: Only post-reload split REG-REG moves if
+       either register is REGERAL_REG_P.
+
 2018-02-07  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/84235
index 76d18ae6716ada4cb43cd91fbccd2d484ddc8a83..cf8e0bfd972c2ea18aef8266e0525d359d401ccc 100644 (file)
@@ -153,6 +153,9 @@ FIXME: DRIVER_SELF_SPECS has changed.
 
 #define FIRST_PSEUDO_REGISTER 36
 
+#define GENERAL_REGNO_P(N)     IN_RANGE (N, 2, 31)
+#define GENERAL_REG_P(X)       (REG_P (X) && GENERAL_REGNO_P (REGNO (X)))
+
 #define FIXED_REGISTERS {\
   1,1,/* r0 r1 */\
   0,0,/* r2 r3 */\
index 9fad0515e36057c25f6c12a2fec6352b73224d04..e619e695418c0ccfde8c737896a6ce61d39303f0 100644 (file)
         (match_operand:HI 1 "reg_or_0_operand"))]
   "optimize
    && reload_completed
+   && GENERAL_REG_P (operands[0])
+   && (operands[1] == const0_rtx || GENERAL_REG_P (operands[1]))
    && (!AVR_HAVE_MOVW
        || const0_rtx == operands[1])"
   [(set (match_dup 2) (match_dup 3))