OSDN Git Service

2006-01-11 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Jan 2006 19:44:57 +0000 (19:44 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Jan 2006 19:44:57 +0000 (19:44 +0000)
PR tree-optimization/25734
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Do not
stop propagation after successful propagation to the LHS.

* gcc.dg/tree-ssa/pr25734.c: New testcase.

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr25734.c [new file with mode: 0644]
gcc/tree-ssa-forwprop.c

index 692e45a..3e700b7 100644 (file)
@@ -1,3 +1,9 @@
+2006-01-11  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/25734
+       * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Do not
+       stop propagation after successful propagation to the LHS.
+
 2006-01-11  Kazu Hirata  <kazu@codesourcery.com>
 
        * basic-block.h (control_flow_graph): Change the type of
index 7347547..1160053 100644 (file)
@@ -1,3 +1,8 @@
+2006-01-11  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/25734
+       * gcc.dg/tree-ssa/pr25734.c: New testcase.
+
 2006-01-10  Bernhard Fischer  <rep.nop@aon.at>
 
        PR fortran/25486
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr25734.c b/gcc/testsuite/gcc.dg/tree-ssa/pr25734.c
new file mode 100644 (file)
index 0000000..a71c7f0
--- /dev/null
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+
+struct list_head {
+ struct list_head *next;
+};
+static inline __attribute__((always_inline)) void list_del_init(struct
+list_head *entry)
+{
+ __list_del(entry->next);
+ (entry)->next = (entry);
+};
+struct dentry {
+ void *d_fsdata;
+};
+struct sysfs_dirent {
+ struct list_head s_sibling;
+ struct list_head s_children;
+};
+const char *sysfs_get_name(struct sysfs_dirent *);
+void sysfs_hash_and_remove(struct dentry * dir, const char * name)
+{
+ struct sysfs_dirent * sd;
+ struct sysfs_dirent * parent_sd = dir->d_fsdata;
+ for (sd = (struct sysfs_dirent *)((&parent_sd->s_children)->next);
+     &sd->s_sibling != (&parent_sd->s_children);
+     sd  = (struct sysfs_dirent *)sd->s_sibling.next) {
+  if (!__builtin_strcmp(sysfs_get_name(sd), name))
+  {
+   list_del_init(&sd->s_sibling);
+   break;
+  }
+ }
+}
index 2f857dc..892edde 100644 (file)
@@ -686,7 +686,6 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt)
       TREE_OPERAND (lhs, 0) = unshare_expr (TREE_OPERAND (stmt, 1));
       fold_stmt_inplace (use_stmt);
       tidy_after_forward_propagate_addr (use_stmt);
-      return true;
     }
 
   /* Trivial case.  The use statement could be a trivial copy.  We
@@ -696,7 +695,7 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt)
      we can catch some cascading effects, ie the single use is
      in a copy, and the copy is used later by a single INDIRECT_REF
      for example.  */
-  if (TREE_CODE (lhs) == SSA_NAME && TREE_OPERAND (use_stmt, 1) == name)
+  else if (TREE_CODE (lhs) == SSA_NAME && TREE_OPERAND (use_stmt, 1) == name)
     {
       TREE_OPERAND (use_stmt, 1) = unshare_expr (TREE_OPERAND (stmt, 1));
       tidy_after_forward_propagate_addr (use_stmt);