re PR rtl-optimization/79593 (Poor/Worse code generation for FPU on versions after 6)
authorUros Bizjak <uros@gcc.gnu.org>
Tue, 21 Feb 2017 18:29:57 +0000 (19:29 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Tue, 21 Feb 2017 18:29:57 +0000 (19:29 +0100)
PR target/79593
* config/i386/i386.md (standard_x87sse_constant_load splitter):
Use nonimmediate_operand instead of memory_operand for operand 1.
(float-extend standard_x87sse_constant_load splitter): Ditto.

testsuite/ChangeLog:

PR target/79593
* gcc.target/i386/pr79593.c: New test.

From-SVN: r245640

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

index cfbe0b050b578937c17655405cca58b0317a877d..23f2ea022db64a4c21b3b00f3aad9f776174ad70 100644 (file)
 
 (define_split
   [(set (match_operand 0 "any_fp_register_operand")
-       (match_operand 1 "memory_operand"))]
+       (match_operand 1 "nonimmediate_operand"))]
   "reload_completed
    && (GET_MODE (operands[0]) == TFmode
        || GET_MODE (operands[0]) == XFmode
 
 (define_split
   [(set (match_operand 0 "any_fp_register_operand")
-       (float_extend (match_operand 1 "memory_operand")))]
+       (float_extend (match_operand 1 "nonimmediate_operand")))]
   "reload_completed
    && (GET_MODE (operands[0]) == TFmode
        || GET_MODE (operands[0]) == XFmode
diff --git a/gcc/testsuite/gcc.target/i386/pr79593.c b/gcc/testsuite/gcc.target/i386/pr79593.c
new file mode 100644 (file)
index 0000000..c116634
--- /dev/null
@@ -0,0 +1,17 @@
+/* PR target/79593 */
+/* { dg-do compile } */
+/* { dg-options "-Ofast -mfpmath=387" } */
+
+extern float global_data[1024];
+
+static long double MIN (long double a, long double b) { return a < b ? a : b; }
+static long double MAX (long double a, long double b) { return a > b ? a : b; }
+
+float bar (void)
+{
+  long double delta = (global_data[0]);
+
+  return (MIN (MAX (delta, 0.0l), 1.0l));
+}
+
+/* { dg-final { scan-assembler-not "fld\[ \t\]+%st" } } */