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]

[tree-ssa] Handle non SIMPLE expressions [patch]


This is a temporary workaround for handling non simplified
expressions.  This fixes the last of the regressions in c-torture
when applying constant propagation.

Bootstrapped and tested on x86.  Committed to branch.

Diego.


	* tree-dfa.c (find_refs_in_expr): If the current sub-expression is
	not SIMPLE, mark its parent.
	(create_ref): If the parent expression is not SIMPLE, create
	VARDEFs regardless of the original reference type.

Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-dfa.c,v
retrieving revision 1.1.4.7
diff -d -u -p -r1.1.4.7 tree-dfa.c
--- tree-dfa.c	16 Aug 2002 15:50:33 -0000	1.1.4.7
+++ tree-dfa.c	19 Aug 2002 17:05:31 -0000
@@ -262,11 +262,12 @@ find_refs_in_expr (expr_p, ref_type, bb,
     return;
 
   /* If this reference is associated with a non SIMPLE expression, then we
-     change the reference type to VARDEF (regardless of the original
-     reference type) to indicate to the optimizers that this tree clobbers
-     the referenced variable.  */
-  if (TREE_ANN (expr) && (TREE_FLAGS (expr) & TF_NOT_SIMPLE))
-    return;
+     mark the parent expression non SIMPLE.  This will cause all the
+     references associated with this expression to be marked as VARDEFs.  */
+  if (parent_expr &&
+      TREE_ANN (expr) &&
+      (TREE_FLAGS (expr) & TF_NOT_SIMPLE))
+    get_tree_ann (parent_expr)->flags |= TF_NOT_SIMPLE;
 
   code = TREE_CODE (expr);
 
@@ -634,6 +635,13 @@ create_ref (sym, ref_type, bb, parent_st
   if (bb == NULL)
     abort ();
 #endif
+
+  /* If the parent expression is not in SIMPLE form, create VARDEF
+     references to SYM regardless of the requested reference type.  */
+  if (parent_expr
+      && TREE_ANN (parent_expr)
+      && (TREE_FLAGS (parent_expr) & TF_NOT_SIMPLE))
+    ref_type = VARDEF;
 
   ref = (varref) ggc_alloc (sizeof (*ref));
   memset ((void *) ref, 0, sizeof (*ref));


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