OSDN Git Service

PR target/47665
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Feb 2011 14:19:44 +0000 (14:19 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Feb 2011 14:19:44 +0000 (14:19 +0000)
* combine.c (make_compound_operation): Only change shifts into
multiplication for SCALAR_INT_MODE_P.

* gcc.target/i386/pr47665.c: New test.

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr47684.c [new file with mode: 0644]
gcc/tree-predcom.c

index 9e8c392..e4ca2b6 100644 (file)
@@ -1,3 +1,9 @@
+2011-02-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/47665
+       * combine.c (make_compound_operation): Only change shifts into
+       multiplication for SCALAR_INT_MODE_P.
+
 2011-02-11  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        PR testsuite/47400
index c5bf3eb..10e3be7 100644 (file)
@@ -1,3 +1,8 @@
+2011-02-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/47665
+       * gcc.target/i386/pr47665.c: New test.
+
 2011-02-11  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        PR target/47629
diff --git a/gcc/testsuite/gcc.dg/pr47684.c b/gcc/testsuite/gcc.dg/pr47684.c
new file mode 100644 (file)
index 0000000..475aa15
--- /dev/null
@@ -0,0 +1,20 @@
+/* PR debug/47684 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fcompare-debug" } */
+
+int in[8][4];
+int out[4];
+
+void
+foo (void)
+{
+  int sum = 1;
+  int i, j, k;
+  for (k = 0; k < 4; k++)
+    {
+      for (j = 0; j < 4; j++)
+       for (i = 0; i < 4; i++)
+         sum *= in[i + k][j];
+      out[k] = sum;
+    }
+}
index f744d44..2dbd07d 100644 (file)
@@ -1,5 +1,5 @@
 /* Predictive commoning.
-   Copyright (C) 2005, 2007, 2008, 2009, 2010
+   Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -1668,6 +1668,8 @@ single_nonlooparound_use (tree name)
 
          return NULL;
        }
+      else if (is_gimple_debug (stmt))
+       continue;
       else if (ret != NULL)
        return NULL;
       else