--- gcc/tree-flow.h (/gcc-local/trunk) (revision 30596) +++ gcc/tree-flow.h (/gcc-local/export-ddg) (revision 30596) @@ -1113,7 +1113,7 @@ extern void linear_transform_loops (void extern void tree_check_data_deps (void); /* In tree-ssa-loop-ivopts.c */ -bool expr_invariant_in_loop_p (struct loop *, tree); +bool expr_invariant_in_loop_p (struct loop *, const_tree); bool multiplier_allowed_in_address_p (HOST_WIDE_INT, enum machine_mode); unsigned multiply_by_cost (HOST_WIDE_INT, enum machine_mode); --- gcc/tree-ssa-loop-ivopts.c (/gcc-local/trunk) (revision 30596) +++ gcc/tree-ssa-loop-ivopts.c (/gcc-local/export-ddg) (revision 30596) @@ -91,6 +91,7 @@ along with GCC; see the file COPYING3. #include "langhooks.h" #include "tree-affine.h" #include "target.h" +#include "tree-data-ref-export.h" /* The infinite cost. */ #define INFTY 10000000 @@ -1244,7 +1245,7 @@ find_interesting_uses_cond (struct ivopt i.e. if all its operands are defined outside of the LOOP. */ bool -expr_invariant_in_loop_p (struct loop *loop, tree expr) +expr_invariant_in_loop_p (struct loop *loop, const_tree expr) { basic_block def_bb; unsigned i, len; @@ -5069,6 +5070,11 @@ copy_ref_info (tree new_ref, tree old_re { TMR_ORIGINAL (new_ref) = unshare_and_remove_ssa_names (old_ref); TMR_TAG (new_ref) = get_ref_tag (old_ref, TMR_ORIGINAL (new_ref)); + /* As MEM_ORIG_EXPR binds MEM to TMR_ORIGINAL of TARGET_MEM_REF it was + produced from, we need to change all occurences of OLD_REF to + TMR_ORIGINAL (NEW_REF) in exported data. */ + if (flag_export_ddg) + replace_var_in_datarefs (old_ref, TMR_ORIGINAL (new_ref)); } }