Fix ICE.
authorliuhongt <hongtao.liu@intel.com>
Mon, 16 Aug 2021 09:12:21 +0000 (17:12 +0800)
committerliuhongt <hongtao.liu@intel.com>
Mon, 16 Aug 2021 09:22:11 +0000 (17:22 +0800)
gcc/ChangeLog:

PR target/101930
* config/i386/i386.md (ldexp<mode>3): Force operands[1] to
reg.

gcc/testsuite/ChangeLog:

PR target/101930
* gcc.target/i386/pr101930.c: New test.

gcc/config/i386/i386.md
gcc/testsuite/gcc.target/i386/pr101930.c [new file with mode: 0644]

index 4a8e8fe..41d8562 100644 (file)
   if (TARGET_AVX512F && TARGET_SSE_MATH)
    {
      rtx op2 = gen_reg_rtx (<MODE>mode);
-
-     if (!nonimmediate_operand (operands[1], <MODE>mode))
-       operands[1] = force_reg (<MODE>mode, operands[1]);
+     operands[1] = force_reg (<MODE>mode, operands[1]);
 
      emit_insn (gen_floatsi<mode>2 (op2, operands[2]));
      emit_insn (gen_avx512f_scalef<mode>2 (operands[0], operands[1], op2));
diff --git a/gcc/testsuite/gcc.target/i386/pr101930.c b/gcc/testsuite/gcc.target/i386/pr101930.c
new file mode 100644 (file)
index 0000000..7207dd1
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-mavx512f -O2 -mfpmath=sse -ffast-math" } */
+double a;
+double
+__attribute__((noipa))
+foo (int b)
+{
+  return __builtin_ldexp (a, b);
+}