From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id EA1093858D35 for ; Thu, 12 Jan 2023 16:25:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EA1093858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 30CGNVSc021819; Thu, 12 Jan 2023 10:23:31 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 30CGNUjo021818; Thu, 12 Jan 2023 10:23:30 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 12 Jan 2023 10:23:30 -0600 From: Segher Boessenkool To: Paul Koning Cc: GCC Development Subject: Re: LRA produces RTL not meeting constraint Message-ID: <20230112162330.GB25951@gate.crashing.org> References: <30F1C49F-FD69-4489-B132-61E94AF9A005@comcast.net> <20230111195241.GY25951@gate.crashing.org> <9752D10A-310F-4015-ABA2-48638E9294E3@comcast.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9752D10A-310F-4015-ABA2-48638E9294E3@comcast.net> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP 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 Wed, Jan 11, 2023 at 07:38:44PM -0500, Paul Koning wrote: > > On Jan 11, 2023, at 2:52 PM, Segher Boessenkool wrote: > > On Tue, Jan 10, 2023 at 02:39:34PM -0500, Paul Koning via Gcc wrote: > > Before reload it did not have operands[0] and operands[1] the same, > > already? > > No, and given that it's an addhi3 pattern that is fine before reload. It's reload that has to make them match because the machine instruction is two operand. Sure. And one here is a pseudo, so it actually *can* reasonably be tied. > Indeed. So does that mean the discussion about insn 48 is the interesting one? That goes on for a while: No, the insns 49 one is the useful one. 2 Non-pseudo reload: reject+=2 2 Non input pseudo reload: reject++ alt=0,overall=9,losers=1,rld_nregs=1 alt=1,overall=0,losers=0,rld_nregs=0 1 Matching alt: reject+=2 1 Non-pseudo reload: reject+=2 1 Non input pseudo reload: reject++ alt=0,overall=11,losers=1 -- refuse 1 Matching alt: reject+=2 1 Non-pseudo reload: reject+=2 1 Non input pseudo reload: reject++ alt=1,overall=11,losers=1 -- refuse 0 Spill pseudo into memory: reject+=3 Using memory insn operand 0: reject+=3 0 Non input pseudo reload: reject++ alt=2,overall=13,losers=1 -- refuse 0 Spill pseudo into memory: reject+=3 Using memory insn operand 0: reject+=3 0 Non input pseudo reload: reject++ alt=3,overall=13,losers=1 -- refuse Choosing alt 1 in insn 49: (0) rR (1) 0 (2) Qi {addhi3} For all four constraints it could tie operands[1] to it got "refuse". This can't be good. > > Please show *all* relevant things in the reload dump file? Everything > > about insn 49 or any insn added to reload it, for example. > > I didn't see anything added to 49, but I'm not sure if I would necessarily recognize it. One observation is that the previous and next insns numbers are 48 and 53 in the IRA and Reload dumps both. It would look like e.g. Inserting insn reload before: 413: r179:SI=r25:SI or Inserting insn reload after: 414: r45:SI=r179:SI > Attached is a .i file produced from the failing compile, with unneeded parts removed. It's not really tiny but not all that large. It consistently shows the failure using a pdp11-aout targeted GCC built from yesterday's code, when using -O2 or -Os and -mlra. It doesn't fail with -O1 or if -mlra is omitted (defaulting, in the currently committed code, to old reload). It helped, I can reproduce the problem. Thanks! Open a PR for the problem? So that people can cooperate on it easier, and to battle the "attention span of a goldfish" problem? Segher