OSDN Git Service

2005-07-12 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Jul 2005 17:02:54 +0000 (17:02 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Jul 2005 17:02:54 +0000 (17:02 +0000)
        PR tree-opt/22335
        * gcc.dg/pr22335-1.c: New test.
        * gcc.dg/pr22335-2.c: New test.

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

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr22335-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr22335-2.c [new file with mode: 0644]

index 6502977..914f9a5 100644 (file)
@@ -1,3 +1,9 @@
+2005-07-12  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR tree-opt/22335
+       * gcc.dg/pr22335-1.c: New test.
+       * gcc.dg/pr22335-2.c: New test.
+
 2005-07-12  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/20172
diff --git a/gcc/testsuite/gcc.dg/pr22335-1.c b/gcc/testsuite/gcc.dg/pr22335-1.c
new file mode 100644 (file)
index 0000000..a2a760b
--- /dev/null
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdelete-null-pointer-checks"  } */
+int t(int *a)
+{
+  int i;
+  *a = 1;
+  i = a == 0;
+  return i;
+}
+
diff --git a/gcc/testsuite/gcc.dg/pr22335-2.c b/gcc/testsuite/gcc.dg/pr22335-2.c
new file mode 100644 (file)
index 0000000..afba955
--- /dev/null
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O2"  } */
+void abort(void) __attribute__((__noreturn__));
+typedef struct {
+  int container;
+} edge_iterator;
+struct ls_expr
+{
+  int index;
+  int stores;
+  struct ls_expr * next;
+};
+struct ls_expr * pre_ldst_mems;
+edge_iterator ei;
+void
+store_motion (void)
+{
+  struct ls_expr * ptr, **prev_next_ptr_ptr;
+  edge_iterator ei1;
+  edge_iterator ei2;
+  int a = ptr != ((void *)0);
+  for (ptr = pre_ldst_mems, prev_next_ptr_ptr = &pre_ldst_mems;
+       ptr != ((void *)0);
+       ptr = *prev_next_ptr_ptr)
+    if (!((ptr)->stores))
+     *prev_next_ptr_ptr = ptr->next;
+    else
+      prev_next_ptr_ptr = &ptr->next;
+
+  for (ptr = pre_ldst_mems; ptr != 0; ptr = ptr->next)
+    ;
+  ei1 = ei;
+  ei2 = ei1;
+  if (!ei2.container)
+    abort ();
+  ei2 = ei1;
+  if (!ei2.container)
+    abort ();
+}