From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) by sourceware.org (Postfix) with ESMTPS id 13E1E384403D for ; Wed, 16 Sep 2020 15:12:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 13E1E384403D Received: by mail-io1-xd42.google.com with SMTP id h4so8644425ioe.5 for ; Wed, 16 Sep 2020 08:12:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=RN322pCch0KNRbJwLIV37nGNF/gVBhvV1Nn4Gldflko=; b=amDBroRGgHl+YKWKLgtutgP46B15kZaQmyHQ//dosqWcT9KQoaL36V19mGcQf06kF7 CWF0DfoEsA0tHyKCqaTb+RC2FHjxidnEVPdZw5VuTtaZHs+iTKbh+iiLoHOijPiwmAzc ICl2oL8Ls6mAfVS1PUw2VokZnJ4bjSrzKvuhr2N3Cg4BtNL4iSaMa9muCK5p6aOqVE7P KRMzu9QQEGUJlZNIPjUm9w2385E3A+rmhVSEjZ2Nyc0WNkOhSu0kUwcasdqaXA2h8s0b ZxO1P9RpNIgFtxIfY1IXPDl6UHQqhJyD7VduYkv7gT68lBn7D8IuCOlnaxV981db9/tq xwMQ== X-Gm-Message-State: AOAM531z5xtfh7uIG8kxhD/E1mFBuXmRuKLe0B5tSysqc/FyUibmCn0v jo26WX5KdMArpfZGt3S1DlQZ3tqo1YtxLXgVt4k= X-Google-Smtp-Source: ABdhPJzn85p2jgbWNrizo/D3AnTduHz+SQTPmB3JNvt5q/1FrcTI7yo5jXgZlfAdOQy4uvPVHPelB7PptTz3YPGUarA= X-Received: by 2002:a5e:9e4c:: with SMTP id j12mr20095188ioq.37.1600269124376; Wed, 16 Sep 2020 08:12:04 -0700 (PDT) MIME-Version: 1.0 References: <20200915132326.60695-1-hjl.tools@gmail.com> In-Reply-To: From: "H.J. Lu" Date: Wed, 16 Sep 2020 08:11:28 -0700 Message-ID: Subject: Re: [PATCH] IRA: Don't make a global register eliminable To: "H.J. Lu" , GCC Patches , Vladimir Makarov , Richard Sandiford Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 15:12:07 -0000 On Wed, Sep 16, 2020 at 7:46 AM Richard Sandiford wrote: > > "H.J. Lu" writes: > > On Tue, Sep 15, 2020 at 7:44 AM Richard Sandiford > > wrote: > >> > >> Thanks for looking at this. > >> > >> "H.J. Lu" writes: > >> > commit 1bcb4c4faa4bd6b1c917c75b100d618faf9e628c > >> > Author: Richard Sandiford > >> > Date: Wed Oct 2 07:37:10 2019 +0000 > >> > > >> > [LRA] Don't make eliminable registers live (PR91957) > >> > > >> > didn't make eliminable registers live which breaks > >> > > >> > register void *cur_pro asm("reg"); > >> > > >> > where "reg" is an eliminable register. Make fixed eliminable registers > >> > live to fix it. > >> > >> I don't think fixedness itself is the issue here: it's usual for at > >> least some registers involved in eliminations to be fixed registers. > >> > >> I think what makes this case different is instead that cur_pro/ebp > >> is a global register. But IMO things have already gone wrong if we > >> think that a global register is eliminable. > >> > >> So I wonder if instead we should check global_regs at the beginning of: > >> > >> for (i = 0; i < fp_reg_count; i++) > >> if (!TEST_HARD_REG_BIT (crtl->asm_clobbers, > >> HARD_FRAME_POINTER_REGNUM + i)) > >> { > >> SET_HARD_REG_BIT (eliminable_regset, > >> HARD_FRAME_POINTER_REGNUM + i); > >> if (frame_pointer_needed) > >> SET_HARD_REG_BIT (ira_no_alloc_regs, > >> HARD_FRAME_POINTER_REGNUM + i); > >> } > >> else if (frame_pointer_needed) > >> error ("%s cannot be used in % here", > >> reg_names[HARD_FRAME_POINTER_REGNUM + i]); > >> else > >> df_set_regs_ever_live (HARD_FRAME_POINTER_REGNUM + i, true); > >> > >> (ira_setup_eliminable_regset), and handle the global_regs[] case in > >> the same way as the else case, i.e. short-circuiting both of the ifs. > >> > > > > Like this? > > Sorry for the delay. I was testing this in parallel. > > Bootstrapped & regression-tested on x86_64-linux-gnu. > Thanks. -- H.J.