From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15173 invoked by alias); 7 Nov 2002 21:16:15 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 15155 invoked by uid 71); 7 Nov 2002 21:16:12 -0000 Date: Thu, 07 Nov 2002 13:16:00 -0000 Message-ID: <20021107211612.15154.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Franz Sirl Subject: Re: c/8467: Bug in sibling call optimization Reply-To: Franz Sirl X-SW-Source: 2002-11/txt/msg00377.txt.bz2 List-Id: The following reply was made to PR c/8467; it has been noted by GNATS. From: Franz Sirl To: gcc-gnats@gcc.gnu.org Cc: gcc-bugs@gcc.gnu.org, gcc-patches@gcc.gnu.org, Mark Mitchell Subject: Re: c/8467: Bug in sibling call optimization Date: Thu, 7 Nov 2002 22:12:01 +0100 --------------Boundary-00=_1K58ZGKQV14TE1LTMPZF Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Hi, it turns out this bug is easily fixed with an intermediate move insn covering the case when DECL_MODE differs from the mode of the DECL_RTL. Bootstrap on powerpc-linux-gnu is currently runnning. OK to commit patch&testcase to mainline and branch after the bootstrap completed successfully? Franz. PR c/8467 * stmt.c (tail_recursion_args): Handle DECL_MODE differing from the mode of DECL_RTL case. --------------Boundary-00=_1K58ZGKQV14TE1LTMPZF Content-Type: text/plain; charset="iso-8859-1"; name="gcc-tailrecursion.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="gcc-tailrecursion.patch" Index: gcc/stmt.c =================================================================== RCS file: /cvsroot/gcc/gcc/gcc/stmt.c,v retrieving revision 1.248.2.4 diff -u -p -r1.248.2.4 stmt.c --- gcc/stmt.c 17 Apr 2002 01:43:57 -0000 1.248.2.4 +++ gcc/stmt.c 7 Nov 2002 20:51:44 -0000 @@ -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 (); --------------Boundary-00=_1K58ZGKQV14TE1LTMPZF--