From: Uros Bizjak Date: Tue, 21 Feb 2017 18:29:57 +0000 (+0100) Subject: re PR rtl-optimization/79593 (Poor/Worse code generation for FPU on versions after 6) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a2b48844ed315cdceef32e22f15268eca0c71785;p=gcc.git re PR rtl-optimization/79593 (Poor/Worse code generation for FPU on versions after 6) 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 --- diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index cfbe0b050b5..23f2ea022db 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -3660,7 +3660,7 @@ (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 @@ -3672,7 +3672,7 @@ (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 index 00000000000..c1166341854 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr79593.c @@ -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" } } */