This makes us fold (the last) inserted statement from PRE to avoid
MEM_REF vs. non-MEM_REF inconsistencies tripping up on un-aware
code such as data dependence analysis using operand_equal_p.  fold_stmt
makes sure to canonicalize either variant but PRE internally uses
MEM_REF for all accesses to be type agnostic.

Bootstrap and regtest pending on x86_64-unknown-linux-gnu.

Richard.

2011-09-09  Richard Guenther  <rguent...@suse.de>

        * tree-ssa-pre.c (create_expression_by_pieces): Fold the
        last statement.

Index: gcc/tree-ssa-pre.c
===================================================================
--- gcc/tree-ssa-pre.c  (revision 178719)
+++ gcc/tree-ssa-pre.c  (working copy)
@@ -3182,6 +3182,10 @@ create_expression_by_pieces (basic_block
   /* All the symbols in NEWEXPR should be put into SSA form.  */
   mark_symbols_for_renaming (newstmt);
 
+  /* Fold the last statement.  */
+  gsi = gsi_last (*stmts);
+  fold_stmt_inplace (&gsi);
+
   /* Add a value number to the temporary.
      The value may already exist in either NEW_SETS, or AVAIL_OUT, because
      we are creating the expression by pieces, and this particular piece of

Reply via email to