re PR ipa/64896 (ICE in get_address_mode, at rtlanal.c:5442)

PR ipa/64896
	* cgraphunit.c (cgraph_node::expand_thunk): If
	restype is not is_gimple_reg_type nor the thunk_fndecl
	returns aggregate_value_p, set restmp to a temporary variable
	instead of resdecl.

	* g++.dg/ipa/pr64896.C: New test.

From-SVN: r220489
This commit is contained in:
Jakub Jelinek 2015-02-06 21:47:20 +01:00 committed by Jakub Jelinek
parent 091790a7f0
commit bbd1bae29c
4 changed files with 51 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2015-02-06 Jakub Jelinek <jakub@redhat.com>
PR ipa/64896
* cgraphunit.c (cgraph_node::expand_thunk): If
restype is not is_gimple_reg_type nor the thunk_fndecl
returns aggregate_value_p, set restmp to a temporary variable
instead of resdecl.
2015-02-06 Vladimir Makarov <vmakarov@redhat.com>
* lra.c (lra_emit_add): Fix a typo in using disp instead of base.

View File

@ -1609,11 +1609,16 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
}
else if (!is_gimple_reg_type (restype))
{
restmp = resdecl;
if (aggregate_value_p (resdecl, TREE_TYPE (thunk_fndecl)))
{
restmp = resdecl;
if (TREE_CODE (restmp) == VAR_DECL)
add_local_decl (cfun, restmp);
BLOCK_VARS (DECL_INITIAL (current_function_decl)) = restmp;
if (TREE_CODE (restmp) == VAR_DECL)
add_local_decl (cfun, restmp);
BLOCK_VARS (DECL_INITIAL (current_function_decl)) = restmp;
}
else
restmp = create_tmp_var (restype, "retval");
}
else
restmp = create_tmp_reg (restype, "retval");

View File

@ -1,3 +1,8 @@
2015-02-06 Jakub Jelinek <jakub@redhat.com>
PR ipa/64896
* g++.dg/ipa/pr64896.C: New test.
2015-02-06 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/64205

View File

@ -0,0 +1,29 @@
// PR ipa/64896
// { dg-do compile }
// { dg-options "-O2" }
struct A { int a, b; };
struct B { A c; int d; };
struct C { virtual B fn1 () const; };
struct D { B fn2 () const; int fn3 () const; C *fn4 () const; };
int
D::fn3 () const
{
fn4 ()->fn1 ();
}
B
D::fn2 () const
{
return B ();
}
class F : C
{
B
fn1 () const
{
return B ();
}
};