diff options
author | Jason Merrill <jason@redhat.com> | 2014-01-30 09:18:15 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-01-30 09:18:15 -0500 |
commit | fc044323f492ebb6913398604104f293df99dbe3 (patch) | |
tree | fa4e766c386e0ae155b7f49aed393f4edd58e4f4 /gcc/cgraphunit.c | |
parent | fa337f3ae5fb8c4c3631345e65ec8c75cb40ab69 (diff) | |
download | gcc-fc044323f492ebb6913398604104f293df99dbe3.zip gcc-fc044323f492ebb6913398604104f293df99dbe3.tar.gz gcc-fc044323f492ebb6913398604104f293df99dbe3.tar.bz2 |
re PR c++/59645 (ICE with covariant return and volatile)
PR c++/59645
* cgraphunit.c (expand_thunk): Copy volatile arg to a temporary.
From-SVN: r207301
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r-- | gcc/cgraphunit.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index d22265a..06283fc 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1592,7 +1592,17 @@ expand_thunk (struct cgraph_node *node, bool output_asm_thunks) if (nargs) for (i = 1, arg = DECL_CHAIN (a); i < nargs; i++, arg = DECL_CHAIN (arg)) - vargs.quick_push (arg); + { + tree tmp = arg; + if (!is_gimple_val (arg)) + { + tmp = create_tmp_reg (TYPE_MAIN_VARIANT + (TREE_TYPE (arg)), "arg"); + gimple stmt = gimple_build_assign (tmp, arg); + gsi_insert_after (&bsi, stmt, GSI_NEW_STMT); + } + vargs.quick_push (tmp); + } call = gimple_build_call_vec (build_fold_addr_expr_loc (0, alias), vargs); node->callees->call_stmt = call; gimple_call_set_from_thunk (call, true); |