This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[testcase] Nested function inlining ICE


Hi!

The following testcase ICEs on IA-64. The problem is that although bar.0 is
deferred the first time in rest_of_compilation, it is then
mark_addressable() in calls.c, c-semantics.c calls output_inline_function
and thus bar.0 makes it into the assembly. foo is deferred and never
output and DWARF-2 is confused because it sees nested function without
containing function.
I think the best would be to defer bar too somewhere.
Ok to commit the patch?

2001-11-30  Jakub Jelinek  <jakub@redhat.com>

	* gcc.dg/20011130-1.c: New test.

--- gcc/testsuite/gcc.dg/20011130-1.c.jj	Thu Aug 30 22:30:55 2001
+++ gcc/testsuite/gcc.dg/20011130-1.c	Fri Nov 30 12:55:05 2001
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -g -finline-limit=100" } */
+
+#define WORK(x, y) __asm__ ("" : "=r" (x) : "0" (x)); y += x + 26
+#define SOME_WORK(x, y) WORK(x, y); WORK(x, y); WORK(x, y); WORK(x, y)
+#define MORE_WORK(x, y) SOME_WORK(x, y); SOME_WORK(x, y); SOME_WORK(x, y)
+#define EVEN_MORE_WORK(x, y) MORE_WORK(x, y); MORE_WORK(x, y); MORE_WORK(x, y)
+#define LOTS_OF_WORK(x, y) EVEN_MORE_WORK(x, y); EVEN_MORE_WORK(x, y)
+
+static int __attribute__((unused)) foo (int x)
+{
+  static inline int bar (int x)
+    {
+      int y;
+      y = x;
+      LOTS_OF_WORK(x, y);
+      LOTS_OF_WORK(x, y);
+      LOTS_OF_WORK(x, y);
+      LOTS_OF_WORK(x, y);
+      LOTS_OF_WORK(x, y);
+      LOTS_OF_WORK(x, y);
+      return y;
+    }
+  return bar(x);
+}

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]