From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0E5283952018; Tue, 17 Aug 2021 06:15:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E5283952018 From: "law at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/101697] [11/12 regression] ICE compiling uClibc-ng for h8300-linux Date: Tue, 17 Aug 2021 06:15:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: law at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: law at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed bug_status assigned_to cf_reconfirmed_on Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2021 06:15:12 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101697 Jeffrey A. Law changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |ASSIGNED Assignee|unassigned at gcc dot gnu.org |law at gcc dot gnu.= org Last reconfirmed| |2021-08-17 --- Comment #4 from Jeffrey A. Law --- I've managed to reproduce. It's possible I was missing the -fno-builtin on= my command line. A much simplified testcase: struct gaih_servtuple { struct gaih_servtuple *next; }; int gaih_inet (const char *name, const void *req) { struct gaih_servtuple *st; int *tp; if (req) ++tp; struct gaih_servtuple **pst =3D &st; while (1) { struct gaih_servtuple *newp; newp =3D __builtin_alloca (sizeof (struct gaih_servtuple)); frob (name, tp, req, newp); *pst =3D newp; pst =3D &(newp->next); tp++; } } We're fine up to and including IRA. (insn 20 18 22 5 (set (reg/f:SI 28) (reg/f:SI 7 sp)) "k.c":21:14 19 {*movsi} (nil)) (insn 22 20 23 5 (set (mem/f:SI (pre_dec:SI (reg/f:SI 7 sp)) [1 S4 A32]) (reg/f:SI 28)) "k.c":22:7 19 {*movsi} (expr_list:REG_ARGS_SIZE (const_int 4 [0x4]) (nil))) And IRA allocates hard reg #6 for pseudo #28, which is also fine. Reload reports: Reload 1: reload_in (SI) =3D (reg/f:SI 28) GENERAL_REGS, RELOAD_FOR_INPUT (opnum =3D 1) reload_in_reg: (reg/f:SI 28) reload_reg_rtx: (reg/f:SI 7 sp) Which is not good as replacing (reg 28) with (reg sp) is not valid. I haven't tried converting the H8 to LRA yet, which would be the ultimate solution if it worked. Ideally any port not converted to LRA ought to be flagged as deprecated for gcc-12 and dropped if not fixed by gcc-13.=