From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 357B138293C9; Fri, 10 Jun 2022 12:14:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 357B138293C9 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/105917] New: Missed passthru jump function Date: Fri, 10 Jun 2022 12:14:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: 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: Fri, 10 Jun 2022 12:14:50 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105917 Bug ID: 105917 Summary: Missed passthru jump function Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: hubicka at gcc dot gnu.org CC: marxin at gcc dot gnu.org Target Milestone: --- In this testcase: struct a {int a;}; struct b {int b; struct a a;}; __attribute__ ((noinline)) static int reta (struct a a) { return a.a; } __attribute__ ((noinline)) static int=20 retba (struct b b) { struct a *a =3D &b.a; return reta(*a); } int main() { struct b b =3D {1, {0}}; return retba (b); } There is aggregat passthru from retba to reta but we get: _2 =3D reta (MEM[(struct a *)&b + 4B]); Analyzing function: retba/1 function retba/1 parameter descriptors: param #0 b used undescribed_use Jump functions of caller retba/1: callsite retba/1 -> reta/0 : param 0: UNKNOWN Unknown bits Unknown VR I constructed this to check dubious check for MEM_REF requiring offset to b= e 0. However surprisingly we miss the following too: struct a {int a;}; struct b {int b; struct a a;}; __attribute__ ((noinline)) static int reta (struct a a) { return a.a; } __attribute__ ((noinline)) static int=20 retba (struct b b) { //struct a *a =3D &b.a; //return reta(*a); return reta (b.a); } int main() { struct b b =3D {1, {0}}; return retba (b); } Jump functions of caller retba/1: callsite retba/1 -> reta/0 : param 0: UNKNOWN Unknown bits Unknown VR I wonder which cases actually works :)=