From: Jakub Jelinek Date: Mon, 12 Oct 2009 13:35:03 +0000 (+0200) Subject: re PR target/41680 (ICE in trunc_int_for_mode) X-Git-Tag: releases/gcc-4.5.0~2961 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=821bdb23227503f21d8dc0e185bf1b10837b57a5;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 14a918b36707..b79f323a11e6 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 43873c507eaf..22ea39cf79bf 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 36d90f3c9004..11da3e73dd79 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 000000000000..7faab0d5fbc7 --- /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); + } +}