aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2000-10-27 21:49:53 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2000-10-27 21:49:53 +0200
commitfadb729c6d312aa1064e1fcb7cdd6286deeff9bd (patch)
tree4a398dc7d2148fed77879fcff5b60217176f20e2
parent254bb25636bc50612a67ccad1563a4cc082c7e75 (diff)
downloadgcc-fadb729c6d312aa1064e1fcb7cdd6286deeff9bd.zip
gcc-fadb729c6d312aa1064e1fcb7cdd6286deeff9bd.tar.gz
gcc-fadb729c6d312aa1064e1fcb7cdd6286deeff9bd.tar.bz2
calls.c (expand_call): If sibcall_failure is set during pass 1, clear tail_call_insns as well.
* calls.c (expand_call): If sibcall_failure is set during pass 1, clear tail_call_insns as well. * g++.old-deja/g++.other/eh2.C: New test. From-SVN: r37087
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/calls.c9
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/eh2.C18
4 files changed, 32 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2c42e84..35ae9dd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-10-27 Jakub Jelinek <jakub@redhat.com>
+
+ * calls.c (expand_call): If sibcall_failure is set during pass 1,
+ clear tail_call_insns as well.
+
2000-10-27 Nick Clifton <nickc@redhat.com>
* config/arm/arm-protos.h (arm_function_ok_for_sibcall): Add
diff --git a/gcc/calls.c b/gcc/calls.c
index e90be2e..da850cc 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -3363,10 +3363,6 @@ expand_call (exp, target, ignore)
{
tail_call_insns = insns;
- /* If something prevents making this a sibling call,
- zero out the sequence. */
- if (sibcall_failure)
- tail_call_insns = NULL_RTX;
/* Restore the pending stack adjustment now that we have
finished generating the sibling call sequence. */
@@ -3385,6 +3381,11 @@ expand_call (exp, target, ignore)
}
else
normal_call_insns = insns;
+
+ /* If something prevents making this a sibling call,
+ zero out the sequence. */
+ if (sibcall_failure)
+ tail_call_insns = NULL_RTX;
}
/* The function optimize_sibling_and_tail_recursive_calls doesn't
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1a4bc84..84b84c8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2000-10-27 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.old-deja/g++.other/eh2.C: New test.
+
2000-10-27 Bernd Schmidt <bernds@cygnus.co.uk>
* gcc.c-torture/execute/20001027-1.c: New test.
diff --git a/gcc/testsuite/g++.old-deja/g++.other/eh2.C b/gcc/testsuite/g++.old-deja/g++.other/eh2.C
new file mode 100644
index 0000000..514d645
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/eh2.C
@@ -0,0 +1,18 @@
+// Build don't link:
+// Origin: Jakub Jelinek <jakub@redhat.com>
+// Special g++ Options: -O2
+
+class a {
+public:
+ double b;
+ int c;
+ ~a() { }
+};
+
+int bar(a x);
+a foo(double x);
+
+int baz(double x, int y)
+{
+ return bar(foo(x));
+}