From: Richard Biener Date: Tue, 3 Jul 2018 13:56:58 +0000 (+0000) Subject: re PR ipa/86389 (execute FAILs with -fipa-pta) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=abee2682026417547b115407fe372cfeef91d609;p=gcc.git re PR ipa/86389 (execute FAILs with -fipa-pta) 2018-07-03 Richard Biener PR ipa/86389 * tree-ssa-structalias.c (find_func_clobbers): Properly handle indirect calls. * gcc.dg/torture/pr86389.c: New testcase. From-SVN: r262341 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 338442904c9..c4ce163ded4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-07-03 Richard Biener + + PR ipa/86389 + * tree-ssa-structalias.c (find_func_clobbers): Properly + handle indirect calls. + 2018-07-03 Richard Sandiford * tree-vect-patterns.c (vect_recog_rotate_pattern) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0ed116fd209..c1bfad8ccfc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-07-03 Richard Biener + + PR ipa/86389 + * gcc.dg/torture/pr86389.c: New testcase. + 2018-07-03 Richard Sandiford PR tree-optimization/85694 diff --git a/gcc/testsuite/gcc.dg/torture/pr86389.c b/gcc/testsuite/gcc.dg/torture/pr86389.c new file mode 100644 index 00000000000..cc29635c6d0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr86389.c @@ -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) (); +} diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index ac5d4bc93fe..fd24f84fb14 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -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;