* [PATCH] Fix part of PR86389
@ 2018-07-03 13:55 Richard Biener
2018-07-13 16:35 ` Sandra Loosemore
0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2018-07-03 13:55 UTC (permalink / raw)
To: gcc-patches
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
From 52aad98947e5cfcb5624ff24f0c557d0029c34fe Mon Sep 17 00:00:00 2001
From: Richard Guenther <rguenther@suse.de>
Date: Tue, 3 Jul 2018 14:04:01 +0200
Subject: [PATCH] fix-pr86389
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.
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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix part of PR86389
2018-07-03 13:55 [PATCH] Fix part of PR86389 Richard Biener
@ 2018-07-13 16:35 ` Sandra Loosemore
2018-07-16 7:29 ` Richard Biener
0 siblings, 1 reply; 3+ messages in thread
From: Sandra Loosemore @ 2018-07-13 16:35 UTC (permalink / raw)
To: Richard Biener, gcc-patches
On 07/03/2018 07:55 AM, Richard Biener wrote:
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
>
> Richard.
>
> From 52aad98947e5cfcb5624ff24f0c557d0029c34fe Mon Sep 17 00:00:00 2001
> From: Richard Guenther <rguenther@suse.de>
> Date: Tue, 3 Jul 2018 14:04:01 +0200
> Subject: [PATCH] fix-pr86389
>
> 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.
FYI, it looks like this new testcase requires
/* { dg-require-effective-target trampolines } */
as it is failing on a target without nested function support.
Alternatively, maybe the testcase could be rewritten not to use a nested
function? I'm not sure if nested-ness is required to test the bug this
issue was for.
-Sandra
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix part of PR86389
2018-07-13 16:35 ` Sandra Loosemore
@ 2018-07-16 7:29 ` Richard Biener
0 siblings, 0 replies; 3+ messages in thread
From: Richard Biener @ 2018-07-16 7:29 UTC (permalink / raw)
To: Sandra Loosemore; +Cc: gcc-patches
On Fri, 13 Jul 2018, Sandra Loosemore wrote:
> On 07/03/2018 07:55 AM, Richard Biener wrote:
> >
> > Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
> >
> > Richard.
> >
> > From 52aad98947e5cfcb5624ff24f0c557d0029c34fe Mon Sep 17 00:00:00 2001
> > From: Richard Guenther <rguenther@suse.de>
> > Date: Tue, 3 Jul 2018 14:04:01 +0200
> > Subject: [PATCH] fix-pr86389
> >
> > 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.
>
> FYI, it looks like this new testcase requires
>
> /* { dg-require-effective-target trampolines } */
>
> as it is failing on a target without nested function support. Alternatively,
> maybe the testcase could be rewritten not to use a nested function? I'm not
> sure if nested-ness is required to test the bug this issue was for.
Fixed.
Richard.
2018-07-16 Richard Biener <rguenther@suse.de>
PR ipa/86389
* gcc.dg/torture/pr86389.c: Require trampolines.
Index: gcc/testsuite/gcc.dg/torture/pr86389.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr86389.c (revision 262676)
+++ gcc/testsuite/gcc.dg/torture/pr86389.c (working copy)
@@ -1,4 +1,5 @@
/* { dg-do run } */
+/* { dg-require-effective-target trampolines } */
/* { dg-additional-options "-fipa-pta" } */
void callme (void (*callback) (void));
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-16 7:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-03 13:55 [PATCH] Fix part of PR86389 Richard Biener
2018-07-13 16:35 ` Sandra Loosemore
2018-07-16 7:29 ` Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).