From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28587 invoked by alias); 30 Mar 2005 19:28:21 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 28546 invoked by alias); 30 Mar 2005 19:28:14 -0000 Date: Wed, 30 Mar 2005 19:28:00 -0000 Message-ID: <20050330192814.28544.qmail@sourceware.org> From: "aoliva at redhat dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050316021720.20491.aelschuring@hotmail.com> References: <20050316021720.20491.aelschuring@hotmail.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug middle-end/20491] [4.0/4.1 Regression] internal compiler error: in subreg_regno_offset, at rtlanal.c:3042 X-Bugzilla-Reason: CC X-SW-Source: 2005-03/txt/msg03479.txt.bz2 List-Id: ------- Additional Comments From aoliva at gcc dot gnu dot org 2005-03-30 19:28 ------- Subject: Re: [PR middle-end/20491] combine generates bad subregs On Mar 29, 2005, Alexandre Oliva wrote: > On Mar 28, 2005, Richard Henderson wrote: >> On Thu, Mar 24, 2005 at 07:45:44AM -0300, Alexandre Oliva wrote: >>> * combine.c (subst): Make sure we don't create invalid subregs. >> Ok. > As it turned out, the bug seems to have been fixed by some other > patch, because I no longer get the error in mainline or in the 4.0 > branch. Or perhaps it never actually failed on x86_64-linux-gnu, which is where I was trying to trigger it again. Not even with -m32. A build on i686-pc-linux-gnu was enough to trigger it. Yay me! :-) So, the patch posted in my previous e-mail still stands, but if you, like me, find that it's working too hard to avoid such subregs, here's an alternative patch that also fixes the problem, at least as long as the X-constrained asm operand is not actually used in the asm output pattern. Index: gcc/ChangeLog from Alexandre Oliva PR middle-end/20491 * final.c (alter_subreg): Don't call subreg_regno for a non-REG. Index: gcc/final.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/final.c,v retrieving revision 1.344.12.1 diff -u -p -r1.344.12.1 final.c --- gcc/final.c 22 Mar 2005 13:39:12 -0000 1.344.12.1 +++ gcc/final.c 30 Mar 2005 19:21:02 -0000 @@ -1,6 +1,7 @@ /* Convert RTL to assembler code and output it, for GNU compiler. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, - 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. This file is part of GCC. @@ -2638,7 +2639,7 @@ alter_subreg (rtx *xp) if (new != 0) *xp = new; - else + else if (REG_P (y)) { /* Simplify_subreg can't handle some REG cases, but we have to. */ unsigned int regno = subreg_regno (x); -- 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} -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20491