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]

[testsuite] Inline-on-trees problem


Hi!

Compiling this testcase with -O1 or -O2 will consume a lot of memory, a lot
of time and then crash.
id->fns protection against recursion in expand_call_inline seems to work
(optimize_function exits for all four functions), so I don't know yet why it
expands things indefinitely.
This bug e.g. prevents compiling Octave with current gcc.

2000-06-12  Jakub Jelinek  <jakub@redhat.com>

	* g++.old-deja/g++.other/inline11.C: New test.

--- gcc/testsuite/g++.old-deja/g++.other/inline11.C.jj	Mon Jun 12 16:11:41 2000
+++ gcc/testsuite/g++.old-deja/g++.other/inline11.C	Mon Jun 12 16:11:36 2000
@@ -0,0 +1,34 @@
+// Build don't link:
+// Origin: Jakub Jelinek <jakub@redhat.com>
+// Special g++ Options: -O2
+
+class baz
+{
+public:
+  baz& operator += (const baz&);
+};
+ 
+inline baz& baz::operator += (const baz& r)
+{
+  return *this;
+}
+
+inline baz operator + (int x, const baz& y)
+{
+  return y;
+}
+
+static inline baz bar (int alpha);
+static inline baz foo (int alpha)
+{
+  baz tmp = alpha + foo (alpha);
+  tmp += alpha + bar (alpha);
+  return tmp;
+}
+
+static inline baz bar (int alpha)
+{
+  baz tmp = alpha + bar (alpha);
+  tmp += alpha + foo (alpha);
+  return tmp;
+}

	Jakub

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