aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorFranz Sirl <Franz.Sirl-kernel@lauterbach.com>2002-11-11 21:29:19 +0000
committerFranz Sirl <sirl@gcc.gnu.org>2002-11-11 21:29:19 +0000
commit303b90b00106ed64c731827336490830ebf6ca4a (patch)
tree4d969c81634f7957d2f4884ced2b19647a323b05 /gcc
parente84371652ca363ac1270d28f4443e50bdf50d42e (diff)
downloadgcc-303b90b00106ed64c731827336490830ebf6ca4a.zip
gcc-303b90b00106ed64c731827336490830ebf6ca4a.tar.gz
gcc-303b90b00106ed64c731827336490830ebf6ca4a.tar.bz2
re PR c/8467 (Bug in sibling call optimization)
2002-11-11 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> PR c/8467 * gcc.c-torture/execute/20021111-1.c From-SVN: r59026
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/stmt.c14
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20021111-1.c31
4 files changed, 54 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dcc0bd2..7b06a1e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2002-11-11 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ PR c/8467
+ * stmt.c (tail_recursion_args): Handle DECL_MODE differing from the
+ mode of DECL_RTL case.
+
2002-11-11 Janis Johnson <janis187@us.ibm.com>
* doc/contrib.texi: Merge in the list from the libstdc++ web pages.
diff --git a/gcc/stmt.c b/gcc/stmt.c
index c07fe66..360abe1 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -3311,8 +3311,18 @@ tail_recursion_args (actuals, formals)
if (GET_MODE (DECL_RTL (f)) == GET_MODE (argvec[i]))
emit_move_insn (DECL_RTL (f), argvec[i]);
else
- convert_move (DECL_RTL (f), argvec[i],
- TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (a))));
+ {
+ rtx tmp = argvec[i];
+
+ if (DECL_MODE (f) != GET_MODE (DECL_RTL (f)))
+ {
+ tmp = gen_reg_rtx (DECL_MODE (f));
+ convert_move (tmp, argvec[i],
+ TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (a))));
+ }
+ convert_move (DECL_RTL (f), tmp,
+ TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (a))));
+ }
}
free_temp_slots ();
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 99af5fe..2a8434f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2002-11-11 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ PR c/8467
+ * gcc.c-torture/execute/20021111-1.c
+
2002-11-09 Eric Botcazou <ebotcazou@libertysurf.fr>
PR c/8439
diff --git a/gcc/testsuite/gcc.c-torture/execute/20021111-1.c b/gcc/testsuite/gcc.c-torture/execute/20021111-1.c
new file mode 100644
index 0000000..b81fa0b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20021111-1.c
@@ -0,0 +1,31 @@
+/* Origin: PR c/8467 */
+
+extern void abort (void);
+extern void exit (int);
+
+int aim_callhandler(int sess, int conn, unsigned short family, unsigned short type);
+
+int aim_callhandler(int sess, int conn, unsigned short family, unsigned short type)
+{
+ static int i = 0;
+
+ if (!conn)
+ return 0;
+
+ if (type == 0xffff)
+ {
+ return 0;
+ }
+
+ if (i >= 1)
+ abort ();
+
+ i++;
+ return aim_callhandler(sess, conn, family, (unsigned short) 0xffff);
+}
+
+int main (void)
+{
+ aim_callhandler (0, 1, 0, 0);
+ exit (0);
+}