]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/39834 (verify_cgraph_node failed with -O3 -Winline)
authorJan Hubicka <jh@suse.cz>
Mon, 8 Jun 2009 19:21:33 +0000 (21:21 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 8 Jun 2009 19:21:33 +0000 (19:21 +0000)
PR debug/39834
* gcc.dg/torture/pr39834.c
PR middle-end/39834
* cgraphunit.c (save_inline_function_body): Do not copy transform hooks
for saved inline bodies.
* ipa-passes.c (do_per_function): Do not add the hoks multiple times
for given function.

From-SVN: r148292

gcc/ChangeLog
gcc/cgraphunit.c
gcc/passes.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr39834.c [new file with mode: 0644]

index 594c0a6e84f532402ac520a741d4e04004c53dc6..233028faa0688fc90e18097aefca7b64435fe476 100644 (file)
@@ -1,3 +1,11 @@
+2009-06-08  Jan Hubicka  <jh@suse.cz>
+
+       PR middle-end/39834
+       * cgraphunit.c (save_inline_function_body): Do not copy transform hooks
+       for saved inline bodies.
+       * ipa-passes.c (do_per_function): Do not add the hoks multiple times
+       for given function.
+
 2009-06-08  Adam Nemet  <anemet@caviumnetworks.com>
 
        * jump.c (returnjump_p): Handle delayed branches.  Add missing
index 70b2682449fe6ceba669e8a58c4a0406266552d8..907488c1431cbf847c45f237f11d282cb847c20a 100644 (file)
@@ -1688,6 +1688,9 @@ save_inline_function_body (struct cgraph_node *node)
   DECL_ONE_ONLY (first_clone->decl) = 0;
   TREE_PUBLIC (first_clone->decl) = 0;
   DECL_COMDAT (first_clone->decl) = 0;
+  VEC_free (ipa_opt_pass, heap,
+            DECL_STRUCT_FUNCTION (first_clone->decl)->ipa_transforms_to_apply);
+  DECL_STRUCT_FUNCTION (first_clone->decl)->ipa_transforms_to_apply = NULL;
 
 #ifdef ENABLE_CHECKING
   verify_cgraph_node (first_clone);
index 2408668c08304970faed14570b3b17b7f0ee51e0..f146670efd1c88b27170737033c9604ed5873a61 100644 (file)
@@ -844,7 +844,8 @@ do_per_function (void (*callback) (void *data), void *data)
     {
       struct cgraph_node *node;
       for (node = cgraph_nodes; node; node = node->next)
-       if (node->analyzed && gimple_has_body_p (node->decl))
+       if (node->analyzed && gimple_has_body_p (node->decl)
+           && (!node->clone_of || node->decl != node->clone_of->decl))
          {
            push_cfun (DECL_STRUCT_FUNCTION (node->decl));
            current_function_decl = node->decl;
index 56dc2bc1189650961ac3dedf8796480e5c5a1f52..e20679a9ba36280e32bc7b4d422705b926d19928 100644 (file)
@@ -1,3 +1,8 @@
+2009-06-08  Jan Hubicka  <jh@suse.cz>
+
+       PR debug/39834
+       * gcc.dg/torture/pr39834.c
+
 2009-06-08  Jan Hubicka  <jh@suse.cz>
 
        PR middle-end/40102
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr39834.c b/gcc/testsuite/gcc.c-torture/compile/pr39834.c
new file mode 100644 (file)
index 0000000..ecc3977
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-options "-O1 -Winline" } */
+void quit_mined ();
+void bottom_line ();
+typedef enum { False, True } FLAG;
+inline void
+nextfile (FLAG exitiflast)
+{
+  if (exitiflast)     
+    quit_mined ();
+  else 
+    bottom_line ();
+  nextfile (True);
+}