diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-06-04 16:50:57 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-06-04 16:50:57 +0200 |
commit | 1927a96372b003fe6217c64241bb69d838a67dc8 (patch) | |
tree | befd4674cc10cc316c209d081ba0bcebdd77e8c8 /gcc/tree-ssa.c | |
parent | 56812845490199b04123d9faf55cc2b338e6dfb9 (diff) |
re PR tree-optimization/71405 (ICE on valid C++ code at -Os and above on x86_64-linux-gnu: verify_gimple failed)
PR tree-optimization/71405
* tree-ssa.c (execute_update_addresses_taken): For clobber with
incompatible type, build a new clobber with the right type instead
of building a VIEW_CONVERT_EXPR around it.
* g++.dg/torture/pr71405.C: New test.
From-SVN: r237091
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r-- | gcc/tree-ssa.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index a53322d9837..2f3caf341dd 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -1622,9 +1622,16 @@ execute_update_addresses_taken (void) if (gimple_assign_lhs (stmt) != lhs && !useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (rhs))) - rhs = fold_build1 (VIEW_CONVERT_EXPR, - TREE_TYPE (lhs), rhs); - + { + if (gimple_clobber_p (stmt)) + { + rhs = build_constructor (TREE_TYPE (lhs), NULL); + TREE_THIS_VOLATILE (rhs) = 1; + } + else + rhs = fold_build1 (VIEW_CONVERT_EXPR, + TREE_TYPE (lhs), rhs); + } if (gimple_assign_lhs (stmt) != lhs) gimple_assign_set_lhs (stmt, lhs); |