Correct failures with --enable-checking=yes,rtl.
authorMichael Eager <eager@eagercon.com>
Thu, 9 Mar 2017 18:09:39 +0000 (18:09 +0000)
committerMichael Eager <eager@gcc.gnu.org>
Thu, 9 Mar 2017 18:09:39 +0000 (18:09 +0000)
        * config/microblaze/microblaze.c (microblaze_expand_shift):
        Replace GET_CODE test with CONST_INT_P and INTVAL test with
        test for const0_rtx.
        * config/microblaze/microblaze.md (ashlsi3_byone, ashrsi3_byone,
        lshrsi3_byone): Replace INTVAL with test for const1_rtx.

From-SVN: r246012

gcc/ChangeLog
gcc/config/microblaze/microblaze.c
gcc/config/microblaze/microblaze.md

index 2c1b515b9107cda0803be312fd2c58c229fb7b1a..96fb28b0901d61587039efa486a60df12ae45e31 100644 (file)
@@ -1,3 +1,13 @@
+2017-03-09  Michael Eager  <eager@eagercon.com>
+
+       Correct failures with --enable-checking=yes,rtl.
+
+       * config/microblaze/microblaze.c (microblaze_expand_shift):
+       Replace GET_CODE test with CONST_INT_P and INTVAL test with
+       test for const0_rtx.
+       * config/microblaze/microblaze.md (ashlsi3_byone, ashrsi3_byone,
+       lshrsi3_byone): Replace INTVAL with test for const1_rtx.
+       
 2017-03-09  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/79977
index 746bef1faea4367ba4afaefd81cc472eda9dc589..fb115e69e766d4cd0267a0820bcd444eebc4488b 100644 (file)
@@ -3323,10 +3323,10 @@ microblaze_expand_shift (rtx operands[])
              || (GET_CODE (operands[1]) == SUBREG));
 
   /* Shift by zero -- copy regs if necessary.  */
-  if ((GET_CODE (operands[2]) == CONST_INT) && (INTVAL (operands[2]) == 0))
+  if (CONST_INT_P (operands[2]) && (operands[2] == const0_rtx)
+      && !rtx_equal_p (operands[0], operands[1]))
     {
-      if (REGNO (operands[0]) != REGNO (operands[1]))
-       emit_insn (gen_movsi (operands[0], operands[1]));
+      emit_insn (gen_movsi (operands[0], operands[1]));
       return 1;
     }
 
index 66ebc1e5949821df936b00bc65dfcb43eea08259..b3a0011fd7e800ef9da97d583562b85bc2a68b29 100644 (file)
   [(set (match_operand:SI 0 "register_operand" "=d")
        (ashift:SI (match_operand:SI 1 "register_operand" "d")
                    (match_operand:SI 2 "arith_operand"    "I")))] 
-  "(INTVAL (operands[2]) == 1)"
+  "(operands[2] == const1_rtx)"
   "addk\t%0,%1,%1"
   [(set_attr "type"    "arith")
    (set_attr "mode"    "SI")
   [(set (match_operand:SI 0 "register_operand" "=d")
        (ashiftrt:SI (match_operand:SI 1 "register_operand" "d")
                      (match_operand:SI 2 "arith_operand"    "I")))] 
-  "(INTVAL (operands[2]) == 1)"
+  "(operands[2] == const1_rtx)"
   "sra\t%0,%1"
   [(set_attr "type"    "arith")
    (set_attr "mode"    "SI")
   [(set (match_operand:SI 0 "register_operand" "=d")
        (lshiftrt:SI (match_operand:SI 1 "register_operand" "d")
                      (match_operand:SI 2 "arith_operand"    "I")))] 
-  "(INTVAL (operands[2]) == 1)"
+  "(operands[2] == const1_rtx)"
   "srl\t%0,%1"
   [(set_attr "type"    "arith")
    (set_attr "mode"    "SI")