From a676a9a8c5a0dbd81ebcd294afd153b7f62171d6 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 20 Dec 2016 12:49:31 +0000 Subject: [PATCH] passes.c (execute_one_pass): Handle going out of SSA w/o hitting pass_startwith. 2016-12-20 Richard Biener * passes.c (execute_one_pass): Handle going out of SSA w/o hitting pass_startwith. Handle skipping property providers. * gcc.dg/gimplefe-19.c: New testcase. From-SVN: r243822 --- gcc/ChangeLog | 5 +++++ gcc/passes.c | 8 +++++++- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/gimplefe-19.c | 7 +++++++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/gimplefe-19.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0ad59ba9bc3..6d22e948fe1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-12-20 Richard Biener + + * passes.c (execute_one_pass): Handle going out of SSA w/o + hitting pass_startwith. Handle skipping property providers. + 2016-12-20 Kyrylo Tkachov PR target/78694 diff --git a/gcc/passes.c b/gcc/passes.c index 51d0d84b74d..d11b7126d5d 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -2321,7 +2321,10 @@ execute_one_pass (opt_pass *pass) && (cfun->curr_properties & PROP_ssa)) { size_t namelen = strlen (pass->name); - if (! strncmp (pass->name, cfun->pass_startwith, namelen)) + /* We have to at least start when we leave SSA. */ + if (pass->properties_destroyed & PROP_ssa) + cfun->pass_startwith = NULL; + else if (! strncmp (pass->name, cfun->pass_startwith, namelen)) { /* The following supports starting with the Nth invocation of a pass (where N does not necessarily is equal to the @@ -2338,6 +2341,9 @@ execute_one_pass (opt_pass *pass) return true; } } + /* And also run any property provider. */ + else if (pass->properties_provided != 0) + ; else return true; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index eab8cd8c4f7..a84304a988a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-12-20 Richard Biener + + * gcc.dg/gimplefe-19.c: New testcase. + 2016-12-20 Kyrylo Tkachov PR target/78694 diff --git a/gcc/testsuite/gcc.dg/gimplefe-19.c b/gcc/testsuite/gcc.dg/gimplefe-19.c new file mode 100644 index 00000000000..5ce1cec68d2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gimplefe-19.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-options "-fgimple" } */ + +void __GIMPLE (startwith ("ccp1")) foo () +{ + return; +} -- 2.30.2