summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2000-11-30 12:15:13 -0800
committerRichard Henderson <rth@gcc.gnu.org>2000-11-30 12:15:13 -0800
commit41c395330242369ea5d33c544ad41f8833df782c (patch)
tree191f5cedc2e47a3154e5b0e3ba3f60c57506f60b
parent31b1b95769d40692822b6516545827e781b28a7b (diff)
downloadgcc-41c395330242369ea5d33c544ad41f8833df782c.tar.gz
calls.c (expand_call): Emit queued insns before creating the tail recursion sequence.
* calls.c (expand_call): Emit queued insns before creating the tail recursion sequence. * gcc.c-torture/execute/20001130-1.c: New test. From-SVN: r37898
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/calls.c4
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20001130-1.c21
4 files changed, 34 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 65855dde6eb..3b384483790 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-30 Richard Henderson <rth@redhat.com>
+
+ * calls.c (expand_call): Emit queued insns before creating
+ the tail recursion sequence.
+
2000-11-30 J. David Anglin <dave.anglin@nrc.ca>
Bruce Korb <bkorb@gnu.org>
diff --git a/gcc/calls.c b/gcc/calls.c
index 45210c26cf9..9513c308507 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -2552,6 +2552,10 @@ expand_call (exp, target, ignore)
int save_pending_stack_adjust = pending_stack_adjust;
int save_stack_pointer_delta = stack_pointer_delta;
+ /* Emit any queued insns now; otherwise they would end up in
+ only one of the alternates. */
+ emit_queue ();
+
/* Use a new sequence to hold any RTL we generate. We do not even
know if we will use this RTL yet. The final decision can not be
made until after RTL generation for the entire function is
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index ca0fc26f196..f9c90e24a8c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2000-11-30 Richard Henderson <rth@redhat.com>
+
+ * gcc.c-torture/execute/20001130-1.c: New test.
+
2000-11-30 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.other/op3.C: New test.
diff --git a/gcc/testsuite/gcc.c-torture/execute/20001130-1.c b/gcc/testsuite/gcc.c-torture/execute/20001130-1.c
new file mode 100644
index 00000000000..4a996ee6ad3
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20001130-1.c
@@ -0,0 +1,21 @@
+static inline int bar(void) { return 1; }
+static int mem[3];
+
+static int foo(int x)
+{
+ if (x != 0)
+ return x;
+
+ mem[x++] = foo(bar());
+
+ if (x != 1)
+ abort();
+
+ return 0;
+}
+
+int main()
+{
+ foo(0);
+ return 0;
+}