https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62238
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- This is a tree sharing issue, it reproduces with -O3 and a single concatenated source as well. Index: gcc/tree-predcom.c =================================================================== --- gcc/tree-predcom.c (revision 218019) +++ gcc/tree-predcom.c (working copy) @@ -1402,8 +1402,8 @@ ref_at_iteration (data_reference_p dr, i off = size_binop (PLUS_EXPR, off, size_binop (MULT_EXPR, DR_STEP (dr), ssize_int (iter))); tree addr = fold_build_pointer_plus (DR_BASE_ADDRESS (dr), off); - addr = force_gimple_operand_1 (addr, stmts, is_gimple_mem_ref_addr, - NULL_TREE); + addr = force_gimple_operand_1 (unshare_expr (addr), stmts, + is_gimple_mem_ref_addr, NULL_TREE); tree alias_ptr = fold_convert (reference_alias_ptr_type (DR_REF (dr)), coff); /* While data-ref analysis punts on bit offsets it still handles bitfield accesses at byte boundaries. Cope with that. Note that