From: Franz Sirl Date: Mon, 11 Nov 2002 20:52:30 +0000 (+0000) Subject: re PR c/8467 (Bug in sibling call optimization) X-Git-Tag: releases/gcc-3.2.1~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c12a71b9889f25ed81d1f6556909f76a4410596;p=thirdparty%2Fgcc.git re PR c/8467 (Bug in sibling call optimization) 2002-11-11 Franz Sirl PR c/8467 * stmt.c (tail_recursion_args): Handle DECL_MODE differing from the mode of DECL_RTL case. From-SVN: r59022 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 87a9c71974b0..dbb7ad207dee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-11-11 Franz Sirl + + PR c/8467 + * stmt.c (tail_recursion_args): Handle DECL_MODE differing from the + mode of DECL_RTL case. + 2002-11-11 Neil Booth PR preprocessor/4890 diff --git a/gcc/stmt.c b/gcc/stmt.c index e01089370259..4ba30217e9c4 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -3351,8 +3351,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 ();