From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1CEFA388B69F; Fri, 17 Feb 2023 13:57:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1CEFA388B69F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676642248; bh=TpxaFfsbg31dmhCyJS9anc4YzgZ8ZLk7v65lsY1oaq0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=feFJLLF9bpyN9Og7MxlJHydcgR88wOKRwbrn2Azjx5b7C6lIRJjasC+0mpnnLlqj9 gT/TKx8CRuIUJpuHnJgWNMvGLtjdyr6vYogpuWtveQhaYFSt7acLjUjBZYHRzfHvJU GYspUBXyyBUWaDVjpDuM/9OLznNd5f1kEiXfcKjg= From: "jamborm 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: Fri, 17 Feb 2023 13:57:27 +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: jamborm 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: 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 --- Comment #2 from Martin Jambor --- (In reply to Richard Biener from comment #1) >=20 > so somehow the restrict qualification pessimizes IPA-CP?! Martin? >=20 Well, funny thing. Without restrict, IPA-CP sees (from release_ssa dump): void Func3 (char * p1, int * p2) { [local count: 1073741824]: *p1_3(D) =3D 123; *p2_2(D) =3D 1; Func1 (p1_3(D), p2_2(D)); return; } But with restrict in Func2 parameters, Func3 becomes: void Func3 (char * p1, int * p2) { [local count: 1073741824]: *p2_2(D) =3D 1; *p1_4(D) =3D 123; Func1 (p1_4(D), p2_2(D)); return; } And the different ordering of the two stores is the problem, even when p1 is not a char pointer, because we dont't trust the types of the actual/formal parameters for TBAA (we would need to know in what types they are read in Func1).=