]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/41680 (ICE in trunc_int_for_mode)
authorJakub Jelinek <jakub@redhat.com>
Mon, 12 Oct 2009 13:35:03 +0000 (15:35 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 12 Oct 2009 13:35:03 +0000 (15:35 +0200)
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
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr41680.C [new file with mode: 0644]

index 14a918b3670741a089084b4061f0de5b9f6674b5..b79f323a11e62ef811ed12331df04ac919ae47a3 100644 (file)
@@ -1,3 +1,10 @@
+2009-10-12  Jakub Jelinek  <jakub@redhat.com>
+
+       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  <ubizjak@gmail.com>
 
        * config/i386/i386.md (*setcc_<mode>_2): Do not use ix86_expand_clear
index 43873c507eaff707728f8731240d5cf718e821e4..22ea39cf79bf9f5bb21f1e2372de5a2098eaecec 100644 (file)
   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;
index 36d90f3c9004d13892f04be033bdf455ca50495a..11da3e73dd79601fea40e568cef00b04d030253d 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-12  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/41680
+       * g++.dg/torture/pr41680.C: New test.
+
 2009-10-12  Dodji Seketeli  <dodji@redhat.com>
 
        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 (file)
index 0000000..7faab0d
--- /dev/null
@@ -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);
+    }
+}