From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by sourceware.org (Postfix) with ESMTPS id 63EA93858C83 for ; Tue, 18 Oct 2022 12:16:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 63EA93858C83 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-xb33.google.com with SMTP id 63so16731725ybq.4 for ; Tue, 18 Oct 2022 05:16:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=fcGjLbQDvrLcOVreiczLJw4vBriw79lSqDpOrOVkanc=; b=OGjsZK962s5a57GyTLWSKA5wR4BqwHW3HeqFZNWVHCXajqhFg206+hgiet7yCVdWi6 7bnh95zi+QWy+s4syBdBzs0ee3b8bttc9c01meASmZR/PXg4QMci+Klq3XGNCtNwQrl+ gvXemQLSehpTPDdmojOoGhZZ+QII+meZ34tW9kd6RfxtgMPcXpliNYrj9GXDcUabnBO6 jSLorvryQCUdeVY5PqrLtgco+lue6AwvOzsW8gPNu+tvAwYghcoU8JqbtBw/77TY6oxE VnlMAuRZZg3rrqLCiKenCaUVNlw6SgjB9l6lFng6UZECIWLAcLsBx1H4yIr7cCfuXJM/ ZTiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fcGjLbQDvrLcOVreiczLJw4vBriw79lSqDpOrOVkanc=; b=c/80eXf/D05vW5oSDiKu0l3iiSBrgdCmiBCqVRlmzNvOfMoHV03bV7q6h2qu8og3Xm GsfE8v/GCBC6JsODpkEinb+/LIyQQ0uEv+d0ZcdT7vs+TXMloydeV5yXh5FUqFjJfbzx SAjaETAs+APDtcbPvxK7CkqfPf+PaSYlnaSXAz/Rlr+j012YIifyvkiO8VwLagtRVddg 4uI8xU73+iU2W0WkOtOrqDOBl6EgG0Zxz8KzxECwpPZWsu/sH4SnLwCKhsa8Y2qUf18i rtU8ativeyKa3uYYqqtaxC7eovK+HVgtKQIkOtM/4c2dQj190cxaGDLK2woxhrTkvHoT jsDQ== X-Gm-Message-State: ACrzQf0HUa+s88mL0/HZJj48OQbCqIKBYTsImg+AurRYUt7VS2nnJNKs rDX1B9uqLbQM9loTKuGErcKS9nuAgIMUzVjYCYVCbGIiSXM= X-Google-Smtp-Source: AMsMyM50lZyqij3ZpIo/87yZ4XLuF6vim6XMBLbkl3AI42lYdfLYOHCLnMHJURh5zdhu3QmjKWuK8VjpHrP1NwVAnRs= X-Received: by 2002:a5b:803:0:b0:691:8cba:55bd with SMTP id x3-20020a5b0803000000b006918cba55bdmr2226746ybp.539.1666095408647; Tue, 18 Oct 2022 05:16:48 -0700 (PDT) MIME-Version: 1.0 References: <7e3fe210-6dbc-fc29-dbb8-b951e89cf7e9@yahoo.co.jp> <87f124f0-8a10-6c3b-6b12-cabf855e2e4b@yahoo.co.jp> <3296b387-083a-40cf-1bb5-40269e804f52@yahoo.co.jp> In-Reply-To: From: Max Filippov Date: Tue, 18 Oct 2022 05:16:37 -0700 Message-ID: Subject: Re: [PATCH v2] xtensa: Prepare the transition from Reload to LRA To: "Takayuki 'January June' Suwa" Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,GIT_PATCH_0,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SCC_5_SHORT_WORD_LINES,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Suwa-san, v2 fixes the regressions caused by ICEs, but not the runtime failures. On Mon, Oct 17, 2022 at 8:14 PM Max Filippov wrote: > On Mon, Oct 17, 2022 at 7:57 PM Takayuki 'January June' Suwa > wrote: > > On 2022/10/16 14:03, Max Filippov wrote: > > > There's also the following runtime failures, but only on call0 configuration: > > > > > > +FAIL: gcc.c-torture/execute/20010122-1.c -O1 execution test > > > +FAIL: gcc.c-torture/execute/20010122-1.c -O2 execution test > > > +FAIL: gcc.c-torture/execute/20010122-1.c -O3 -g execution test > > > +FAIL: gcc.c-torture/execute/20010122-1.c -Os execution test > > > +FAIL: gcc.c-torture/execute/20010122-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test > > > > both assembler outputs with and without this patch are identical on my side > > Interesting. In -O1 test I see the following difference that is going to affect > the return value of the corresponding functions: > > --- gcc-13-3308-gb4a4c6382b14-call0-le/20010122-1.s 2022-10-17 > 20:07:32.390363204 -0700 > +++ gcc-13-3309-g851636ecd015-call0-le/20010122-1.s 2022-10-17 > 20:06:36.613785546 -0700 > @@ -143,13 +143,10 @@ > test2: > addi sp, sp, -16 > s32i.n a0, sp, 12 > - s32i.n a12, sp, 8 > - mov.n a12, a0 > l32r a2, .LC6 > callx0 a2 > - mov.n a2, a12 > + mov.n a2, a0 > l32i.n a0, sp, 12 > - l32i.n a12, sp, 8 > addi sp, sp, 16 > ret.n > .size test2, .-test2 > @@ -161,13 +158,10 @@ > test3: > addi sp, sp, -16 > s32i.n a0, sp, 12 > - s32i.n a12, sp, 8 > - mov.n a12, a0 > l32r a2, .LC7 > callx0 a2 > - mov.n a2, a12 > + mov.n a2, a0 > l32i.n a0, sp, 12 > - l32i.n a12, sp, 8 > addi sp, sp, 16 > ret.n > .size test3, .-test3 > @@ -258,14 +252,11 @@ > test8: > addi sp, sp, -16 > s32i.n a0, sp, 12 > - s32i.n a12, sp, 8 > - mov.n a12, a0 > l32r a2, .LC12 > callx0 a2 > l32r a2, .LC13 > - s32i.n a12, a2, 0 > + s32i.n a0, a2, 0 > l32i.n a0, sp, 12 > - l32i.n a12, sp, 8 > addi sp, sp, 16 > ret.n > .size test8, .-test8 I've noticed that this is related to the following hunk: -#define CALL_USED_REGISTERS \ +#define CALL_REALLY_USED_REGISTERS \ { \ - 1, 1, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 2, 2, 2, 2, \ - 1, 1, 1, \ + 0, 0, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 2, 2, 2, 2, \ + 0, 0, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 1, \ } And the following change on top of v2 fixes this regression for me: diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index 6b60e5960625..897f87f735da 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -244,7 +244,7 @@ along with GCC; see the file COPYING3. If not see #define CALL_REALLY_USED_REGISTERS \ { \ - 0, 0, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 2, 2, 2, 2, \ + 1, 0, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 2, 2, 2, 2, \ 0, 0, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 1, \ -- Thanks. -- Max