From patchwork Mon Apr 27 10:07:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 464928 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A13A41402B6 for ; Mon, 27 Apr 2015 20:07:34 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=aaop0bV+; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=JuHd/iAsgbG16pLM 3e6KRuU1FFvULQLsA9XO5WhFkmFUkJSJHHhaRNi57kFMk7AHuR4PbQCgHSdE+I54 m4RFwAAq0in5/9wdTYS40++Dhc40jWLwt6zQShu9fykPVz5roOb43aJ2PFPp+oF0 uoIGrgzBU7IuIissrY8QsiUEZAc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=7ip1jLS+oZDCjTuwLCG409 FRJEU=; b=aaop0bV+1Zkoq0laO6yV3LIMpxDQsPXHaAoz2K6MISTZCNs9ApL2Rm WNbgZuoEcEm6GZwbhZbs65jsZ89sHKYt6pvPTGp8mITSyb0yWyw3tLILEbL6CeRc y8u8tfFo3jK5eO75YjpD2w5CkLlYPuOdgAdKCTqiZ8e+EgZQ2fttU= Received: (qmail 10079 invoked by alias); 27 Apr 2015 10:07:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 10045 invoked by uid 89); 27 Apr 2015 10:07:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 27 Apr 2015 10:07:25 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by uk-mta-3.uk.mimecast.lan; Mon, 27 Apr 2015 11:07:23 +0100 Received: from localhost ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 27 Apr 2015 11:07:23 +0100 From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: Extend list of codes accepted by address_operand Date: Mon, 27 Apr 2015 11:07:22 +0100 Message-ID: <87mw1tyjdx.fsf@e105548-lin.cambridge.arm.com> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-MC-Unique: yr4yoE7WSvqXUvJtW8vb5g-1 While testing the patch that I'm about to post, I found that the list of address_operand codes in gensupport.c was incomplete. This patch fills in some "obvious" missing entries. It isn't exactly clear which codes are allowed at the top level of an address. decompose_address is known to be general enough for all LRA targets, but it also technically accepts any unary operator as the outer code, whereas I think only SIGN_EXTEND and ZERO_EXTEND are used at the top level. The routine accepts ZERO_EXTRACT and SIGN_EXTRACT, but I think in practice they're only used for index values and not full addresses. Tested on x86_64-linux-gnu. OK to install? Thanks, Richard gcc/ * gensupport.c (std_preds): Add missing codes to address_operand entry. Index: gcc/gensupport.c =================================================================== --- gcc/gensupport.c 2015-04-27 10:38:48.000000000 +0100 +++ gcc/gensupport.c 2015-04-27 10:40:59.044635383 +0100 @@ -2800,7 +2800,8 @@ struct std_pred_table static const struct std_pred_table std_preds[] = { {"general_operand", false, true, {SUBREG, REG, MEM}}, - {"address_operand", true, true, {SUBREG, REG, MEM, PLUS, MINUS, MULT}}, + {"address_operand", true, true, {SUBREG, REG, MEM, PLUS, MINUS, MULT, + ZERO_EXTEND, SIGN_EXTEND, AND}}, {"register_operand", false, false, {SUBREG, REG}}, {"pmode_register_operand", true, false, {SUBREG, REG}}, {"scratch_operand", false, false, {SCRATCH, REG}},