]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/42952 (possible integer wrong code bug)
authorRichard Guenther <rguenther@suse.de>
Thu, 4 Feb 2010 16:21:47 +0000 (16:21 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 4 Feb 2010 16:21:47 +0000 (16:21 +0000)
2010-02-04  Richard Guenther  <rguenther@suse.de>

PR rtl-optimization/42952
* dse.c (const_or_frame_p): Remove MEM handling.

* gcc.dg/torture/pr42952.c: New testcase.

From-SVN: r156496

gcc/ChangeLog
gcc/dse.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr42952.c [new file with mode: 0644]

index 67438610a93092a7e0b772064738e9033c65a0b3..750cd0b65d207930517749e86174685f9e2145c7 100644 (file)
@@ -1,3 +1,8 @@
+2010-02-04  Richard Guenther  <rguenther@suse.de>
+
+       PR rtl-optimization/42952
+       * dse.c (const_or_frame_p): Remove MEM handling.
+
 2010-01-31  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR middle-end/42898
index a6de40b51d1ad15dba2d86a53939b4a8575633db..9cd2948c4ab3348a8e7930ec986245fc81d4ae78 100644 (file)
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -964,9 +964,6 @@ const_or_frame_p (rtx x)
 {
   switch (GET_CODE (x))
     {
-    case MEM:
-      return MEM_READONLY_P (x);
-
     case CONST:
     case CONST_INT:
     case CONST_DOUBLE:
index ca235f90799f020f613d90595497f779105dbe11..bdebbf61556b0d9703b07b8cec53955edca1d6e8 100644 (file)
@@ -1,3 +1,8 @@
+2010-02-04  Richard Guenther  <rguenther@suse.de>
+
+       PR rtl-optimization/42952
+       * gcc.dg/torture/pr42952.c: New testcase.
+
 2010-01-31  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR middle-end/42898
diff --git a/gcc/testsuite/gcc.dg/torture/pr42952.c b/gcc/testsuite/gcc.dg/torture/pr42952.c
new file mode 100644 (file)
index 0000000..db8782a
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-fno-tree-ccp -fno-tree-fre" } */
+
+extern void abort (void);
+
+static int g[1];
+
+static int * const p = &g[0];
+static int * const q = &g[0];
+
+int main(void)
+{
+  g[0] = 1;
+  *p = 0;
+  *p = *q;
+  if (g[0] != 0)
+    abort ();
+  return 0;
+}