From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5287 invoked by alias); 28 Jul 2004 21:09:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 5272 invoked from network); 28 Jul 2004 21:09:51 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 28 Jul 2004 21:09:51 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i6SL9pe1026507 for ; Wed, 28 Jul 2004 17:09:51 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i6SL9pa02407 for ; Wed, 28 Jul 2004 17:09:51 -0400 Received: from coqui.quesejoda.com (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id i6SL9oSS026977; Wed, 28 Jul 2004 17:09:50 -0400 Received: by coqui.quesejoda.com (Postfix, from userid 500) id 59EC26E84F3; Wed, 28 Jul 2004 17:09:50 -0400 (AST) To: Alexandre Oliva Cc: gcc-patches@gcc.gnu.org Subject: Re: frv flow crash on direct returns References: From: Aldy Hernandez Date: Thu, 29 Jul 2004 11:34:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-07/txt/msg02594.txt.bz2 Richard approved this off-list. I'm going to install it. Thanks guys. > When tree-ssa was merged, frv-elf stopped building. cmovh.c for > libgcc was what failed to build. Here's a minimized testcase: > void f(int a, int b, int c) { > if (a < b || a > b + 1) > while (c) > --c; > } > This crashed when flow for sched2 realized LR, that wasn't live > before, had become live because a direct return (that uses LR) was > inserted in postreload. > Richard Sandiford had already written a patch for what I believe to be > an earlier occurrence of this problem, back when he introduced > conditional returns. Here's the patch. I'm tempted to install it as > obvious, but... Ok? > Index: gcc/ChangeLog > from Alexandre Oliva > 2003-11-19 Richard Sandiford > * config/frv/frv.h (EPILOGUE_USES): New. Use LR. > Index: gcc/config/frv/frv.h > =================================================================== > RCS file: /cvs/uberbaum/gcc/config/frv/frv.h,v > retrieving revision 1.47 > diff -u -p -r1.47 frv.h > --- gcc/config/frv/frv.h 21 May 2004 01:03:17 -0000 1.47 > +++ gcc/config/frv/frv.h 28 May 2004 06:52:49 -0000 > @@ -959,6 +959,8 @@ extern int target_flags; > #define EH_RETURN_STACKADJ_RTX gen_rtx_REG (SImode, STACKADJ_REGNO) > #define EH_RETURN_HANDLER_RTX RETURN_ADDR_RTX (0, frame_pointer_rtx) > +#define EPILOGUE_USES(REGNO) ((REGNO) == LR_REGNO) > + > /* An initializer that says which registers are used for fixed purposes all > throughout the compiled code and are therefore not available for general > allocation. These would include the stack pointer, the frame pointer > -- > Alexandre Oliva http://www.ic.unicamp.br/~oliva/ > Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org} > Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}