re PR middle-end/85414 (ICE: in ix86_expand_prologue, at config/i386/i386.c:13810...
authorJakub Jelinek <jakub@redhat.com>
Tue, 17 Apr 2018 09:16:48 +0000 (11:16 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 17 Apr 2018 09:16:48 +0000 (11:16 +0200)
PR middle-end/85414
* rtlhooks.c (gen_lowpart_if_possible): Don't call gen_lowpart_SUBREG
on a SUBREG.

* gcc.dg/pr85414.c: New test.

From-SVN: r259433

gcc/ChangeLog
gcc/rtlhooks.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr85414.c [new file with mode: 0644]

index 21966a39d8e524a47c6569fbffece51aef59915c..e444bf1c7c1632d154fb6640f5d30115854b0cb8 100644 (file)
@@ -1,3 +1,9 @@
+2018-04-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/85414
+       * rtlhooks.c (gen_lowpart_if_possible): Don't call gen_lowpart_SUBREG
+       on a SUBREG.
+
 2018-04-17  Martin Jambor  <mjambor@suse.cz>
 
        PR ipa/85421
index ecdebbbeb8149516623c53f7732b6a2392479a6a..59145506a25d1cac0b2bba6fb8ff3d6309bc187d 100644 (file)
@@ -123,9 +123,9 @@ gen_lowpart_if_possible (machine_mode mode, rtx x)
 
       return new_rtx;
     }
-  else if (mode != GET_MODE (x) && GET_MODE (x) != VOIDmode
+  else if (mode != GET_MODE (x) && GET_MODE (x) != VOIDmode && !SUBREG_P (x)
           && validate_subreg (mode, GET_MODE (x), x,
-                               subreg_lowpart_offset (mode, GET_MODE (x))))
+                              subreg_lowpart_offset (mode, GET_MODE (x))))
     return gen_lowpart_SUBREG (mode, x);
   else
     return 0;
index 9e44409cb7af099834842547b0dc0eedc89ad175..95bdc0349b4a1084fadd93db7cd9c619615e0719 100644 (file)
@@ -1,3 +1,8 @@
+2018-04-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/85414
+       * gcc.dg/pr85414.c: New test.
+
 2018-04-17  Martin Jambor  <mjambor@suse.cz>
 
        PR ipa/85421
diff --git a/gcc/testsuite/gcc.dg/pr85414.c b/gcc/testsuite/gcc.dg/pr85414.c
new file mode 100644 (file)
index 0000000..d061324
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR middle-end/85414 */
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-Og -fgcse -Wno-uninitialized" } */
+
+int
+foo (void)
+{
+  unsigned __int128 c;
+  return __builtin_mul_overflow_p (59, -c, (short) 0);
+}