From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100301 invoked by alias); 6 Dec 2018 10:56:44 -0000 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 Received: (qmail 100074 invoked by uid 89); 6 Dec 2018 10:56:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.2 spammy=get_mode, GET_MODE, 2018-11-27, 20181127 X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Dec 2018 10:56:41 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0AB2A80D; Thu, 6 Dec 2018 02:56:40 -0800 (PST) Received: from localhost (unknown [10.32.99.101]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E407D3F5AF; Thu, 6 Dec 2018 02:56:38 -0800 (PST) From: Richard Sandiford To: Jakub Jelinek Mail-Followup-To: Jakub Jelinek ,Richard Earnshaw , James Greenhalgh , Marcus Shawcroft , gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Cc: Richard Earnshaw , James Greenhalgh , Marcus Shawcroft , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Restore aarch64 support for asm ("# %a0" : : "i" (0)) (PR target/87598) References: <20181128233132.GB12380@tucnak> Date: Thu, 06 Dec 2018 10:56:00 -0000 In-Reply-To: <20181128233132.GB12380@tucnak> (Jakub Jelinek's message of "Thu, 29 Nov 2018 00:31:32 +0100") Message-ID: <8736ra6hzu.fsf@arm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-12/txt/msg00355.txt.bz2 Jakub Jelinek writes: > Hi! > > As mentioned in the PR, aarch64 used to allow VOIDmode CONST_INTs > as %aN operands, but r255230 started ICEing on it and r257907 turned > that ICE into error (output_operand_lossage). > > The following patch restores the previous behavior, by allowing such > CONST_INTs through. They will fail aarch64_classify_address a few lines > later and so aarch64_print_address_internal will return false and either > cause output_operand_lossage there, or if it is aarch64_print_address, > let the generic code handle the constant. > > Bootstrapped/regtested on aarch64-linux on GCCFarm, ok for trunk? > > 2018-11-29 Jakub Jelinek > > PR target/87598 > * config/aarch64/aarch64.c (aarch64_print_address_internal): Don't > call output_operand_lossage on VOIDmode CONST_INTs. After > output_operand_lossage do return false. > > * gcc.target/aarch64/asm-5.c: New test. > > --- gcc/config/aarch64/aarch64.c.jj 2018-11-26 22:21:24.891607602 +0100 > +++ gcc/config/aarch64/aarch64.c 2018-11-27 14:16:48.586358824 +0100 > @@ -7635,8 +7635,14 @@ aarch64_print_address_internal (FILE *f, > unsigned int size; > > /* Check all addresses are Pmode - including ILP32. */ > - if (GET_MODE (x) != Pmode) > - output_operand_lossage ("invalid address mode"); > + if (GET_MODE (x) != Pmode > + && (GET_MODE (x) != VOIDmode > + || !CONST_INT_P (x) > + || trunc_int_for_mode (INTVAL (x), Pmode) != INTVAL (x))) > + { > + output_operand_lossage ("invalid address mode"); > + return false; > + } The VOIDmode check is redundant, think it would be clearer without. OK otherwise, thanks. Richard