re PR ipa/68790 (gcc.c-torture/execute/20050713-1.c FAILs with -O0 -fipa-icf)

Fix PR ipa/68790

	PR ipa/68790
	* ipa-icf.c (sem_function::param_used_p): Return true
	if ipa_node_params_sum equals to NULL.
	* gcc.dg/ipa/pr68790.c: New test.

From-SVN: r231446
This commit is contained in:
Martin Liska 2015-12-09 10:34:59 +01:00 committed by Martin Liska
parent 7b7597c6a4
commit b018757801
4 changed files with 51 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2015-12-09 Martin Liska <mliska@suse.cz>
PR ipa/68790
* ipa-icf.c (sem_function::param_used_p): Return true
if ipa_node_params_sum equals to NULL.
2015-12-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/68583

View file

@ -544,7 +544,7 @@ bool
sem_function::param_used_p (unsigned int i)
{
if (ipa_node_params_sum == NULL)
return false;
return true;
struct ipa_node_params *parms_info = IPA_NODE_REF (get_node ());

View file

@ -1,3 +1,7 @@
2015-12-09 Martin Liska <mliska@suse.cz>
* gcc.dg/ipa/pr68790.c: New test.
2015-12-08 Jan Hubicka <hubicka@ucw.cz>
PR ipa/61886

View file

@ -0,0 +1,40 @@
/* { dg-do run } */
/* { dg-options "-O0 -fipa-icf -fdump-ipa-icf" } */
struct S
{
int a;
};
int
foo3 (struct S x, struct S y, struct S z)
{
if (z.a != 9)
__builtin_abort ();
return 0;
}
int
bar3 (struct S x, struct S y, struct S z)
{
return foo3 (y, x, z);
}
int
baz3 (struct S x, struct S y, struct S z)
{
return foo3 (y, z, x);
}
int
main (void)
{
struct S
a = { 3 },
b = { 6 },
c = { 9 };
return bar3 (b, a, c);
}
/* { dg-final { scan-ipa-dump "Equal symbols: 0" "icf" } } */