From patchwork Thu May 5 09:22:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Bennett X-Patchwork-Id: 618881 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 3r0qFQ5bf4z9t3g for ; Thu, 5 May 2016 19:22:49 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=lu3Bs3g5; 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:cc:subject:date:message-id:content-type :content-transfer-encoding:mime-version; q=dns; s=default; b=ePg 1UUQUR4ufekS8pF+YTwjrH9/PhM1jx7lXLXipFtttQLVNnT8SSrldcVEB9pyDs8f p7/7PhgnkN68rQdraYHy8Fo7E5iqYNDUkVsn9QokkOslgA1M0OxiiQBgGlUxBT1V jprSHHVIe5nJA0iI1ub/gkvhWEzVANppjjq1mqxA= 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:cc:subject:date:message-id:content-type :content-transfer-encoding:mime-version; s=default; bh=A+sbn2l7G 6EJ0gqlNaun+Bfcaj0=; b=lu3Bs3g59tmnLWnJErh+i6JpYDOtwkTvsIicmpaxr YFdGsxEArcVkxA4clWapS8VJyznYELeJ8DvKtWzdV/NS2cL1ukjplfsgpfPmUZPn BxvUnmKV14RRKPdRCD7MddPV3tyevA+RDyCEVtiYbn5OHTpWCTy5E0mIYkdm+43I 7w= Received: (qmail 75232 invoked by alias); 5 May 2016 09:22:26 -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 75199 invoked by uid 89); 5 May 2016 09:22:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=letter X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 May 2016 09:22:15 +0000 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Websense Email with ESMTPS id E7516CCAF5EF6 for ; Thu, 5 May 2016 10:22:10 +0100 (IST) Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by hhmail02.hh.imgtec.org (10.100.10.20) with Microsoft SMTP Server (TLS) id 14.3.266.1; Thu, 5 May 2016 10:22:12 +0100 Received: from LEMAIL01.le.imgtec.org ([fe80::5ae:ee16:f4b9:cda9]) by LEMAIL01.le.imgtec.org ([fe80::5ae:ee16:f4b9:cda9%17]) with mapi id 14.03.0266.001; Thu, 5 May 2016 10:22:12 +0100 From: Andrew Bennett To: "gcc-patches@gcc.gnu.org" CC: Matthew Fortune Subject: [PATCH] MIPS: In mips_print_address_operand pass the mode argument to mips_classify_address Date: Thu, 5 May 2016 09:22:11 +0000 Message-ID: <0DA23CC379F5F945ACB41CF394B982776A6DAAF9@LEMAIL01.le.imgtec.org> MIME-Version: 1.0 X-IsSubscribed: yes Hi, Currently the mips_print_operand_address function ignores its mode argument, and when it calls mips_classify_address it forces the mode argument to be the machine's word mode. This patch makes mips_print_operand_address pass the mode argument provided to it to mips_classify_address, so that it uses the actual mode of the mem rtx. This patch is also a pre-requisite for the following patch: https://gcc.gnu.org/ml/gcc-patches/2016-05/msg00314.html. I have tested the patch on the mips-mti-elf toolchain and there have been no regressions. The patch and ChangeLog are below. Ok to commit? Many thanks, Andrew gcc/ * config/mips/mips.c (mips_print_operand_address): Pass the mode argument to mips_classify_address. diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 399f231..6cdda3b 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -8634,11 +8634,14 @@ mips_print_operand (FILE *file, rtx op, int letter) /* Implement TARGET_PRINT_OPERAND_ADDRESS. */ static void -mips_print_operand_address (FILE *file, machine_mode /*mode*/, rtx x) +mips_print_operand_address (FILE *file, machine_mode mode, rtx x) { struct mips_address_info addr; - if (mips_classify_address (&addr, x, word_mode, true)) + if (mode == VOIDmode) + mode = word_mode; + + if (mips_classify_address (&addr, x, mode, true)) switch (addr.type) { case ADDRESS_REG: