OSDN Git Service

Don't return identity for CONST or symbolic reference
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Aug 2012 15:33:28 +0000 (15:33 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Aug 2012 15:33:28 +0000 (15:33 +0000)
gcc/

2012-08-09  H.J. Lu  <hongjiu.lu@intel.com>

Backport from mainline
2012-08-08  Richard Sandiford  <rdsandiford@googlemail.com>
    H.J. Lu  <hongjiu.lu@intel.com>

PR rtl-optimization/54157
* combine.c (gen_lowpart_for_combine): Don't return identity
for CONST or symbolic reference.

gcc/testsuite/

2012-08-09  H.J. Lu  <hongjiu.lu@intel.com>

Backport from mainline
2012-08-08  H.J. Lu  <hongjiu.lu@intel.com>

PR rtl-optimization/54157
* gcc.target/i386/pr54157.c: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@190256 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/combine.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr54157.c [new file with mode: 0644]

index bc7c36c..44b0d32 100644 (file)
@@ -1,3 +1,13 @@
+2012-08-09  H.J. Lu  <hongjiu.lu@intel.com>
+
+       Backport from mainline
+       2012-08-08  Richard Sandiford  <rdsandiford@googlemail.com>
+                   H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR rtl-optimization/54157
+       * combine.c (gen_lowpart_for_combine): Don't return identity
+       for CONST or symbolic reference.
+
 2012-08-06  Uros Bizjak  <ubizjak@gmail.com>
 
        Backport from mainline
index 3d81da8..67bd776 100644 (file)
@@ -10802,13 +10802,6 @@ gen_lowpart_for_combine (enum machine_mode omode, rtx x)
   if (omode == imode)
     return x;
 
-  /* Return identity if this is a CONST or symbolic reference.  */
-  if (omode == Pmode
-      && (GET_CODE (x) == CONST
-         || GET_CODE (x) == SYMBOL_REF
-         || GET_CODE (x) == LABEL_REF))
-    return x;
-
   /* We can only support MODE being wider than a word if X is a
      constant integer or has a mode the same size.  */
   if (GET_MODE_SIZE (omode) > UNITS_PER_WORD
index 9fd8113..ef35a62 100644 (file)
@@ -1,3 +1,11 @@
+2012-08-09  H.J. Lu  <hongjiu.lu@intel.com>
+
+       Backport from mainline
+       2012-08-08  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR rtl-optimization/54157
+       * gcc.target/i386/pr54157.c: New file.
+
 2012-08-01  Uros Bizjak  <ubizjak@gmail.com>
 
        Backport from mainline
diff --git a/gcc/testsuite/gcc.target/i386/pr54157.c b/gcc/testsuite/gcc.target/i386/pr54157.c
new file mode 100644 (file)
index 0000000..59fcd79
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-options "-O2 -mx32 -ftree-vectorize" } */
+
+struct s2{
+  int n[24 -1][24 -1][24 -1];
+};
+
+struct test2{
+  struct s2 e;
+};
+
+struct test2 tmp2[4];
+
+void main1 ()
+{
+  int i,j;
+
+  for (i = 0; i < 24 -4; i++)
+      for (j = 0; j < 24 -4; j++)
+          tmp2[2].e.n[1][i][j] = 8;
+}