From 9d3ac5e3dbd66b76cdbc13128d0991a5775a6d08 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 4 Jan 2019 10:00:05 +0100 Subject: [PATCH] re PR target/88594 (ICE in int_mode_for_mode, at stor-layout.c:403) 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: r267571 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.c | 4 +--- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr88594.c | 16 ++++++++++++++++ 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr88594.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 236a5ca9e13..28ba3ba3248 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-01-04 Jakub Jelinek + + 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-04 Jan Beulich * config/i386/sse.md diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 5de381d4047..016d6e3fcb5 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -51014,9 +51014,7 @@ 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, - op0, GET_MODE (op0), - op1, GET_MODE (op1), + mode, op0, mode, op1, mode, XEXP (rem, 0), Pmode); *quot_p = quot; *rem_p = rem; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f88ee9e5be9..47fabcce520 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-01-04 Jakub Jelinek + + PR target/88594 + * gcc.dg/pr88594.c: New test. + 2019-01-04 Jan Beulich * gcc.target/i386/avx512bitalg-vpshufbitqmb.c, diff --git a/gcc/testsuite/gcc.dg/pr88594.c b/gcc/testsuite/gcc.dg/pr88594.c new file mode 100644 index 00000000000..6e3f2994056 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr88594.c @@ -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; +} -- 2.30.2