From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3C4DA3858C41; Fri, 12 Jan 2024 08:48:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C4DA3858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705049314; bh=SCVnZccihmngHlfoU4pmaIQKr36ATB+1SVzzmrLk5BE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mC61tvpHLFF4/ep43+M9YvJxn24+4NQCVapd4BY+VnJkpyCsJ4hbs6Y59GBwiTpDa s02PB2FpSKyRL+pK5o5+NOmbJ2M7+paaGfBp2+uxW0vMqAKN+vzxoWBz9NhiHrumAX VDsYDuvDM4M20Oh4qRuyOItvvJ2KSaN0qAUMsroo= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113255] [11/12/13/14 Regression] wrong code with -O2 -mtune=k8 Date: Fri, 12 Jan 2024 08:48:05 +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: 13.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 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=3D113255 --- Comment #11 from Richard Biener --- diff --git a/gcc/alias.cc b/gcc/alias.cc index b2ec4806d22..0150dd699db 100644 --- a/gcc/alias.cc +++ b/gcc/alias.cc @@ -2272,6 +2272,8 @@ static bool base_alias_check (rtx x, rtx x_base, rtx y, rtx y_base, machine_mode x_mode, machine_mode y_mode) { + return 1; + /* If the address itself has no known base see if a known equivalent value has one. If either address still has no known base, nothing is known about aliasing. */ (an experiment I did many years ago already) gives clean testresults besides +FAIL: gcc.dg/guality/pr41447-1.c -O2 -DPREVENT_OPTIMIZATION execution = test +FAIL: gcc.dg/guality/pr41447-1.c -O3 -g -DPREVENT_OPTIMIZATION executi= on test +FAIL: gcc.dg/guality/pr41447-1.c -Os -DPREVENT_OPTIMIZATION execution = test +FAIL: gcc.dg/guality/pr41447-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=3Dnone -DPREVENT_OPTIMIZATION execution test and only minor change in code generation: text data bss dec hex filename 48374841 64824 1939512 50379177 300b9a9 ../obj2/gcc/cc1plus 48375065 64824 1939512 50379401 300ba89 gcc/cc1plus where the larger binary is the patched one. Assembly-wise there are scheduling changes, missed scheduling over spills. Recovering this and similar cases should be as easy as marking spill MEMs with a flag (in MEM_EXPR) for example, distinguishing (classes of) stack memory from the rest. We should have this already (spill_slot_decl, set_mem_attrs_for_spill), not sure why it doesn't look effective. Improving test coverage for desired transforms would be nice as well.=