From: Jakub Jelinek Date: Mon, 6 Nov 2017 16:29:11 +0000 (+0100) Subject: re PR tree-optimization/82838 (ICE in verify_ssa failed w/ store-merging) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3e2927a1b05739384d2080f46cd0836980911822;p=gcc.git re PR tree-optimization/82838 (ICE in verify_ssa failed w/ store-merging) PR tree-optimization/82838 * gimple-ssa-store-merging.c (imm_store_chain_info::output_merged_store): Call force_gimple_operand_1 on a separate gimple_seq which is then appended to seq. * gcc.c-torture/compile/pr82838.c: New test. From-SVN: r254457 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1cda8a32a7a..7c04aa9b313 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-11-06 Jakub Jelinek + + PR tree-optimization/82838 + * gimple-ssa-store-merging.c + (imm_store_chain_info::output_merged_store): Call force_gimple_operand_1 + on a separate gimple_seq which is then appended to seq. + 2017-11-06 Jeff Law PR target/82788 diff --git a/gcc/gimple-ssa-store-merging.c b/gcc/gimple-ssa-store-merging.c index 5366a9b6e29..3c29a5f9e24 100644 --- a/gcc/gimple-ssa-store-merging.c +++ b/gcc/gimple-ssa-store-merging.c @@ -1642,10 +1642,14 @@ imm_store_chain_info::output_merged_store (merged_store_group *group) else if (operand_equal_p (base_addr, op.base_addr, 0)) load_addr[j] = addr; else - load_addr[j] - = force_gimple_operand_1 (unshare_expr (op.base_addr), - &seq, is_gimple_mem_ref_addr, - NULL_TREE); + { + gimple_seq this_seq; + load_addr[j] + = force_gimple_operand_1 (unshare_expr (op.base_addr), + &this_seq, is_gimple_mem_ref_addr, + NULL_TREE); + gimple_seq_add_seq_without_update (&seq, this_seq); + } } FOR_EACH_VEC_ELT (split_stores, i, split_store) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index de0e0a8ebee..edb3797cc1d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-11-06 Jakub Jelinek + + PR tree-optimization/82838 + * gcc.c-torture/compile/pr82838.c: New test. + 2017-11-06 Jeff Law PR target/82788 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr82838.c b/gcc/testsuite/gcc.c-torture/compile/pr82838.c new file mode 100644 index 00000000000..a6ca163f82f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr82838.c @@ -0,0 +1,12 @@ +/* PR tree-optimization/82838 */ + +struct S { unsigned short a, b, c; }; +struct S f[10]; + +void +foo (int e) +{ + struct S *x; + f[e].b = x[e].a; + f[e].c = x[e].b; +}