OSDN Git Service

2010-02-04 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Feb 2010 16:14:17 +0000 (16:14 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Feb 2010 16:14:17 +0000 (16:14 +0000)
PR rtl-optimization/42952
* dse.c (const_or_frame_p): Remove MEM handling.

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

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

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

index 072261e..35a10e6 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-02-04  Nick Clifton  <nickc@redhat.com>
 
        * config/mn10300/mn10300.c (TARGET_ASM_OUTPUT_MI_THUNK): Define.
index e72b998..239d0fb 100644 (file)
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -1015,9 +1015,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 0e84ff6..4a4273e 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-02-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR libfortran/42901
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;
+}