From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 18C1E385840D; Wed, 24 Apr 2024 12:38:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 18C1E385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713962292; bh=fTc8CbBtHK2bpWm5yMqV5LFqP2MtdXZc/PrJejEe5n0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=L5FLR7fv+9l+t6E+ZkdbphlXgbA8k7rNQWpJxCmCrf9hX5erIF1669pr39HEoGcXp vMJkvV8fVfbQlJlgXmT97fkid5wHqbvuQrA2Izl3QXZTPHIuwiGnBTzNV7QMm3sI3g JNzdQ+nMhwj+GrIf81mrFSXqAi1FzB8qk+T3iERU= From: "vmakarov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/114766] ^ constraint modifier unexpectedly affects register class selection. Date: Wed, 24 Apr 2024 12:38:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization, ra X-Bugzilla-Severity: normal X-Bugzilla-Who: vmakarov at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114766 --- Comment #3 from Vladimir Makarov --- (In reply to Tamar Christina from comment #2) > (In reply to Vladimir Makarov from comment #1) > > (In reply to Tamar Christina from comment #0) > > > The documentation for ^ states: > > > > If it works for you, we could try to use the patch (although it needs s= ome > > investigation how other targets uses the hint). In any case, the > > documentation should be modified or made more clear depending on applyi= ng or > > not applying the patch. >=20 > Yeah, using the patch gives us the behavior we expected, we added a > workaround for now so we can investigate what other targets do in GCC 15. >=20 > But while looking at this we also got some unexpected behavior with using= ? >=20 >=20 > r103 costs: W8_W11_REGS:2000 W12_W15_REGS:2000 TAILCALL_ADDR_REGS:2000 > STUB_REGS:2000 GENERAL_REGS:2000 FP_LO8_REGS:0 FP_LO_REGS:0 FP_REGS:0 > POINTER_AND_FP_REGS:7000 MEM:9000 >=20 > In this particular pattern the ? isn't needed so we're removing it, but t= he > behavior is still unexpected. '?' is a very old hint (unlike ^ and @). It is used by all targets for many years. IRA cost calculation uses exactly the same algorithm as it was in n= ow non-existing regclass.c file. Changing code related to processing '?' would have very unpredictable consequences for many targets. After many years working on RA, I am still surprised how fragile code calculating costs and = reg classes and how insignificant changes can result in a cascade of GCC test failures. There are many factors which still can result in zero cost code even when '= ?' is used. You can try to use more one '?' and see what happens. If the cos= t is still zero, I could look what is going on in the cost calculation.=