From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4B0C73858D20; Mon, 9 Jan 2023 13:54:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B0C73858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673272469; bh=u7BLh2XsrksaB5IFd/Jsb9C3xTHFZOwKqiTQU+j9kYQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LQlALlr66++Ljkx6eFjUwEWgerji8LCbbdX5f6k0yUdVvwIa3I2tK2Yp+6kTj2pYN pFFFUdJtpKgACktv0iXQLCgPJTQY2lcO3vn5TuvP75IwK/N3kg4EAXCKh2mQCX1RhO jTKb53XkshaXuSJ02uz3erilX+htRJUqdmF5DH60= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/108226] __restrict on inlined function parameters does not function as expected Date: Mon, 09 Jan 2023 13:54:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: alias, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cc everconfirmed bug_status component 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108226 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jamborm at gcc dot gnu.org Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Component|tree-optimization |ipa Last reconfirmed| |2023-01-09 --- Comment #1 from Richard Biener --- For the first case it's the order of inlining - we first inline Func2 into Func3 early and only then inline Func1 at IPA time which fails to put the F= unc1 accesses under __restrict. For the second case it's with __restrict: > ./cc1 -quiet t.c -O2 -fopt-info -fdump-tree-all t.c:27:3: optimized: Inlining Func2/2 into Func3/3. t.c:22:3: optimized: Inlined Func1.isra/5 into Func3/3 which now has time 12.500000 and size 21, net change of -7. vs without > ./cc1 -quiet t.c -O2 -fopt-info -fdump-tree-all t.c:27:3: optimized: Inlining Func2/2 into Func3/3. t.c:22:3: optimized: Inlined Func1.constprop.isra/6 into Func3/3 which now= has time 4.375000 and size 7, net change of -21. so somehow the restrict qualification pessimizes IPA-CP?! Martin? Note with restrict it's again the first issue. -fno-early-inlining helps there.=