From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8536 invoked by alias); 5 Dec 2001 15:31:41 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 8497 invoked from network); 5 Dec 2001 15:31:35 -0000 Received: from unknown (HELO atrey.karlin.mff.cuni.cz) (195.113.31.123) by sources.redhat.com with SMTP; 5 Dec 2001 15:31:35 -0000 Received: (from hubicka@localhost) by atrey.karlin.mff.cuni.cz (8.9.3/8.9.3/Debian 8.9.3-21) id QAA06985; Wed, 5 Dec 2001 16:30:59 +0100 Date: Wed, 05 Dec 2001 07:31:00 -0000 From: Jan Hubicka To: dimmy Cc: gcc@gcc.gnu.org Subject: Re: Legitimize address, Please HELP! Message-ID: <20011205163059.M30680@atrey.karlin.mff.cuni.cz> References: <3C0E1421.1080906@mail.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3C0E1421.1080906@mail.ru> User-Agent: Mutt/1.3.20i X-SW-Source: 2001-12/txt/msg00211.txt.bz2 > int > legitimate_address_p (mode, operand, strict) > enum machine_mode mode; > rtx operand; > int strict; > { > rtx x = operand; > > /* accept @Rn */ > if (GET_CODE (operand) == REG > &&(strict ? REG_OK_FOR_BASE_STRICT_P (x) > : REG_OK_FOR_BASE_NOSTRICT_P (x))) > return 1; > > /* accept address */ > if (CONSTANT_ADDRESS_P (operand)) > return 1; > > /* accept X(Rn) */ > if (GET_CODE (operand) == PLUS > && GET_CODE (XEXP (operand, 0)) == REG > && REG_OK_FOR_BASE_P (XEXP (operand, 0)) > && CONSTANT_ADDRESS_P (XEXP (operand, 1))) > return 1; > Missing return 0; > } > -------------------------- > > Shall I define something else to prevent invalid address generation or what? It is normal for invalid addresses to be generated and rejected during the compilation. If you want to do some special tricks, you may define LEGITIMIZE macros, but in your case, it the default behaviour is most probably OK. I guess only problem is the missing return :) Honza