From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78554 invoked by alias); 5 Sep 2019 12:17:49 -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 78539 invoked by uid 89); 5 Sep 2019 12:17:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-pf1-f170.google.com Received: from mail-pf1-f170.google.com (HELO mail-pf1-f170.google.com) (209.85.210.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Sep 2019 12:17:47 +0000 Received: by mail-pf1-f170.google.com with SMTP id q21so1621479pfn.11 for ; Thu, 05 Sep 2019 05:17:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:openpgp:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=a3HEyMn+JZW5xaas/AdAL1OCHrNao+qPk8GjpAxeZaM=; b=TavjIEPZOi/Fec5JYERl8xw8RCcWc0U5Se/zIm8LOE099pJ9t5XEupJhq1CUrNIUuQ MUMo9th3tFm/WCt8xf5CBbXWx+c/4BWTlbLcYwAcCwPHt/cmC8lfyjcd0wsEQzD7ZHy7 gF5eu+E65Ca8w6EIi8MCyesnk0BjNYTUzSwDRmY+rEzLhmSlY416RW1Xql39DLMuQ4GK B7wOg3ocpDlc5xQqqXCOidp1rE4qcGibTAlebFMXljfV+ny3Gf2bpYe6Vy9sk56D0TkK bzT6X7jgB9QcdQrLQmJ3CP8rKhGhzl9sEevrG9bYo7OpNpSW9E9fhcBraXenELJTEV4P /+aA== Return-Path: Received: from ?IPv6:2607:fb90:17d2:322f:60df:1067:de7b:c16e? ([2607:fb90:17d2:322f:60df:1067:de7b:c16e]) by smtp.gmail.com with ESMTPSA id z23sm2565422pfn.45.2019.09.05.05.17.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Sep 2019 05:17:42 -0700 (PDT) Subject: Re: [PATCH, AArch64, v3 5/6] aarch64: Implement -matomic-ool To: Kyrill Tkachov , "gcc-patches@gcc.gnu.org" Cc: Ramana Radhakrishnan , "agraf@suse.de" , Marcus Shawcroft , James Greenhalgh References: <20181101214648.29432-1-richard.henderson@linaro.org> <20181101214648.29432-6-richard.henderson@linaro.org> From: Richard Henderson Openpgp: preference=signencrypt Message-ID: <251bfc99-225d-97c9-2e82-e1bc29424a67@linaro.org> Date: Thu, 05 Sep 2019 12:17:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2019-09/txt/msg00285.txt.bz2 On 9/5/19 2:56 AM, Kyrill Tkachov wrote: > On 11/1/18 9:46 PM, Richard Henderson wrote: >> +  else if (TARGET_ATOMIC_OOL) >> +    { >> +      /* Oldval must satisfy compare afterward.  */ >> +      if (!aarch64_plus_operand (oldval, mode)) >> +       oldval = force_reg (mode, oldval); >> +      rtx func = aarch64_atomic_ool_func (mode, mod_s, &aarch64_ool_cas_names); >> +      rval = emit_library_call_value (func, NULL_RTX, LCT_NORMAL, r_mode, >> +                                     oldval, mode, newval, mode, >> +                                     XEXP (mem, 0), ptr_mode); > > > As reported at https://gcc.gnu.org/ml/gcc-patches/2019-09/msg00118.html > > I've encountered ICEs here with -mabi=ilp32 due to the mode of the address of MEM. > >    rtx addr = XEXP (mem, 0); >       if (Pmode != ptr_mode) >     addr = convert_memory_address (ptr_mode, addr); > > above the emit_library_call_value to force the address into ptr_mode and use > addr as the argument fixed that for me. The address should be promoted to Pmode for the call, as the little assembly routine doesn't (and shouldn't) care for the extension itself. I'll try aarch64-elf before re-posting. r~