From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 8C4523858C50 for ; Wed, 28 Jun 2023 14:10:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8C4523858C50 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-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fb10fd9ad3so32728495e9.0 for ; Wed, 28 Jun 2023 07:10:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1687961438; x=1690553438; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=4QjxSY6xGL4zP5H6Q5ltRKW4f8Adnw8GFBaNw3J0f9c=; b=CvzS2BPGAJtszASsubeyOONmfWRl1d3CtebHZ7UFQbx2ta3YqB8trsuYX/RZNompIU mTicVMTi5dlHp7v9KA5tXXfVrdM8qWPU96ie+rCTQLUGQXkyHIxtQ9V6VdW9c/Z9+rdO +JxjbpzZfMaRr3RZUKNImTT6ZEo+XUQWAk1tUXltGkwvW5UlBWKJ/ZZfnlxIR2Q1Nvo9 AJMa+XXs4SOGAzGXxKJSM0Ap81msWIqeMUTCMRBOSMw0t2S+oitjDDa1TUcYYM10OuQE 4olUfbWkAC82yzVyU6iSj48TN2M4b4wxVsImRcCnLDAxXhF9RCg6g5fe/WaXstBloE8Z 3Jlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687961438; x=1690553438; 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=4QjxSY6xGL4zP5H6Q5ltRKW4f8Adnw8GFBaNw3J0f9c=; b=M4voZVD0cT3oP5KxOZGZTEqsuW8LVYsXLyuBVmNy5K/3YIFJHThhQElH97A6GPx8pi GI5BYsTiS5XbGoaKF8gKKOvzv8J542DrMBSTGeSZTM2Rm1L+shoj46N0jcRW/dx2Kv4H HnCEjZttZ097XQ1XO2giHWOxHXOY67EtirNbRC+IddGIpTelkheiebIOvejpiDpaPbXh rUO7zEiNVdRwuO/2X+4c5JDjL0I5oP00eiuqAmEeHIINaiYRr3FPCKI2D/k5vKdvuNYb jya7rnosuKa+DVwScuYRfL/h5NpuXSIvbcSq/mbbciyG8zSdBQ++EAMntLCaUVgpZ9fx iiyQ== X-Gm-Message-State: AC+VfDzEQgVG33/38AGa5LPIbJQqyipJby5DWJ1mZDiu3YQoSPKo+i0T vU6K5XyjqAwqHbAkJo6pS72eic7ZyN4suT9he5f7tQ== X-Google-Smtp-Source: ACHHUZ5X4M7SD6qqeUBZO7Q93aG1xJfSzVxAeoao3aUA9XlFLRq90hsI1QKEkvh/6FOm35KbHfeIEeihAXagHPiG8mo= X-Received: by 2002:a1c:750a:0:b0:3f7:cb42:fa28 with SMTP id o10-20020a1c750a000000b003f7cb42fa28mr28117950wmc.28.1687961438315; Wed, 28 Jun 2023 07:10:38 -0700 (PDT) MIME-Version: 1.0 References: <20230622111154.2837175-1-philipp.tomsich@vrull.eu> In-Reply-To: From: Philipp Tomsich Date: Wed, 28 Jun 2023 07:10:27 -0700 Message-ID: Subject: Re: [PATCH] cprop_hardreg: fix ORIGINAL_REGNO/REG_ATTRS/REG_POINTER handling To: Jeff Law Cc: gcc-patches@gcc.gnu.org, Thiago Jung Bauermann , Tamar Christina , Jakub Jelinek , Richard Biener , Sergei Trofimovich , Andrew Pinski , Tobian Burnus , Jeff Law , Kito Cheng , Manolis Tsamis Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.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: Thanks! Applied to master with the requested changes as 417b8379b32945d61f1ce3d8281bee063eea1937. Note that the final version factors out the duplicated logic, so we now have a single place to add the comments. Philipp. On Sun, 25 Jun 2023 at 06:09, Jeff Law wrote: > > > > On 6/22/23 05:11, Philipp Tomsich wrote: > > From: Manolis Tsamis > > > > Fixes: 6a2e8dcbbd4bab3 > > > > Propagation for the stack pointer in regcprop was enabled in > > 6a2e8dcbbd4bab3, but set ORIGINAL_REGNO/REG_ATTRS/REG_POINTER for > > stack_pointer_rtx which caused regression (e.g., PR 110313, PR 110308). > > > > This fix adds special handling for stack_pointer_rtx in the places > > where maybe_mode_change is called. This also adds an check in > > maybe_mode_change to return the stack pointer only when the requested > > mode matches the mode of stack_pointer_rtx. > > > > PR 110308 > Should be > PR debug/110308 > > > > > > gcc/ChangeLog: > > > > * regcprop.cc (maybe_mode_change): Check stack_pointer_rtx mode. > > (find_oldest_value_reg): Special handling of stack_pointer_rtx. > > (copyprop_hardreg_forward_1): Ditto. > > > > gcc/testsuite/ChangeLog: > > > > * g++.dg/torture/pr110308.C: New test. > I don't doubt the need for the special handling of the stack pointer, > but it's not obvious why it's needed. So my request is that both humks > which specialize handling of ORIGINAL_REGNO, REG_ATTRS & REG_POINTER > have a comment indicating why we must not adjust those values when > NEW_RTX is STACK_POINTER_RTX. > > OK with that change. > > Jeff