Turns out the cgraph code isn't happy if cgraph edge (re-)building
is skipped.

Tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2019-02-27  Richard Biener  <rguent...@suse.de>

        * passes.c (should_skip_pass_p): Do not skip cgraph-edge
        building.

        * gcc.dg/gimplefe-36.c: New testcase.

Index: gcc/passes.c
===================================================================
--- gcc/passes.c        (revision 269247)
+++ gcc/passes.c        (working copy)
@@ -2380,6 +2380,10 @@ should_skip_pass_p (opt_pass *pass)
       && pass->properties_provided != 0)
     return false;
 
+  /* We need to (re-)build cgraph edges as needed.  */
+  if (strstr (pass->name, "build_cgraph_edges") != NULL)
+    return false;
+
   /* Don't skip df init; later RTL passes need it.  */
   if (strstr (pass->name, "dfinit") != NULL)
     return false;
Index: gcc/testsuite/gcc.dg/gimplefe-36.c
===================================================================
--- gcc/testsuite/gcc.dg/gimplefe-36.c  (nonexistent)
+++ gcc/testsuite/gcc.dg/gimplefe-36.c  (working copy)
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fgimple" } */
+
+int foo (void);
+
+void __GIMPLE (startwith("fre1"))
+d ()
+{
+  int _1;
+
+bb_2:
+  _1 = foo ();
+  return;
+}

Reply via email to