[ tree-ssa] PRE problem

Diego Novillo dnovillo@redhat.com
Fri Feb 20 19:24:00 GMT 2004


See if this (untested) patch fixes your problem.  We were not calling
propagate_value in generate_expr_as_of_bb.  This fixes PR14153, but I
haven't checked other places in PRE where we may be doing the same.


Diego.



Index: tree-flow.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-flow.h,v
retrieving revision 1.1.4.191
diff -d -u -p -r1.1.4.191 tree-flow.h
--- tree-flow.h	20 Feb 2004 12:46:00 -0000	1.1.4.191
+++ tree-flow.h	20 Feb 2004 19:05:24 -0000
@@ -577,6 +577,7 @@ tree widen_bitfield (tree, tree, tree);
 extern void dump_dominator_optimization_stats (FILE *);
 extern void debug_dominator_optimization_stats (void);
 extern void propagate_copy (tree *, tree);
+extern void propagate_value (tree *, tree);
 
 /* In tree-flow-inline.h  */
 static inline int phi_arg_from_edge (tree, edge);
Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-dom.c,v
retrieving revision 1.1.2.136
diff -d -u -p -r1.1.2.136 tree-ssa-dom.c
--- tree-ssa-dom.c	16 Feb 2004 12:36:01 -0000	1.1.2.136
+++ tree-ssa-dom.c	20 Feb 2004 19:05:24 -0000
@@ -279,7 +279,7 @@ local_fold (tree t)
 /* Propagate the value VAL (assumed to be a constant or another SSA_NAME)
    into the operand pointed by OP_P.  */
 
-static void
+void
 propagate_value (tree *op_p, tree val)
 {
   if (TREE_CODE (val) == SSA_NAME)
Index: tree-ssa-pre.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-pre.c,v
retrieving revision 1.1.4.129
diff -d -u -p -r1.1.4.129 tree-ssa-pre.c
--- tree-ssa-pre.c	30 Jan 2004 13:14:18 -0000	1.1.4.129
+++ tree-ssa-pre.c	20 Feb 2004 19:05:25 -0000
@@ -1223,7 +1223,7 @@ generate_expr_as_of_bb (tree expr, basic
 	    {
 	      int opnum = opnum_of_phi (phi, pred->index);
 	      tree p = PHI_ARG_DEF (phi, opnum);
-	      *vp = p;
+	      propagate_value (vp, p);
 	      if (!phi_ssa_name_p (p))
 		replaced_constants = true;
 	      break;




More information about the Gcc mailing list