re PR middle-end/85414 (ICE: in ix86_expand_prologue, at config/i386/i386.c:13810...
authorJakub Jelinek <jakub@redhat.com>
Wed, 25 Apr 2018 13:10:01 +0000 (15:10 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 25 Apr 2018 13:10:01 +0000 (15:10 +0200)
PR middle-end/85414
* simplify-rtx.c (simplify_unary_operation_1) <case SIGN_EXTEND,
case ZERO_EXTEND>: Pass SUBREG_REG (op) rather than op to
gen_lowpart_no_emit.

From-SVN: r259649

gcc/ChangeLog
gcc/expr.c
gcc/simplify-rtx.c

index e65ab7bd83f6da50230365f933484ba729e796ed..e2f6e9cd9fdc85bb6b87d338422ce902365808a8 100644 (file)
@@ -1,3 +1,10 @@
+2018-04-25  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/85414
+       * simplify-rtx.c (simplify_unary_operation_1) <case SIGN_EXTEND,
+       case ZERO_EXTEND>: Pass SUBREG_REG (op) rather than op to
+       gen_lowpart_no_emit.
+
 2018-04-25  Sebastian Peryt  <sebastian.peryt@intel.com>
 
        PR target/85473
index c9e6bf228a41bcf5929030186e9fa11029759882..9dd0e60d24d3e4829c44b2df65f2013920eced48 100644 (file)
@@ -233,7 +233,10 @@ convert_move (rtx to, rtx from, int unsignedp)
       && (GET_MODE_PRECISION (subreg_promoted_mode (from))
          >= GET_MODE_PRECISION (to_int_mode))
       && SUBREG_CHECK_PROMOTED_SIGN (from, unsignedp))
-    from = gen_lowpart (to_int_mode, from), from_mode = to_int_mode;
+    {
+      from = gen_lowpart (to_int_mode, SUBREG_REG (from));
+      from_mode = to_int_mode;
+    }
 
   gcc_assert (GET_CODE (to) != SUBREG || !SUBREG_PROMOTED_VAR_P (to));
 
index 9ce180da559c71af5712258c3f01e31ebd2044a9..e96c9d1b441fcfcbddcbffb0c1c7c0e2a871a2a3 100644 (file)
@@ -1484,7 +1484,7 @@ simplify_unary_operation_1 (enum rtx_code code, machine_mode mode, rtx op)
          && SUBREG_PROMOTED_SIGNED_P (op)
          && !paradoxical_subreg_p (mode, GET_MODE (SUBREG_REG (op))))
        {
-         temp = rtl_hooks.gen_lowpart_no_emit (mode, op);
+         temp = rtl_hooks.gen_lowpart_no_emit (mode, SUBREG_REG (op));
          if (temp)
            return temp;
        }
@@ -1567,7 +1567,7 @@ simplify_unary_operation_1 (enum rtx_code code, machine_mode mode, rtx op)
          && SUBREG_PROMOTED_UNSIGNED_P (op)
          && !paradoxical_subreg_p (mode, GET_MODE (SUBREG_REG (op))))
        {
-         temp = rtl_hooks.gen_lowpart_no_emit (mode, op);
+         temp = rtl_hooks.gen_lowpart_no_emit (mode, SUBREG_REG (op));
          if (temp)
            return temp;
        }