diff options
author | Richard Biener <rguenther@suse.de> | 2014-11-26 09:43:39 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-11-26 09:43:39 +0000 |
commit | 7ec44c3d10c41dabcb64efc4b3225d5a1bb4d7f9 (patch) | |
tree | 56c00025da81ba40c588fdfff0666786d39f413c /gcc/tree-predcom.c | |
parent | 8592c207050c21252a030f31908ade306507a231 (diff) | |
download | gcc-7ec44c3d10c41dabcb64efc4b3225d5a1bb4d7f9.zip gcc-7ec44c3d10c41dabcb64efc4b3225d5a1bb4d7f9.tar.gz gcc-7ec44c3d10c41dabcb64efc4b3225d5a1bb4d7f9.tar.bz2 |
re PR tree-optimization/62238 (ICE with LTO on valid code on x86_64-linux-gnu in verify_ssa (in 64-bit mode))
2014-11-26 Richard Biener <rguenther@suse.de>
PR tree-optimization/62238
* tree-predcom.c (ref_at_iteration): Unshare the expression
before gimplifying it.
(prepare_initializers_chain): Discard unused seq.
* gcc.dg/torture/pr62238.c: New testcase.
From-SVN: r218074
Diffstat (limited to 'gcc/tree-predcom.c')
-rw-r--r-- | gcc/tree-predcom.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c index 93a523c..230c5c0 100644 --- a/gcc/tree-predcom.c +++ b/gcc/tree-predcom.c @@ -1402,8 +1402,8 @@ ref_at_iteration (data_reference_p dr, int iter, gimple_seq *stmts) 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 @@ -2354,7 +2354,6 @@ prepare_initializers_chain (struct loop *loop, chain_p chain) unsigned i, n = (chain->type == CT_INVARIANT) ? 1 : chain->length; struct data_reference *dr = get_chain_root (chain)->ref; tree init; - gimple_seq stmts; dref laref; edge entry = loop_preheader_edge (loop); @@ -2378,12 +2377,17 @@ prepare_initializers_chain (struct loop *loop, chain_p chain) for (i = 0; i < n; i++) { + gimple_seq stmts = NULL; + if (chain->inits[i] != NULL_TREE) continue; init = ref_at_iteration (dr, (int) i - n, &stmts); if (!chain->all_always_accessed && tree_could_trap_p (init)) - return false; + { + gimple_seq_discard (stmts); + return false; + } if (stmts) gsi_insert_seq_on_edge_immediate (entry, stmts); |