From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 513753858D37; Tue, 19 Mar 2024 15:23:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 513753858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710861783; bh=ptObl2AJs4C7wAysJ8WcxtNAALCTjsMULtPiVB5j/Vc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ReXTzmtzJYIHanIspchB5YSl+YmuUCf/xs28tuK3HyuXsAAFEPrtrQ/4pXde0075C S3g/wBSeobdkt+QBYh9jpIoo4j6f+d9PJFxz4GropSI3hJkICKJ7wpk/PzZiiXExTv r3sMhVlKmhp2rEEUKeL9TumJtkRoODfRwArlLzMU= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba Date: Tue, 19 Mar 2024 15:23:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: testsuite X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: testsuite-fail, wrong-debug X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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=3D109596 --- Comment #3 from Jakub Jelinek --- Loooking at pr90716.c, that case seems like a clear wrong-debug. Before r14-162 j was everywhere, "j\0" DW_TAG_variable didn= 't have any DW_AT_location/DW_AT_const_value, optimized dump doesn't show any DEBUG stmts for j nor any references to it, etc. With r14-162 and later the DW_TAG_variable has DW_AT_const_value 0, which is wrong, if anything it should have DW_AT_const_value 8. Optimized dump difference is --- pr90716.c.254t.optimized_ 2024-03-19 10:23:03.688427714 -0400 +++ pr90716.c.254t.optimized 2024-03-19 10:23:39.351797960 -0400 @@ -18,19 +18,20 @@ void optimize_me_not () int main () { [local count: 17041817]: # DEBUG BEGIN_STMT # DEBUG BEGIN_STMT # DEBUG b =3D> 0 # DEBUG BEGIN_STMT # DEBUG b =3D> 0 # DEBUG BEGIN_STMT __builtin_memset (&a, 0, 224); - # DEBUG b =3D> NULL + # DEBUG j =3D> 0 + # DEBUG b =3D> 0 # DEBUG BEGIN_STMT optimize_me_not (); # DEBUG BEGIN_STMT return 0; } Clearly even the b value is wrong, that again should be either 8 or NULL af= ter the loops. Before ch2 pass, the IL is the same with r14-161 and r14-162: [local count: 17041817]: # DEBUG b =3D> 0 goto ; [100.00%] [local count: 954449105]: a[b_1][j_2] =3D 0; j_9 =3D j_2 + 1; # DEBUG j =3D> j_9 [local count: 1073741824]: # j_2 =3D PHI <0(8), j_9(3)> # DEBUG j =3D> j_2 if (j_2 !=3D 8) goto ; [88.89%] else goto ; [11.11%] [local count: 119292720]: b_7 =3D b_1 + 1; # DEBUG b =3D> b_7 [local count: 136334537]: # b_1 =3D PHI <0(2), b_7(5)> # DEBUG b =3D> b_1 if (b_1 !=3D 7) goto ; [87.50%] else goto ; [12.50%] [local count: 119292720]: goto ; [100.00%] [local count: 17041817]: optimize_me_not (); return 0; but ch2 changes the IL (r14-161 vs. r14-162):=20 --- pr90716.c.126t.ch2_ 2024-03-19 11:20:14.311013575 -0400 +++ pr90716.c.126t.ch2 2024-03-19 11:20:18.879061929 -0400 @@ -72,44 +72,44 @@ Removing basic block 12 int main () { int j; int b; [local count: 17041817]: # DEBUG b =3D> 0 # DEBUG b =3D> 0 goto ; [100.00%] [local count: 954449105]: # j_15 =3D PHI - # DEBUG j =3D> j_15 a[b_14][j_15] =3D 0; j_9 =3D j_15 + 1; # DEBUG j =3D> j_9 # DEBUG j =3D> j_9 if (j_9 !=3D 8) goto ; [88.89%] else goto ; [11.11%] [local count: 119292720]: + # DEBUG j =3D> 0 b_7 =3D b_14 + 1; # DEBUG b =3D> b_7 # DEBUG b =3D> b_7 if (b_7 !=3D 7) goto ; [87.50%] else goto ; [12.50%] [local count: 119292720]: # b_14 =3D PHI - # DEBUG b =3D> b_14 # DEBUG j =3D> 0 goto ; [100.00%] [local count: 17041817]: + # DEBUG b =3D> 0 optimize_me_not (); return 0; } The changes in r14-162 feel highly undesirable for debug info.=