From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by sourceware.org (Postfix) with ESMTPS id 7DCB73858D20 for ; Wed, 31 May 2023 12:15:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7DCB73858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-256766a1c43so2079053a91.1 for ; Wed, 31 May 2023 05:15:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1685535358; x=1688127358; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uXuewieoSWCsP2gvVlm1XcEVfzGS7UiwN6lUgK3eFts=; b=r1JphK97E/jttm1Q+hkIzXY6qAE2H+mxVTopVAmQuGaJhl3DtgHDNjiFkTNL3r2qmv dbeigX8CLFtO/s5wK5WGLw2V22PELZNopPlhIHmhOOb8A+sgnC+GhPo+M8IfKoLZMVI7 OUhUapQx7FoSRlm3BKBalzjt2AIm/9Mp5gGUB/pDmFOItTFh3EP9LObmBDX1Fl8QHWy3 sRzztuHvFu+ERoVmGwmKRUBh2pVT/vl0ZfghPkQsfhnqbRViWMFTixgZNz5CWuSq87wp WEKjcrhUVqGV+qlguxC49Iec04NplcG4cpbWn+3u+yqPQA+0m+CjBJLVVj+poIeRbTU4 95rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685535358; x=1688127358; h=content-transfer-encoding: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=uXuewieoSWCsP2gvVlm1XcEVfzGS7UiwN6lUgK3eFts=; b=jOTZDIdtqHZHiQT22Ymr03evwFcYXfQHNTMGNNeBXUGCtulMxWZ97dX+WFaPmBXHsX BnUGTfiddqL+lg3917ZR1uoVPgY0WiMBYbfhze3h/SGHHRHM1NJDknC7313sbjgbenvL 83sPn1EzgrDIWonxL0bZufxtPdw4yv8exkrR/TG54wWbslsyIwXet3ef59xFXECx3/iZ kfd/lEyA035ErCBGSfEY5J5kvsxWHYTtXljaNSFOeWHPUakejdswwaXJUdsj5D0byhe6 VAYbgvV0YiPNDGuMMIo8qhRN9CGPy3EP7sx3Ivpho0D2sLUDF9BJQKLdtJsUm27QQ0He 2rMA== X-Gm-Message-State: AC+VfDxqO/VwI8uB34/NzNrAWWQsV2ABUUCx0mZoESyC8J17j5lusNZ4 JprtqhXFmYwEhY8zjnHA3egz415jxFHPClzwGU16zw== X-Google-Smtp-Source: ACHHUZ4GieCWQ4ZgZ53ThLRLesZ8+h11VvTepKoe4clSt8M3Kr8MSe+u7hvmHCBWplbBw1cjDgbTDkr+5bxiH4jmzo4= X-Received: by 2002:a17:90a:fc3:b0:256:7650:479e with SMTP id 61-20020a17090a0fc300b002567650479emr4619199pjz.16.1685535358474; Wed, 31 May 2023 05:15:58 -0700 (PDT) MIME-Version: 1.0 References: <20230525123550.1072506-1-manolis.tsamis@vrull.eu> <20230525123550.1072506-3-manolis.tsamis@vrull.eu> <46d35ebf-b73a-b60d-4e03-35327f1ce80e@gmail.com> In-Reply-To: <46d35ebf-b73a-b60d-4e03-35327f1ce80e@gmail.com> From: Manolis Tsamis Date: Wed, 31 May 2023 15:15:22 +0300 Message-ID: Subject: Re: [PATCH 2/2] cprop_hardreg: Enable propagation of the stack pointer if possible. To: Jeff Law Cc: gcc-patches@gcc.gnu.org, Richard Biener , Palmer Dabbelt , Philipp Tomsich , Kito Cheng Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, May 25, 2023 at 4:38=E2=80=AFPM Jeff Law wr= ote: > > > > On 5/25/23 06:35, Manolis Tsamis wrote: > > Propagation of the stack pointer in cprop_hardreg is currenty forbidden > > in all cases, due to maybe_mode_change returning NULL. Relax this > > restriction and allow propagation when no mode change is requested. > > > > gcc/ChangeLog: > > > > * regcprop.cc (maybe_mode_change): Enable stack pointer propag= ation. > I can't see how this can be correct given the stack pointer equality > tests elsewhere in the compiler, particularly the various targets. > > The problem is if you change the mode then you end up with multiple REG > expressions that reference the stack pointer. > > See rev: d1446456c3fcaa7be628726c9de4a877729490ca and the thread around > the change which introduced this code. > Hi Jeff, Isn't this fine for this case since: 1) stack_pointer_rtx is used which won't cause issues with pointer equalities (If I understand correctly). 2) Propagation is guarded with `if (orig_mode =3D=3D new_mode)` so only when there is no mode change. Thanks, Manolis > > Jeff