diff mbox series

Fix GIMPLE FE with calls and startwith

Message ID alpine.LSU.2.20.1902271422300.23386@zhemvz.fhfr.qr
State New
Headers show
Series Fix GIMPLE FE with calls and startwith | expand

Commit Message

Richard Biener Feb. 27, 2019, 1:23 p.m. UTC
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  <rguenther@suse.de>

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

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

Patch

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;
+}