From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27960 invoked by alias); 20 Oct 2009 15:22:45 -0000 Received: (qmail 27949 invoked by uid 22791); 20 Oct 2009 15:22:44 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from miranda.se.axis.com (HELO miranda.se.axis.com) (193.13.178.8) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Oct 2009 15:22:40 +0000 Received: from ignucius.se.axis.com (ignucius.se.axis.com [10.13.11.50]) by miranda.se.axis.com (8.13.4/8.13.4/Debian-3sarge3) with ESMTP id n9KFMaw1018803; Tue, 20 Oct 2009 17:22:36 +0200 Received: from ignucius.se.axis.com (localhost [127.0.0.1]) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id n9KFMaf8029997; Tue, 20 Oct 2009 17:22:36 +0200 Received: (from hp@localhost) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) id n9KFMaKt029993; Tue, 20 Oct 2009 17:22:36 +0200 Date: Tue, 20 Oct 2009 15:23:00 -0000 Message-Id: <200910201522.n9KFMaKt029993@ignucius.se.axis.com> From: Hans-Peter Nilsson To: nickc@redhat.com CC: gcc-patches@gcc.gnu.org In-reply-to: (message from Nick Clifton on Tue, 20 Oct 2009 09:46:09 +0100) Subject: Re: RFA: Provide a default definition of CONSTANT_ADDRESS_P MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2009-10/txt/msg01291.txt.bz2 > From: Nick Clifton > Date: Tue, 20 Oct 2009 09:46:09 +0100 > Index: gcc/defaults.h > =================================================================== > --- gcc/defaults.h (revision 152972) > +++ gcc/defaults.h (working copy) > @@ -1154,4 +1154,10 @@ > #define GO_IF_MODE_DEPENDENT_ADDRESS(X, WIN) > #endif > > +/* For most ports anything that evaluates to a constant symbolic > + or integer value is acceptable as a constant address. */ > +#ifndef CONSTANT_ADDRESS_P > +#define CONSTANT_ADDRESS_P(X) (CONSTANT_P (X) && GET_CODE (X) != CONST_DOUBLE) > +#endif > + Wait, shouldn't that be #define CONSTANT_ADDRESS_P(X) \ (CONSTANT_P (X) && LEGITIMATE_CONSTANT_P (X) && GET_CODE (X) != CONST_DOUBLE) ? Beware, you're going to have to actually test that. At some point I have to submit the gcc TLS-patches for CRIS; they're for CRIS v32 only at the moment. There, I have to define CONSTANT_ADDRESS_P so as not to allow thread variables that haven't been UNSPEC-adorned (through the movsi-expander). But, when doing that and other needs to define CONSTANT_ADDRESS_P, it'd help being able to include the default definition, in case someone in the future finds out that it's probably a good idea to also exclude, uh... (looking), CONST_VECTOR and CONST_FIXED. ;) Is it too late to ask for some variant of: #define DEFAULT_CONSTANT_ADDRESS_P(X) \ (CONSTANT_P (X) && LEGITIMATE_CONSTANT_P (X) && GET_CODE (X) != CONST_DOUBLE) #ifndef CONSTANT_ADDRESS_P #define CONSTANT_ADDRESS_P(X) DEFAULT_CONSTANT_ADDRESS_P (X) #endif ? PS. The documentation for LEGITIMATE_CONSTANT_P lies; you *have* to define it to other than 1 in order to implement TLS. But that's another story. brgds, H-P