From 821bdb23227503f21d8dc0e185bf1b10837b57a5 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 12 Oct 2009 15:35:03 +0200 Subject: re PR target/41680 (ICE in trunc_int_for_mode) PR target/41680 * config/i386/i386.md (split after *testqi_ext_3_rex64): Only narrow paradoxical subregs to prevent partial register stalls if the inner mode is integer mode. * g++.dg/torture/pr41680.C: New test. From-SVN: r152665 --- gcc/ChangeLog | 7 +++++++ gcc/config/i386/i386.md | 3 ++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/torture/pr41680.C | 23 +++++++++++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/torture/pr41680.C (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 14a918b..b79f323 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2009-10-12 Jakub Jelinek + + PR target/41680 + * config/i386/i386.md (split after *testqi_ext_3_rex64): Only narrow + paradoxical subregs to prevent partial register stalls if the inner + mode is integer mode. + 2009-10-12 Uros Bizjak * config/i386/i386.md (*setcc__2): Do not use ix86_expand_clear diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 43873c5..22ea39c 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -8571,7 +8571,8 @@ else if (GET_CODE (val) == SUBREG && (submode = GET_MODE (SUBREG_REG (val)), GET_MODE_BITSIZE (mode) > GET_MODE_BITSIZE (submode)) - && pos + len <= GET_MODE_BITSIZE (submode)) + && pos + len <= GET_MODE_BITSIZE (submode) + && GET_MODE_CLASS (submode) == MODE_INT) { /* Narrow a paradoxical subreg to prevent partial register stalls. */ mode = submode; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 36d90f3..11da3e7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-10-12 Jakub Jelinek + + PR target/41680 + * g++.dg/torture/pr41680.C: New test. + 2009-10-12 Dodji Seketeli PR c++/41570 diff --git a/gcc/testsuite/g++.dg/torture/pr41680.C b/gcc/testsuite/g++.dg/torture/pr41680.C new file mode 100644 index 0000000..7faab0d --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr41680.C @@ -0,0 +1,23 @@ +// PR target/41680 +// { dg-do compile } + +extern void baz (float); + +inline bool +bar (float x) +{ + union { float f; int i; } u; + u.f = x; + return (u.i & 1); +} + +void +foo (float *x) +{ + for (int i = 0; i < 10; i++) + { + float f = x[i]; + if (!bar (f)) + baz (f); + } +} -- cgit v1.1