From abee2682026417547b115407fe372cfeef91d609 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 3 Jul 2018 13:56:58 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/torture/pr86389.c | 24 ++++++++++++++++++++++++ gcc/tree-ssa-structalias.c | 1 + 4 files changed, 36 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/torture/pr86389.c 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; -- 2.30.2