Commit 34b42fb0 by Martin Liska Committed by Martin Liska

Fix for PR ipa/63851 and ipa/63852.

	PR ipa/63851
	PR ipa/63852
	* ipa-icf.c (sem_function::merge): Ignore merge operation
	for a thunk created from static chain.
	* ipa-icf-gimple.c (func_checker::compatible_types_p): Verify that
	types have same restrict flag.

From-SVN: r219042
parent 96038913
2014-12-23 Martin Liska <mliska@suse.cz>
PR ipa/63851
PR ipa/63852
* ipa-icf.c (sem_function::merge): Ignore merge operation
for a thunk created from static chain.
* ipa-icf-gimple.c (func_checker::compatible_types_p): Verify that
types have same restrict flag.
2014-12-22 John David Anglin <danglin@gcc.gnu.org> 2014-12-22 John David Anglin <danglin@gcc.gnu.org>
PR target/55023 PR target/55023
...@@ -185,6 +185,9 @@ bool func_checker::compatible_types_p (tree t1, tree t2, ...@@ -185,6 +185,9 @@ bool func_checker::compatible_types_p (tree t1, tree t2,
if (TREE_CODE (t1) != TREE_CODE (t2)) if (TREE_CODE (t1) != TREE_CODE (t2))
return return_false_with_msg ("different tree types"); return return_false_with_msg ("different tree types");
if (TYPE_RESTRICT (t1) != TYPE_RESTRICT (t2))
return return_false_with_msg ("restrict flags are different");
if (!types_compatible_p (t1, t2)) if (!types_compatible_p (t1, t2))
return return_false_with_msg ("types are not compatible"); return return_false_with_msg ("types are not compatible");
......
...@@ -694,6 +694,14 @@ sem_function::merge (sem_item *alias_item) ...@@ -694,6 +694,14 @@ sem_function::merge (sem_item *alias_item)
return 0; return 0;
} }
if (DECL_STATIC_CHAIN (alias->decl))
{
if (dump_file)
fprintf (dump_file, "Thunk creation is risky for static-chain functions.\n\n");
return 0;
}
alias->icf_merged = true; alias->icf_merged = true;
ipa_merge_profiles (local_original, alias); ipa_merge_profiles (local_original, alias);
alias->create_wrapper (local_original); alias->create_wrapper (local_original);
......
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