From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18320 invoked by alias); 8 Apr 2008 11:40:27 -0000 Received: (qmail 18166 invoked by uid 22791); 8 Apr 2008 11:40:24 -0000 X-Spam-Check-By: sourceware.org Received: from wf-out-1314.google.com (HELO wf-out-1314.google.com) (209.85.200.168) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 08 Apr 2008 11:39:57 +0000 Received: by wf-out-1314.google.com with SMTP id 28so2263712wfc.14 for ; Tue, 08 Apr 2008 04:39:55 -0700 (PDT) Received: by 10.142.79.15 with SMTP id c15mr3091414wfb.105.1207654795398; Tue, 08 Apr 2008 04:39:55 -0700 (PDT) Received: by 10.142.100.19 with HTTP; Tue, 8 Apr 2008 04:39:55 -0700 (PDT) Message-ID: <84fc9c000804080439o2e5aa335ud53517963ddd8ead@mail.gmail.com> Date: Tue, 08 Apr 2008 11:43:00 -0000 From: "Richard Guenther" To: "Andreas Krebbel" Subject: Re: [PATCH] Target macro to redefine 'm' constraint letter Cc: gcc-patches@gcc.gnu.org In-Reply-To: <20080320160940.GA13997@homer.boeblingen.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080320160940.GA13997@homer.boeblingen.de.ibm.com> X-IsSubscribed: yes 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: 2008-04/txt/msg00641.txt.bz2 On Thu, Mar 20, 2008 at 5:09 PM, Andreas Krebbel wrote: > Hello, > > as discussed in the mail-thread starting with: > http://gcc.gnu.org/ml/gcc-patches/2007-10/msg01407.html > it might be necessary to override the meaning of the 'm' constraint > when adding new address formats to the GO_IF_LEGITIMATE_ADDRESS_P > hook. > > The attached patch implements the suggestion from Richard Sandiford. > A new target macro called TARGET_MEM_CONSTRAINT is introduced which > allows to change the constraint letter used for the addresses matched > by the legitimate address hook. That way it is possible to extend the > set of accepted addresses in the hook without changing the semantics of > the 'm' constraint what would be fatal for inline assemblies using > that constraint. > > Another solution might be to provide a more general mechanism letting > back ends override all standard constraints. The middle-end would > just provide default implementations which might be replaced in a back > end by using the standard constraint definition mechanism: > http://gcc.gnu.org/ml/gcc-patches/2007-11/msg00319.html > > Since I never got a response to that I've decided to go with Richards > suggestion in order to have at least one supporter ;) > > This change currently is a nop for all architectures. > > Boostrapped and reg-tested on s390x and i686. > > Ok for mainline? This is ok for mainline given no objections from other maintainers within 24h. Thanks, Richard. > Bye, > > -Andreas- > > 2008-03-20 Andreas Krebbel > > * defaults.h (TARGET_MEM_CONSTRAINT): New target macro added. > * postreload.c (reload_cse_simplify_operands): Replace 'm' > constraint with TARGET_MEM_CONSTRAINT. > * recog.c (asm_operand_ok, preprocess_constraints, > constrain_operands): Likewise. > * regclass.c (record_reg_classes): Likewise. > * reload.c (find_reloads, alternative_allows_const_pool_ref): > Likewise. > * reload1.c (maybe_fix_stack_asms): Likewise. > * stmt.c (parse_output_constraint, parse_input_constraint): > Likewise. > * recog.h: Adjust comment. > * genpreds.c (generic_constraint_letters): Remove 'm' constraint. > * genoutput.c (note_constraint): Don't emit error for 'm' > constraint. > * doc/md.texi: Add a note to description of 'm' constraint. > * doc/tm.texi: Document the new TARGET_MEM_CONSTRAINT macro.