From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7217E386F810; Thu, 20 Aug 2020 13:59:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7217E386F810 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597931965; bh=onhxo2KKih3Go+Hh1BNh7EZC8B6EXDvSn/vsON8/Tt4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NFoe7uTzM+bFZmB8ELf+5p5/1fBya6DwIlXzn0srWrjH1p7Sck6kQR9Aj9N4ldc5J nCnEy2RLjhrrso8HhCbp9zcKsIZhnqjhTOufFBTIbyny2iJlfCfsv2Y+gHWKdYXqDX 0fMdG2HzarOnO2W2699Z2aPtO2vd9vahBjVUnh3s= From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/96722] [8/9/10/11 Regression] Clobbers on NULL since r8-1519 Date: Thu, 20 Aug 2020 13:59:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin 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: 8.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to bug_status 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: Thu, 20 Aug 2020 13:59:25 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96722 Martin Li=C5=A1ka changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|marxin at gcc dot gnu.org |unassigned at gcc d= ot gnu.org Status|ASSIGNED |NEW --- Comment #2 from Martin Li=C5=A1ka --- So the problematic transformation happens in einline: BEFORE: void foo(S*) (struct S * a) { [0.00%] [count: INV]: if (a_2(D) !=3D 0B) goto ; [0.00%] [count: INV] else goto ; [0.00%] [count: INV] [100.00%] [count: INV]: MEM[(struct &)a_2(D)] =3D{v} {CLOBBER}; [0.00%] [count: INV]: return; } after: void foo(S*) (struct S * a) { [0.00%] [count: INV]: if (a_2(D) !=3D 0B) goto ; [0.00%] [count: INV] else goto ; [0.00%] [count: INV] [0.00%] [count: INV]: // predicted unlikely by early return (on trees) predictor. goto ; [0.00%] [count: INV] [100.00%] [count: INV]: MEM[(struct &)a_2(D)] =3D{v} {CLOBBER}; [0.00%] [count: INV]: return; } So as seen, the CFG is more complex as there's an extra GIMPLE_PREDICT. main then inlines to: Scope blocks after cleanups: { Scope block #0=20 { Scope block #7 ../pr96722.C:8 Originating from : extern void S (struct= S *, int);=20 } { Scope block #8 ../pr96722.C:14 Originating from : extern void S (struc= t S *, int);=20 } } int main() () { int _5; [100.00%] [count: INV]: _5 =3D 0; return _5; } No longer having address taken: s Scope blocks after cleanups: { Scope block #0=20 { Scope block #7 ../pr96722.C:8 Originating from : extern void S (struct= S *, int);=20 { Scope block #8 Originating from :#0=20 } } { Scope block #9 ../pr96722.C:14 Originating from : extern void S (struc= t S *, int);=20 } } int main() () { int _5; [100.00%] [count: INV]: MEM[(struct &)0B] =3D{v} {CLOBBER}; _5 =3D 0; return _5; } So I bet it's hidden in a CFG cleanup where it somehow removes the clobber? I guess it was latent before my revision..=