re PR ipa/86389 (execute FAILs with -fipa-pta)

2018-07-03  Richard Biener  <rguenther@suse.de>

	PR ipa/86389
	* tree-ssa-structalias.c (find_func_clobbers): Properly
	handle indirect calls.

	* gcc.dg/torture/pr86389.c: New testcase.

From-SVN: r262341
This commit is contained in:
Richard Biener 2018-07-03 13:56:58 +00:00 committed by Richard Biener
parent d3435784e7
commit abee268202
4 changed files with 36 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2018-07-03 Richard Biener <rguenther@suse.de>
PR ipa/86389
* tree-ssa-structalias.c (find_func_clobbers): Properly
handle indirect calls.
2018-07-03 Richard Sandiford <richard.sandiford@arm.com>
* tree-vect-patterns.c (vect_recog_rotate_pattern)

View File

@ -1,3 +1,8 @@
2018-07-03 Richard Biener <rguenther@suse.de>
PR ipa/86389
* gcc.dg/torture/pr86389.c: New testcase.
2018-07-03 Richard Sandiford <richard.sandiford@arm.com>
PR tree-optimization/85694

View File

@ -0,0 +1,24 @@
/* { dg-do run } */
/* { dg-additional-options "-fipa-pta" } */
void callme (void (*callback) (void));
int
main (void)
{
int ok = 0;
void callback (void) { ok = 1; }
callme (&callback);
if (!ok)
__builtin_abort ();
return 0;
}
__attribute__((noinline, noclone))
void
callme (void (*callback) (void))
{
(*callback) ();
}

View File

@ -5353,6 +5353,7 @@ find_func_clobbers (struct function *fn, gimple *origt)
/* For callees without function info (that's external functions),
ESCAPED is clobbered and used. */
if (cfi->decl
&& TREE_CODE (cfi->decl) == FUNCTION_DECL
&& !cfi->is_fn_info)
{
varinfo_t vi;