Commit fc044323 by Jason Merrill Committed by Jason Merrill

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
parent fa337f3a
2014-01-30 Jason Merrill <jason@redhat.com>
PR c++/59645
* cgraphunit.c (expand_thunk): Copy volatile arg to a temporary.
2014-01-30 Richard Biener <rguenther@suse.de> 2014-01-30 Richard Biener <rguenther@suse.de>
PR tree-optimization/59951 PR tree-optimization/59951
......
...@@ -1592,7 +1592,17 @@ expand_thunk (struct cgraph_node *node, bool output_asm_thunks) ...@@ -1592,7 +1592,17 @@ expand_thunk (struct cgraph_node *node, bool output_asm_thunks)
if (nargs) if (nargs)
for (i = 1, arg = DECL_CHAIN (a); i < nargs; i++, arg = DECL_CHAIN (arg)) 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); call = gimple_build_call_vec (build_fold_addr_expr_loc (0, alias), vargs);
node->callees->call_stmt = call; node->callees->call_stmt = call;
gimple_call_set_from_thunk (call, true); gimple_call_set_from_thunk (call, true);
......
// PR c++/59645
struct A { virtual ~A(); };
struct B { virtual ~B(); };
struct C : A, B {};
struct X
{
virtual B* foo(volatile int);
};
struct Y : X
{
virtual C* foo(volatile int);
};
C* Y::foo(volatile int) { return 0; }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment