public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-109596-4-7PAxn9u700@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109596-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109596

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Loooking at pr90716.c, that case seems like a clear wrong-debug.
Before r14-162 j was <optimized out> 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 ()
 {
   <bb 2> [local count: 17041817]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG b => 0
   # DEBUG BEGIN_STMT
   # DEBUG b => 0
   # DEBUG BEGIN_STMT
   __builtin_memset (&a, 0, 224);
-  # DEBUG b => NULL
+  # DEBUG j => 0
+  # DEBUG b => 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 after
the loops.
Before ch2 pass, the IL is the same with r14-161 and r14-162:
  <bb 2> [local count: 17041817]:
  # DEBUG b => 0
  goto <bb 6>; [100.00%]

  <bb 3> [local count: 954449105]:
  a[b_1][j_2] = 0;
  j_9 = j_2 + 1;
  # DEBUG j => j_9

  <bb 4> [local count: 1073741824]:
  # j_2 = PHI <0(8), j_9(3)>
  # DEBUG j => j_2
  if (j_2 != 8)
    goto <bb 3>; [88.89%]
  else
    goto <bb 5>; [11.11%]

  <bb 5> [local count: 119292720]:
  b_7 = b_1 + 1;
  # DEBUG b => b_7

  <bb 6> [local count: 136334537]:
  # b_1 = PHI <0(2), b_7(5)>
  # DEBUG b => b_1
  if (b_1 != 7)
    goto <bb 8>; [87.50%]
  else
    goto <bb 7>; [12.50%]

  <bb 8> [local count: 119292720]:
  goto <bb 4>; [100.00%]

  <bb 7> [local count: 17041817]:
  optimize_me_not ();
  return 0;
but ch2 changes the IL (r14-161 vs. r14-162): 
--- 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;

   <bb 2> [local count: 17041817]:
   # DEBUG b => 0
   # DEBUG b => 0
   goto <bb 5>; [100.00%]

   <bb 3> [local count: 954449105]:
   # j_15 = PHI <j_9(3), 0(5)>
-  # DEBUG j => j_15
   a[b_14][j_15] = 0;
   j_9 = j_15 + 1;
   # DEBUG j => j_9
   # DEBUG j => j_9
   if (j_9 != 8)
     goto <bb 3>; [88.89%]
   else
     goto <bb 4>; [11.11%]

   <bb 4> [local count: 119292720]:
+  # DEBUG j => 0
   b_7 = b_14 + 1;
   # DEBUG b => b_7
   # DEBUG b => b_7
   if (b_7 != 7)
     goto <bb 5>; [87.50%]
   else
     goto <bb 6>; [12.50%]

   <bb 5> [local count: 119292720]:
   # b_14 = PHI <b_7(4), 0(2)>
-  # DEBUG b => b_14
   # DEBUG j => 0
   goto <bb 3>; [100.00%]

   <bb 6> [local count: 17041817]:
+  # DEBUG b => 0
   optimize_me_not ();
   return 0;

 }
The changes in r14-162 feel highly undesirable for debug info.

  parent reply	other threads:[~2024-03-19 15:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases " haochen.jiang at intel dot com
2023-04-24  7:06 ` [Bug testsuite/109596] " rguenth at gcc dot gnu.org
2024-01-12 10:58 ` [Bug testsuite/109596] [14 Regression] Lots of guality testcase " rguenth at gcc dot gnu.org
2024-03-19 14:14 ` jakub at gcc dot gnu.org
2024-03-19 15:23 ` jakub at gcc dot gnu.org [this message]
2024-03-19 15:27 ` hubicka at gcc dot gnu.org
2024-03-19 15:41 ` jakub at gcc dot gnu.org
2024-03-19 15:47 ` hubicka at gcc dot gnu.org
2024-03-19 15:58 ` hubicka at gcc dot gnu.org
2024-03-19 16:28 ` jakub at gcc dot gnu.org
2024-03-19 22:28 ` jakub at gcc dot gnu.org
2024-03-20 11:50 ` jakub at gcc dot gnu.org
2024-04-10  7:13 ` rguenth at gcc dot gnu.org
2024-04-11  6:53 ` rguenth at gcc dot gnu.org
2024-04-11  9:11 ` cvs-commit at gcc dot gnu.org
2024-04-11  9:12 ` rguenth at gcc dot gnu.org
2024-04-12 18:14 ` carlos.seo at linaro dot org
2024-04-12 18:18 ` pinskia at gcc dot gnu.org
2024-04-12 18:24 ` carlos.seo at linaro dot org
2024-04-13 11:36 ` haochen.jiang at intel dot com
2024-04-15 18:53 ` hubicka at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-109596-4-7PAxn9u700@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).