re PR middle-end/29241 ([non unit-at-a-time] ICE with always inline)
authorJan Hubicka <jh@suse.cz>
Sun, 15 Oct 2006 19:46:26 +0000 (21:46 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 15 Oct 2006 19:46:26 +0000 (19:46 +0000)
PR middle-end/29241
* cgraphunit.c (cgraph_preserve_function_body_p): Preserve functions
declared always_inline even when not inlining.

* gcc.c-torture/compile/pr29241.c: New testcase.

From-SVN: r117753

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

index 078db2bb3544d04371d2516e5c8566ede6194315..2676f32b6f62697e825a68e72f34eb439eac83bd 100644 (file)
@@ -1,3 +1,9 @@
+2006-10-15  Jan Hubicka  <jh@suse.cz>
+
+       PR middle-end/29241
+       * cgraphunit.c (cgraph_preserve_function_body_p): Preserve functions
+       declared always_inline even when not inlining.
+
 2006-10-15  Eric Botcazou  <ebotcazou@libertysurf.fr>
             John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
             Andrew Pinski  <pinskia@gmail.com>
index fbe70ddc3ce7a177ba97cfd92deb35e8ad84ea49..309fb73f01235ccd37f10d68b803a6e9b934510d 100644 (file)
@@ -1494,7 +1494,9 @@ cgraph_preserve_function_body_p (tree decl)
 {
   struct cgraph_node *node;
   if (!cgraph_global_info_ready)
-    return (DECL_INLINE (decl) && !flag_really_no_inline);
+    return (flag_really_no_inline
+           ? lang_hooks.tree_inlining.disregard_inline_limits (decl)
+           : DECL_INLINE (decl));
   /* Look if there is any clone around.  */
   for (node = cgraph_node (decl); node; node = node->next_clone)
     if (node->global.inlined_to)
index 8cf1478c84da662798c1752241afe5e2aed425de..33d2825fc1cf036cb8eac76bd16a6e124b60031b 100644 (file)
@@ -1,3 +1,8 @@
+2006-10-15  Jan Hubicka  <jh@suse.cz>
+
+       PR middle-end/29241
+       * gcc.c-torture/compile/pr29241.c: New testcase.
+
 2006-10-15  David Edelsohn  <edelsohn@gnu.org>
 
        PR middle-end/29250
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr29241.c b/gcc/testsuite/gcc.c-torture/compile/pr29241.c
new file mode 100644 (file)
index 0000000..6db15c1
--- /dev/null
@@ -0,0 +1,15 @@
+static inline __attribute__((always_inline)) void ip_finish_output2(){}
+void ip_fragment(void (*)(void));
+static inline __attribute__((always_inline)) void ip_finish_output()
+{
+ ip_fragment(ip_finish_output2);
+ ip_finish_output2();
+}
+void ip_mc_output()
+{
+ ip_finish_output();
+}
+void ip_output()
+{
+ ip_finish_output();
+}