]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/88594 (ICE in int_mode_for_mode, at stor-layout.c:403)
authorJakub Jelinek <jakub@redhat.com>
Fri, 30 Aug 2019 11:25:16 +0000 (13:25 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 30 Aug 2019 11:25:16 +0000 (13:25 +0200)
Backported from mainline
2019-01-04  Jakub Jelinek  <jakub@redhat.com>

PR target/88594
* config/i386/i386.c (ix86_expand_divmod_libfunc): Use mode instead
of GET_MODE (opN) as modes of the libcall arguments.

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

From-SVN: r275084

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr88594.c [new file with mode: 0644]

index 7c3d589b62605c042810d99e5ed61cd430e3aae5..28cf110358e0e791c29229c611afb9af8f26136a 100644 (file)
@@ -1,6 +1,12 @@
 2019-08-30  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2019-01-04  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/88594
+       * config/i386/i386.c (ix86_expand_divmod_libfunc): Use mode instead
+       of GET_MODE (opN) as modes of the libcall arguments.
+
        2019-01-03  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/88644
index 96bdb3a78ba93ed4cd943b63d730c771fe2f9b80..b2db7339c23ac7755526609e5cdc385aa8c2bc70 100644 (file)
@@ -52350,10 +52350,8 @@ ix86_expand_divmod_libfunc (rtx libfunc, machine_mode mode,
   rtx rem = assign_386_stack_local (mode, SLOT_TEMP);
 
   rtx quot = emit_library_call_value (libfunc, NULL_RTX, LCT_NORMAL,
-                                   mode, 3,
-                                   op0, GET_MODE (op0),
-                                   op1, GET_MODE (op1),
-                                   XEXP (rem, 0), Pmode);
+                                     mode, 3, op0, mode, op1, mode,
+                                     XEXP (rem, 0), Pmode);
   *quot_p = quot;
   *rem_p = rem;
 }
index 021f53c43f990d147c1424c66e16deed3ac54a49..3d5bbcdc986be9d474e1b15a11810bd6f6e3c461 100644 (file)
@@ -1,6 +1,11 @@
 2019-08-30  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2019-01-04  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/88594
+       * gcc.dg/pr88594.c: New test.
+
        2019-01-03  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/88644
diff --git a/gcc/testsuite/gcc.dg/pr88594.c b/gcc/testsuite/gcc.dg/pr88594.c
new file mode 100644 (file)
index 0000000..6e3f299
--- /dev/null
@@ -0,0 +1,16 @@
+/* PR target/88594 */
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-O2 -fno-tree-dominator-opts -fno-tree-forwprop -fno-tree-vrp" } */
+
+__int128
+foo (__int128 x, __int128 *y)
+{
+  int a;
+  __int128 z, r;
+  for (a = 0; a < 17; ++a)
+    ;
+  z = x / a;
+  r = x % a;
+  *y = z;
+  return r;
+}