OSDN Git Service

PR target/41680
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Oct 2009 13:35:03 +0000 (13:35 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Oct 2009 13:35:03 +0000 (13:35 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152665 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr41680.C [new file with mode: 0644]

index 14a918b..b79f323 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 43873c5..22ea39c 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 36d90f3..11da3e7 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);
+    }
+}