From: Jakub Jelinek Date: Wed, 24 Apr 2019 09:27:14 +0000 (+0200) Subject: re PR target/90187 (ICE in extract_insn, at recog.c:2304 x86_64) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=de6ae2ce078798024e647b8cc8afeca9d337817a;p=gcc.git re PR target/90187 (ICE in extract_insn, at recog.c:2304 x86_64) PR target/90187 * config/i386/i386.c (ix86_expand_sse_fp_minmax): Force if_true into a register if both if_true and if_false are MEMs. * g++.target/i386/pr90187.C: New test. From-SVN: r270537 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e098504f081..ba06d65583c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2019-04-24 Jakub Jelinek + PR target/90187 + * config/i386/i386.c (ix86_expand_sse_fp_minmax): Force if_true into + a register if both if_true and if_false are MEMs. + PR tree-optimization/90208 * tree-cfg.c (remove_bb): Move forced labels from removed bbs after labels of new_bb, not before them. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 498a35d8aea..191f570455b 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -23712,6 +23712,8 @@ ix86_expand_sse_fp_minmax (rtx dest, enum rtx_code code, rtx cmp_op0, else { code = is_min ? SMIN : SMAX; + if (MEM_P (if_true) && MEM_P (if_false)) + if_true = force_reg (mode, if_true); tmp = gen_rtx_fmt_ee (code, mode, if_true, if_false); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 19972ed55c3..42e75166b4a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-04-24 Jakub Jelinek + + PR target/90187 + * g++.target/i386/pr90187.C: New test. + 2019-04-24 Iain Buclaw * gdc.test/README.gcc: New file. diff --git a/gcc/testsuite/g++.target/i386/pr90187.C b/gcc/testsuite/g++.target/i386/pr90187.C new file mode 100644 index 00000000000..ed9e9fe3226 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/pr90187.C @@ -0,0 +1,15 @@ +// PR target/90187 +// { dg-do compile } +// { dg-options "-Ofast -ffloat-store" } + +double a[64]; +double *foo (void); + +void +bar (int x, const double *y) +{ + int i; + for (i = 0; i < x; i++) + if (y[i] < a[i]) + a[i] = y[i]; +}