Combine simplify_set WORD_REGISTER_OPERATIONS
authorAlan Modra <amodra@gmail.com>
Wed, 4 May 2016 00:11:32 +0000 (09:41 +0930)
committerAlan Modra <amodra@gcc.gnu.org>
Wed, 4 May 2016 00:11:32 +0000 (09:41 +0930)
The comment says this test is supposed to prevent "a narrower
operation than requested", but it actually only allows a larger
subreg not one the same size.  Fix that.

* combine.c (simplify_set): Correct WORD_REGISTER_OPERATIONS test.

From-SVN: r235852

gcc/ChangeLog
gcc/combine.c

index 79fb0f48598d709afdf96ae228c52c8f64c5ae14..77d81cc57192b20c13dcf94c4088ee2ee794c43c 100644 (file)
@@ -1,3 +1,7 @@
+2016-05-04  Alan Modra  <amodra@gmail.com>
+
+       * combine.c (simplify_set): Correct WORD_REGISTER_OPERATIONS test.
+
 2016-05-04  Alan Modra  <amodra@gmail.com>
 
        PR target/70866
index 0ab3f97db697b723dbfcfda0537269c0367cf0b3..3554f515582c3e49d20be7fa91e03207ffacfb7b 100644 (file)
@@ -6736,7 +6736,7 @@ simplify_set (rtx x)
               + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD))
       && (WORD_REGISTER_OPERATIONS
          || (GET_MODE_SIZE (GET_MODE (src))
-             < GET_MODE_SIZE (GET_MODE (SUBREG_REG (src)))))
+             <= GET_MODE_SIZE (GET_MODE (SUBREG_REG (src)))))
 #ifdef CANNOT_CHANGE_MODE_CLASS
       && ! (REG_P (dest) && REGNO (dest) < FIRST_PSEUDO_REGISTER
            && REG_CANNOT_CHANGE_MODE_P (REGNO (dest),