This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix bootstrap failures


Sigh.
get_or_alloc_expression_id can modify the vec, and because the order
of evaluation is not defined, we lose sometimes.

I'm bootstrapping this on ppc64-linux, and will commit when it
finishes, but it seems to work :)

2007-07-12 Daniel Berlin <dberlin@dberlin.org>

	* tree-ssa-pre.c (get_expression_vuses): Move out side-effect.
	(set_expression_vuses): Ditto.
       (init_pre): Init expression_vuses to NULL.
Index: tree-ssa-pre.c
===================================================================
--- tree-ssa-pre.c	(revision 126568)
+++ tree-ssa-pre.c	(working copy)
@@ -252,8 +252,8 @@ expression_for_id (unsigned int id)
 static inline vuse_vec
 get_expression_vuses (tree expr)
 {
-  return VEC_index (vuse_vec, expression_vuses,
-		    get_or_alloc_expression_id (expr));
+  unsigned int expr_id = get_or_alloc_expression_id (expr);
+  return VEC_index (vuse_vec, expression_vuses, expr_id);
 }
 
 /* Set the expression vuses for EXPR to VUSES.  */
@@ -261,8 +261,8 @@ get_expression_vuses (tree expr)
 static inline void
 set_expression_vuses (tree expr, vuse_vec vuses)
 {
-  VEC_replace (vuse_vec, expression_vuses,
-	       get_or_alloc_expression_id (expr), vuses);
+  unsigned int expr_id = get_or_alloc_expression_id (expr);
+  VEC_replace (vuse_vec, expression_vuses, expr_id, vuses);
 }
 
 
@@ -3795,6 +3795,7 @@ init_pre (bool do_fre)
   
   next_expression_id = 0;
   expressions = NULL;
+  expression_vuses = NULL;
   in_fre = do_fre;
 
   inserted_exprs = NULL;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]