passes.c (execute_one_pass): Handle going out of SSA w/o hitting pass_startwith.
authorRichard Biener <rguenther@suse.de>
Tue, 20 Dec 2016 12:49:31 +0000 (12:49 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 20 Dec 2016 12:49:31 +0000 (12:49 +0000)
2016-12-20  Richard Biener  <rguenther@suse.de>

* 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
gcc/passes.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/gimplefe-19.c [new file with mode: 0644]

index 0ad59ba9bc3ac82dc20e196ff0ac6704b24c63f8..6d22e948fe176925bc9b0102566c4ad17def61f7 100644 (file)
@@ -1,3 +1,8 @@
+2016-12-20  Richard Biener  <rguenther@suse.de>
+
+       * passes.c (execute_one_pass): Handle going out of SSA w/o
+       hitting pass_startwith.  Handle skipping property providers.
+
 2016-12-20  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        PR target/78694
index 51d0d84b74de3a0db6ead04a26cd517844f59d83..d11b7126d5dac276409813a1bd879147f39d5efe 100644 (file)
@@ -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;
     }
index eab8cd8c4f7311bf0c2796af92fd7698bd24ec5a..a84304a988a20c18710b9ea58c26eec259990aed 100644 (file)
@@ -1,3 +1,7 @@
+2016-12-20  Richard Biener  <rguenther@suse.de>
+
+       * gcc.dg/gimplefe-19.c: New testcase.
+
 2016-12-20  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        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 (file)
index 0000000..5ce1cec
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-fgimple" } */
+
+void __GIMPLE (startwith ("ccp1")) foo ()
+{
+  return;
+}