public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba
@ 2023-04-23  1:46 haochen.jiang at intel dot com
  2023-04-24  7:06 ` [Bug testsuite/109596] " rguenth at gcc dot gnu.org
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: haochen.jiang at intel dot com @ 2023-04-23  1:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109596
           Summary: [14 Regression] Lots of testcases fails on x86_64
                    after r14-162-gcda246f8b421ba
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haochen.jiang at intel dot com
  Target Milestone: ---

Currently, we can see all the following testcases fail on x86_64:

https://gcc.gnu.org/pipermail/gcc-regression/2023-April/077654.html

From my bisect script, I can confirm that at least for pr90074 and pr90716,
fail is casued by commit r14-162-gcda246f8b421ba.

It seems that we might need to modify those testcases.

Reproduce by:

make check RUNTESTFLAGS="guality.exp=gcc.dg/guality/pr90716.c
--target_board='unix{-m64\ -march=cascadelake,-m32\
-march=cascadelake,-m32,-m64}'"

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
@ 2023-04-24  7:06 ` 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
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-24  7:06 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba 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 ` rguenth at gcc dot gnu.org
  2024-03-19 14:14 ` jakub at gcc dot gnu.org
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-01-12 10:58 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-01-12
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |testsuite-fail
           Priority|P3                          |P1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
13 branch vs trunk gcc.dg/guality on x86_64 with gdb 12.1 is

# of expected passes            4768
# of unexpected failures        93
# of unexpected successes       20
# of expected failures          79
# of unsupported tests          143

vs

# of expected passes            4728
# of unexpected failures        111
# of unexpected successes       19
# of expected failures          80
# of unsupported tests          165

-XPASS: gcc.dg/guality/example.c   -O1  -DPREVENT_OPTIMIZATION  execution test
+FAIL: gcc.dg/guality/ipa-sra-1.c   -O2  -DPREVENT_OPTIMIZATION  line 27 k == 3
+FAIL: gcc.dg/guality/ipa-sra-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 27 k
== 3
+FAIL: gcc.dg/guality/ipa-sra-1.c   -Os  -DPREVENT_OPTIMIZATION  line 27 k == 3
 XPASS: gcc.dg/guality/ipa-sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 15 k == 3
+FAIL: gcc.dg/guality/ipa-sra-1.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 27 k == 3
+FAIL: gcc.dg/guality/ipa-sra-1.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 27 k == 3
-FAIL: gcc.dg/guality/pr41616-1.c   -O2  -DPREVENT_OPTIMIZATION  execution test
-FAIL: gcc.dg/guality/pr41616-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution
test
-FAIL: gcc.dg/guality/pr41616-1.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
-FAIL: gcc.dg/guality/pr43051-1.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 34 c ==
&a[0]
-FAIL: gcc.dg/guality/pr43051-1.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 39 c ==
&a[0]
+FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 34 c ==
&a[0]
+FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 39 c ==
&a[0]
-FAIL: gcc.dg/guality/pr54693-2.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 x == 10 - i
-FAIL: gcc.dg/guality/pr54693-2.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 y == 20 - 2 * i
-FAIL: gcc.dg/guality/pr54693-2.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 z == 30 - 3 * i
+FAIL: gcc.dg/guality/pr54693-2.c   -O1  -DPREVENT_OPTIMIZATION  line 21 i == v
+ 1
+FAIL: gcc.dg/guality/pr54693-2.c   -O2  -DPREVENT_OPTIMIZATION  line 21 i == v
+ 1
+FAIL: gcc.dg/guality/pr54693-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 21 i
== v + 1
+FAIL: gcc.dg/guality/pr54693-2.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 21 i == v + 1
+FAIL: gcc.dg/guality/pr54693.c   -O1  -DPREVENT_OPTIMIZATION  line 22 i == c -
48
+FAIL: gcc.dg/guality/pr54693.c   -O2  -DPREVENT_OPTIMIZATION  line 22 i == c -
48
+FAIL: gcc.dg/guality/pr54693.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 22 i ==
c - 48
+FAIL: gcc.dg/guality/pr54693.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 22 i ==
c - 48
+FAIL: gcc.dg/guality/pr54693.c   -Os  -DPREVENT_OPTIMIZATION  line 22 i == c -
48
+FAIL: gcc.dg/guality/pr54693.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 22 i == c - 48
+FAIL: gcc.dg/guality/pr54693.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 22 i == c - 48
+FAIL: gcc.dg/guality/pr89463.c   -O1  -DPREVENT_OPTIMIZATION  line 23 i + 1 ==
7
+FAIL: gcc.dg/guality/pr90074.c   -O1  -DPREVENT_OPTIMIZATION  line 28 i + 1 ==
8
+FAIL: gcc.dg/guality/pr90074.c   -O1  -DPREVENT_OPTIMIZATION  line 28 c + 1 ==
2
+FAIL: gcc.dg/guality/pr90716.c   -O1  -DPREVENT_OPTIMIZATION  line 23 j + 1 ==
9
+FAIL: gcc.dg/guality/pr90716.c   -O2  -DPREVENT_OPTIMIZATION  line 23 j + 1 ==
9
+FAIL: gcc.dg/guality/pr90716.c   -Os  -DPREVENT_OPTIMIZATION  line 23 j + 1 ==
9
+FAIL: gcc.dg/guality/pr90716.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 23 j + 1 == 9
+FAIL: gcc.dg/guality/vla-1.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 sizeof (a) == 6

so confirmed some cases reported in this PR are still there.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba 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
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-03-19 14:14 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
ipa-sra-1.c has been adjusted since in r14-8997
Comparing current trunk vs. current 13 branch, I see in guality:
-XPASS: gcc.dg/guality/example.c   -O1  -DPREVENT_OPTIMIZATION  execution test
-XPASS: gcc.dg/guality/ipa-sra-1.c   -O0  line 15 k == 3
-XPASS: gcc.dg/guality/ipa-sra-1.c   -O1  -DPREVENT_OPTIMIZATION  line 15 k ==
3
-XPASS: gcc.dg/guality/ipa-sra-1.c  -Og -DPREVENT_OPTIMIZATION  line 15 k == 3
-FAIL: gcc.dg/guality/pr41616-1.c   -O2  -DPREVENT_OPTIMIZATION  execution test
-FAIL: gcc.dg/guality/pr41616-1.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION execution test
-FAIL: gcc.dg/guality/pr41616-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  execution
test
-FAIL: gcc.dg/guality/pr43051-1.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 34 c ==
&a[0]
-FAIL: gcc.dg/guality/pr43051-1.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 39 c ==
&a[0]
+FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 34 c ==
&a[0]
+FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 39 c ==
&a[0]
-FAIL: gcc.dg/guality/pr54693-2.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 x == 10 - i
-FAIL: gcc.dg/guality/pr54693-2.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 y == 20 - 2 * i
-FAIL: gcc.dg/guality/pr54693-2.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 z == 30 - 3 * i
+FAIL: gcc.dg/guality/pr54693-2.c   -O1  -DPREVENT_OPTIMIZATION  line 21 i == v
+ 1
+FAIL: gcc.dg/guality/pr54693-2.c   -O2  -DPREVENT_OPTIMIZATION  line 21 i == v
+ 1
+FAIL: gcc.dg/guality/pr54693-2.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 21 i == v + 1
+FAIL: gcc.dg/guality/pr54693-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 21 i
== v + 1
+FAIL: gcc.dg/guality/pr54693.c   -O1  -DPREVENT_OPTIMIZATION  line 22 i == c -
48
+FAIL: gcc.dg/guality/pr54693.c   -O2  -DPREVENT_OPTIMIZATION  line 22 i == c -
48
+FAIL: gcc.dg/guality/pr54693.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 22 i == c - 48
+FAIL: gcc.dg/guality/pr54693.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 22 i == c - 48
+FAIL: gcc.dg/guality/pr54693.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 22 i ==
c - 48
+FAIL: gcc.dg/guality/pr54693.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 22 i ==
c - 48
+FAIL: gcc.dg/guality/pr54693.c   -Os  -DPREVENT_OPTIMIZATION  line 22 i == c -
48
+FAIL: gcc.dg/guality/pr89463.c   -O1  -DPREVENT_OPTIMIZATION  line 23 i + 1 ==
7
+FAIL: gcc.dg/guality/pr90074.c   -O1  -DPREVENT_OPTIMIZATION  line 28 c + 1 ==
2
+FAIL: gcc.dg/guality/pr90074.c   -O1  -DPREVENT_OPTIMIZATION  line 28 i + 1 ==
8
+FAIL: gcc.dg/guality/pr90716.c   -O1  -DPREVENT_OPTIMIZATION  line 23 j + 1 ==
9
+FAIL: gcc.dg/guality/pr90716.c   -O2  -DPREVENT_OPTIMIZATION  line 23 j + 1 ==
9
+FAIL: gcc.dg/guality/pr90716.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 23 j + 1 == 9
+FAIL: gcc.dg/guality/pr90716.c   -Os  -DPREVENT_OPTIMIZATION  line 23 j + 1 ==
9
+FAIL: gcc.dg/guality/vla-1.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 sizeof (a) == 6
where ipa-sra-1.c changes are because r14-8997 intentionally tweaked the
expectations for -O0/-O1/-Og.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (2 preceding siblings ...)
  2024-03-19 14:14 ` jakub at gcc dot gnu.org
@ 2024-03-19 15:23 ` jakub at gcc dot gnu.org
  2024-03-19 15:27 ` hubicka at gcc dot gnu.org
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-03-19 15:23 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (3 preceding siblings ...)
  2024-03-19 15:23 ` jakub at gcc dot gnu.org
@ 2024-03-19 15:27 ` hubicka at gcc dot gnu.org
  2024-03-19 15:41 ` jakub at gcc dot gnu.org
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: hubicka at gcc dot gnu.org @ 2024-03-19 15:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
The change makes loop iteration estimates more realistics, but does not
introduce any new code that actually changes the IL, so it seems this makes
existing problem more visible.  I will try to debug what happens.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (4 preceding siblings ...)
  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
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-03-19 15:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #4)
> The change makes loop iteration estimates more realistics, but does not
> introduce any new code that actually changes the IL, so it seems this makes
> existing problem more visible.  I will try to debug what happens.

Yeah, I didn't see any debug info handling in that commit, so wouldn't surprise
me if it was something latent before, or something where ch now needs to do a
better job.
All I can see from the dumps is that before ch2 the debug stmt placements were
reasonable both for b and j, b 0 at the very start and after SSA_NAME def stmts
which update it to a new value for the var (e.g. after PHI at the start of loop
body,
or after increasing the IV).
Before r14-162 ch2 used to do weird stuff with them - duplicating
  # DEBUG b => 0
  # DEBUG b => 0
at the start, after ++j:
  # DEBUG j => j_9
  # DEBUG j => j_9
after ++b:
  # DEBUG b => b_7
  # DEBUG b => b_7
and (the perhaps only reasonable change adding
  # DEBUG j => 0
after the b PHI, though not really necessary as it has unconditional goto to
the header with PHI after which it is set to something else).
But, newly ch2 in addition to the useless duplicate of b => 0, j => j_9 and b
=> b_7
removes the most important debug stmts (
  # DEBUG j => j_2
and
  # DEBUG b => b_1
after the PHIs) and adds wrong-debug debug stmts elsewhere - the
  # DEBUG j => 0
and
  # DEBUG b => 0
in random incorrect places.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (5 preceding siblings ...)
  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
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: hubicka at gcc dot gnu.org @ 2024-03-19 15:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
On this testcase trunk does get same dump as gcc13 for pass just before ch2

with ch2 we get:
@@ -192,9 +236,8 @@
   # DEBUG BEGIN_STMT
   goto <bb 5>; [100.00%]

-  <bb 3> [local count: 954449105]:
+  <bb 3> [local count: 954449104]:
   # j_15 = PHI <j_9(3), 0(5)>
-  # DEBUG j => j_15
   # DEBUG BEGIN_STMT
   a[b_14][j_15] = 0;
   # DEBUG BEGIN_STMT
@@ -203,29 +246,30 @@
   # DEBUG j => j_9
   # DEBUG BEGIN_STMT
   if (j_9 <= 7)
-    goto <bb 3>; [88.89%]
+    goto <bb 3>; [87.50%]
   else
-    goto <bb 4>; [11.11%]
+    goto <bb 4>; [12.50%]

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

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

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


So in addition to updating BB profile, we indeed end up moving debug statements
around.

The change of dump is:
+  Analyzing: if (b_1 <= 6)
+    Will eliminate peeled conditional in bb 6.
+    May duplicate bb 6
+  Not duplicating bb 8: it is single succ.
+  Analyzing: if (j_2 <= 7)
+    Will eliminate peeled conditional in bb 4.
+    May duplicate bb 4
+  Not duplicating bb 3: it is single succ.
 Loop 2 is not do-while loop: latch is not empty.
+    Duplicating header BB to obtain do-while loop
 Copying headers of loop 1
     Will duplicate bb 6
-  Not duplicating bb 8: it is single succ.
-Duplicating header of the loop 1 up to edge 6->8, 2 insns.
+Duplicating header of the loop 1 up to edge 6->7
 Loop 1 is do-while loop
 Loop 1 is now do-while loop.
+Exit count: 17041817 (estimated locally)
+Entry count: 17041817 (estimated locally)
+Peeled all exits: decreased number of iterations of loop 1 by 1.
 Copying headers of loop 2
     Will duplicate bb 4
-  Not duplicating bb 3: it is single succ.
-Duplicating header of the loop 2 up to edge 4->3, 2 insns.
+Duplicating header of the loop 2 up to edge 4->5
 Loop 2 is do-while loop
 Loop 2 is now do-while loop.
+Exit count: 119292720 (estimated locally)
+Entry count: 119292720 (estimated locally)
+Peeled all exits: decreased number of iterations of loop 2 by 1.

Dumps moved around, but we do same duplicaitons as before (BB6 and BB4 to
eliminate the conditionals).

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

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (6 preceding siblings ...)
  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
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: hubicka at gcc dot gnu.org @ 2024-03-19 15:58 UTC (permalink / raw)
  To: gcc-bugs

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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |hubicka at gcc dot gnu.org

--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Found it, probably. I renamed exit to nonexit (since name was misleading) and
then forgot to update
     propagate_threaded_block_debug_into (exit->dest, entry->dest);

I will check this after teaching (which I have in 10 mins)

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (7 preceding siblings ...)
  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
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-03-19 16:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Great,
--- gcc/tree-ssa-loop-ch.cc.jj  2024-03-19 16:27:35.969474787 +0100
+++ gcc/tree-ssa-loop-ch.cc     2024-03-19 17:12:57.904712489 +0100
@@ -957,7 +957,7 @@ ch_base::copy_headers (function *fun)

       edge entry = loop_preheader_edge (loop);

-      propagate_threaded_block_debug_into (exit->dest, entry->dest);
+      propagate_threaded_block_debug_into (nonexit->dest, entry->dest);
       if (!gimple_duplicate_seme_region (entry, exit, bbs, n_bbs, copied_bbs,
                                         true))
        {
looks very much promising:
-XFAIL: gcc.dg/guality/example.c   -O1  -DPREVENT_OPTIMIZATION  execution test
+XPASS: gcc.dg/guality/example.c   -O1  -DPREVENT_OPTIMIZATION  execution test
-FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 34 c ==
&a[0]
+PASS: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 34 c ==
&a[0]
-FAIL: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 39 c ==
&a[0]
+PASS: gcc.dg/guality/pr43051-1.c   -O1  -DPREVENT_OPTIMIZATION  line 39 c ==
&a[0]
-PASS: gcc.dg/guality/pr43051-1.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 34 c ==
&a[0]
+FAIL: gcc.dg/guality/pr43051-1.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 34 c ==
&a[0]
-PASS: gcc.dg/guality/pr43051-1.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 39 c ==
&a[0]
+FAIL: gcc.dg/guality/pr43051-1.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 39 c ==
&a[0]
-FAIL: gcc.dg/guality/pr54693-2.c   -O1  -DPREVENT_OPTIMIZATION  line 21 i == v
+ 1
-UNSUPPORTED: gcc.dg/guality/pr54693-2.c   -O1  -DPREVENT_OPTIMIZATION  line 21
x == 10 - i
-UNSUPPORTED: gcc.dg/guality/pr54693-2.c   -O1  -DPREVENT_OPTIMIZATION  line 21
y == 20 - 2 * i
-UNSUPPORTED: gcc.dg/guality/pr54693-2.c   -O1  -DPREVENT_OPTIMIZATION  line 21
z == 30 - 3 * i
+PASS: gcc.dg/guality/pr54693-2.c   -O1  -DPREVENT_OPTIMIZATION  line 21 i == v
+ 1
+PASS: gcc.dg/guality/pr54693-2.c   -O1  -DPREVENT_OPTIMIZATION  line 21 x ==
10 - i
+PASS: gcc.dg/guality/pr54693-2.c   -O1  -DPREVENT_OPTIMIZATION  line 21 y ==
20 - 2 * i
+PASS: gcc.dg/guality/pr54693-2.c   -O1  -DPREVENT_OPTIMIZATION  line 21 z ==
30 - 3 * i
-FAIL: gcc.dg/guality/pr54693-2.c   -O2  -DPREVENT_OPTIMIZATION  line 21 i == v
+ 1
-UNSUPPORTED: gcc.dg/guality/pr54693-2.c   -O2  -DPREVENT_OPTIMIZATION  line 21
x == 10 - i
-UNSUPPORTED: gcc.dg/guality/pr54693-2.c   -O2  -DPREVENT_OPTIMIZATION  line 21
y == 20 - 2 * i
-UNSUPPORTED: gcc.dg/guality/pr54693-2.c   -O2  -DPREVENT_OPTIMIZATION  line 21
z == 30 - 3 * i
+PASS: gcc.dg/guality/pr54693-2.c   -O2  -DPREVENT_OPTIMIZATION  line 21 i == v
+ 1
+PASS: gcc.dg/guality/pr54693-2.c   -O2  -DPREVENT_OPTIMIZATION  line 21 x ==
10 - i
+PASS: gcc.dg/guality/pr54693-2.c   -O2  -DPREVENT_OPTIMIZATION  line 21 y ==
20 - 2 * i
+PASS: gcc.dg/guality/pr54693-2.c   -O2  -DPREVENT_OPTIMIZATION  line 21 z ==
30 - 3 * i
-FAIL: gcc.dg/guality/pr54693-2.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 21 i == v + 1
-UNSUPPORTED: gcc.dg/guality/pr54693-2.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 21 x == 10 - i
-UNSUPPORTED: gcc.dg/guality/pr54693-2.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 21 y == 20 - 2 * i
-UNSUPPORTED: gcc.dg/guality/pr54693-2.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 21 z == 30 - 3 * i
+PASS: gcc.dg/guality/pr54693-2.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 21 i == v + 1
+PASS: gcc.dg/guality/pr54693-2.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 21 x == 10 - i
+PASS: gcc.dg/guality/pr54693-2.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 21 y == 20 - 2 * i
+PASS: gcc.dg/guality/pr54693-2.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 21 z == 30 - 3 * i
-UNSUPPORTED: gcc.dg/guality/pr54693-2.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 x == 10 - i
-UNSUPPORTED: gcc.dg/guality/pr54693-2.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 y == 20 - 2 * i
-UNSUPPORTED: gcc.dg/guality/pr54693-2.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 z == 30 - 3 * i
+FAIL: gcc.dg/guality/pr54693-2.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 x == 10 - i
+FAIL: gcc.dg/guality/pr54693-2.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 y == 20 - 2 * i
+FAIL: gcc.dg/guality/pr54693-2.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 z == 30 - 3 * i
-FAIL: gcc.dg/guality/pr54693-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 21 i
== v + 1
-UNSUPPORTED: gcc.dg/guality/pr54693-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line
21 x == 10 - i
-UNSUPPORTED: gcc.dg/guality/pr54693-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line
21 y == 20 - 2 * i
-UNSUPPORTED: gcc.dg/guality/pr54693-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line
21 z == 30 - 3 * i
+PASS: gcc.dg/guality/pr54693-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 21 i
== v + 1
+PASS: gcc.dg/guality/pr54693-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 21 x
== 10 - i
+PASS: gcc.dg/guality/pr54693-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 21 y
== 20 - 2 * i
+PASS: gcc.dg/guality/pr54693-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 21 z
== 30 - 3 * i
-FAIL: gcc.dg/guality/pr54693.c   -O1  -DPREVENT_OPTIMIZATION  line 22 i == c -
48
+PASS: gcc.dg/guality/pr54693.c   -O1  -DPREVENT_OPTIMIZATION  line 22 i == c -
48
-FAIL: gcc.dg/guality/pr54693.c   -O2  -DPREVENT_OPTIMIZATION  line 22 i == c -
48
+PASS: gcc.dg/guality/pr54693.c   -O2  -DPREVENT_OPTIMIZATION  line 22 i == c -
48
-FAIL: gcc.dg/guality/pr54693.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 22 i == c - 48
+PASS: gcc.dg/guality/pr54693.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 22 i == c - 48
-FAIL: gcc.dg/guality/pr54693.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 22 i == c - 48
+PASS: gcc.dg/guality/pr54693.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 22 i == c - 48
-FAIL: gcc.dg/guality/pr54693.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 22 i ==
c - 48
+PASS: gcc.dg/guality/pr54693.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  -DPREVENT_OPTIMIZATION  line 22 i ==
c - 48
-FAIL: gcc.dg/guality/pr54693.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 22 i ==
c - 48
+PASS: gcc.dg/guality/pr54693.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 22 i ==
c - 48
-FAIL: gcc.dg/guality/pr54693.c   -Os  -DPREVENT_OPTIMIZATION  line 22 i == c -
48
+PASS: gcc.dg/guality/pr54693.c   -Os  -DPREVENT_OPTIMIZATION  line 22 i == c -
48
-FAIL: gcc.dg/guality/pr89463.c   -O1  -DPREVENT_OPTIMIZATION  line 23 i + 1 ==
7
+PASS: gcc.dg/guality/pr89463.c   -O1  -DPREVENT_OPTIMIZATION  line 23 i + 1 ==
7
-FAIL: gcc.dg/guality/pr90074.c   -O1  -DPREVENT_OPTIMIZATION  line 28 c + 1 ==
2
-FAIL: gcc.dg/guality/pr90074.c   -O1  -DPREVENT_OPTIMIZATION  line 28 i + 1 ==
8
+PASS: gcc.dg/guality/pr90074.c   -O1  -DPREVENT_OPTIMIZATION  line 28 c + 1 ==
2
+PASS: gcc.dg/guality/pr90074.c   -O1  -DPREVENT_OPTIMIZATION  line 28 i + 1 ==
8
-UNSUPPORTED: gcc.dg/guality/pr90131.c   -O1  -DPREVENT_OPTIMIZATION  line 31 i
+ 1 == 1
+PASS: gcc.dg/guality/pr90131.c   -O1  -DPREVENT_OPTIMIZATION  line 31 i + 1 ==
1
-FAIL: gcc.dg/guality/pr90716.c   -O1  -DPREVENT_OPTIMIZATION  line 23 j + 1 ==
9
+PASS: gcc.dg/guality/pr90716.c   -O1  -DPREVENT_OPTIMIZATION  line 23 j + 1 ==
9
-FAIL: gcc.dg/guality/pr90716.c   -O2  -DPREVENT_OPTIMIZATION  line 23 j + 1 ==
9
+UNSUPPORTED: gcc.dg/guality/pr90716.c   -O2  -DPREVENT_OPTIMIZATION  line 23 j
+ 1 == 9
-FAIL: gcc.dg/guality/pr90716.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 23 j + 1 == 9
+UNSUPPORTED: gcc.dg/guality/pr90716.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  -DPREVENT_OPTIMIZATION line 23 j + 1 == 9
-FAIL: gcc.dg/guality/pr90716.c   -Os  -DPREVENT_OPTIMIZATION  line 23 j + 1 ==
9
+UNSUPPORTED: gcc.dg/guality/pr90716.c   -Os  -DPREVENT_OPTIMIZATION  line 23 j
+ 1 == 9
so feels like it mostly gets back to the 13 results.

Guess for pr90716.c it would be nice (bet stage1 material) if ldist did better
job with
debug stmts when it replaces the whole loop with a function call try to figure
out the final value of the SSA_NAMEs used in the debug stmts.
It has before ldist:
  b_7 = b_14 + 1;
  # DEBUG b => b_7
  ivtmp_3 = ivtmp_1 - 1;
  if (ivtmp_3 != 0)
    goto <bb 7>; [85.71%]
  else
    goto <bb 6>; [14.29%]
where the 4->6 edge is the loop exit one, and similarly
  j_9 = j_15 + 1;
  # DEBUG j => j_9
  # DEBUG BEGIN_STMT
  ivtmp_4 = ivtmp_13 - 1;
  if (ivtmp_4 != 0)
    goto <bb 8>; [87.50%]
  else
    goto <bb 4>; [12.50%]
before this bb, and ldist clearly needs to figure out how many iterations the
loop has,
so if it added
  # DEBUG j => 8
  # DEBUG b => 7
to start of bb 6 when it kills the loop, that would be great.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (8 preceding siblings ...)
  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
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-03-19 22:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
BTW, just curious, r14-162 had:
       /* Ensure that the header will have just the latch as a predecessor
         inside the loop.  */
-      if (!single_pred_p (exit->dest))
+      if (!single_pred_p (nonexit->dest))
        {
-         header = split_edge (exit);
+         header = split_edge (nonexit);
          exit = single_pred_edge (header);
        }
chunk, shouldn't that be nonexit = single_pred_edge (header); or is that line
correct?

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (9 preceding siblings ...)
  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
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-03-20 11:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #9)
> BTW, just curious, r14-162 had:
>        /* Ensure that the header will have just the latch as a predecessor
>          inside the loop.  */
> -      if (!single_pred_p (exit->dest))
> +      if (!single_pred_p (nonexit->dest))
>         {
> -         header = split_edge (exit);
> +         header = split_edge (nonexit);
>           exit = single_pred_edge (header);
>         }
> chunk, shouldn't that be nonexit = single_pred_edge (header); or is that
> line correct?

Regarding that, e.g. gcc.c-torture/compile/pr70199.c testcase at -O1 -g shows
both cases, once where single_pred_p (nonexit->dest) and once where
!single_pred_p (nonexit->dest) and we split the nonexit edge.
Or the !single_pred_p case is also in c-c++-common/gomp/pr59917-2.c,
gcc.dg/torture/pr83685.c.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (10 preceding siblings ...)
  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
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-04-10  7:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
Honza - any progress here?

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (11 preceding siblings ...)
  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
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-04-11  6:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm re-testing the patch in comment#8 and will push it.  Please check the
possible issue mentioned in comment#9.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (12 preceding siblings ...)
  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
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-11  9:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:c7e8a8d814229fd6fc4c16c2452f15dddc613479

commit r14-9912-gc7e8a8d814229fd6fc4c16c2452f15dddc613479
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Apr 11 11:08:07 2024 +0200

    tree-optimization/109596 - wrong debug stmt move by copyheader

    The following fixes an omission in r14-162-gcda246f8b421ba causing
    wrong-debug and a bunch of guality regressions.

            PR tree-optimization/109596
            * tree-ssa-loop-ch.cc (ch_base::copy_headers): Propagate
            debug stmts to nonexit->dest rather than exit->dest.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (13 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-04-11  9:12 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> ---
The guality FAILs have been fixed now.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (14 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: carlos.seo at linaro dot org @ 2024-04-12 18:14 UTC (permalink / raw)
  To: gcc-bugs

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

Carlos Eduardo Seo <carlos.seo at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlos.seo at linaro dot org

--- Comment #15 from Carlos Eduardo Seo <carlos.seo at linaro dot org> ---
I see some failures after this patch on aarch64-linux-gnu:

FAIL: gcc.dg/guality/pr54693-2.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 x == 10 - i
FAIL: gcc.dg/guality/pr54693-2.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 y == 20 - 2 * i
FAIL: gcc.dg/guality/pr54693-2.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 z == 30 - 3 * i

Could you please take a look?

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (15 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-12 18:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Carlos Eduardo Seo from comment #15)
> I see some failures after this patch on aarch64-linux-gnu:
> 
> FAIL: gcc.dg/guality/pr54693-2.c -O2 -flto -fuse-linker-plugin
> -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 x == 10 - i
> FAIL: gcc.dg/guality/pr54693-2.c -O2 -flto -fuse-linker-plugin
> -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 y == 20 - 2 * i
> FAIL: gcc.dg/guality/pr54693-2.c -O2 -flto -fuse-linker-plugin
> -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 z == 30 - 3 * i
> 
> Could you please take a look?

I suspect it is similar to what was already discussed here: 

https://gcc.gnu.org/pipermail/gcc-patches/2024-April/649347.html

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (16 preceding siblings ...)
  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
  19 siblings, 0 replies; 21+ messages in thread
From: carlos.seo at linaro dot org @ 2024-04-12 18:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from Carlos Eduardo Seo <carlos.seo at linaro dot org> ---
Noted. Thanks!

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (17 preceding siblings ...)
  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
  19 siblings, 0 replies; 21+ messages in thread
From: haochen.jiang at intel dot com @ 2024-04-13 11:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from Haochen Jiang <haochen.jiang at intel dot com> ---
(In reply to Andrew Pinski from comment #16)
> (In reply to Carlos Eduardo Seo from comment #15)
> > I see some failures after this patch on aarch64-linux-gnu:
> > 
> > FAIL: gcc.dg/guality/pr54693-2.c -O2 -flto -fuse-linker-plugin
> > -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 x == 10 - i
> > FAIL: gcc.dg/guality/pr54693-2.c -O2 -flto -fuse-linker-plugin
> > -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 y == 20 - 2 * i
> > FAIL: gcc.dg/guality/pr54693-2.c -O2 -flto -fuse-linker-plugin
> > -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 21 z == 30 - 3 * i
> > 
> > Could you please take a look?
> 
> I suspect it is similar to what was already discussed here: 
> 
> https://gcc.gnu.org/pipermail/gcc-patches/2024-April/649347.html

Yes. As Richard said, the FAIL are exactly the same before Honza's patch, I
suppose expected.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug testsuite/109596] [14 Regression] Lots of guality testcase fails on x86_64 after r14-162-gcda246f8b421ba
  2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba haochen.jiang at intel dot com
                   ` (18 preceding siblings ...)
  2024-04-13 11:36 ` haochen.jiang at intel dot com
@ 2024-04-15 18:53 ` hubicka at gcc dot gnu.org
  19 siblings, 0 replies; 21+ messages in thread
From: hubicka at gcc dot gnu.org @ 2024-04-15 18:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
I looked into the remaining exit/nonexit rename discussed here earlier before
the PR was closed. The following patch would restore the code to do the same
calls as before my patch
        PR tree-optimization/109596
        * tree-ssa-loop-ch.c (ch_base::copy_headers): Fix use of exit/nonexit
edges.
diff --git a/gcc/tree-ssa-loop-ch.cc b/gcc/tree-ssa-loop-ch.cc
index b7ef485c4cc..cd5f6bc3c2a 100644
--- a/gcc/tree-ssa-loop-ch.cc
+++ b/gcc/tree-ssa-loop-ch.cc
@@ -952,13 +952,13 @@ ch_base::copy_headers (function *fun)
       if (!single_pred_p (nonexit->dest))
        {
          header = split_edge (nonexit);
-         exit = single_pred_edge (header);
+         nonexit = single_pred_edge (header);
        }

       edge entry = loop_preheader_edge (loop);

       propagate_threaded_block_debug_into (nonexit->dest, entry->dest);
-      if (!gimple_duplicate_seme_region (entry, exit, bbs, n_bbs, copied_bbs,
+      if (!gimple_duplicate_seme_region (entry, nonexit, bbs, n_bbs,
copied_bbs,
                                         true))
        {
          delete candidate.static_exits;

I however convinced myself this is an noop. both exit and nonexit sources have
same basic blocks.  

propagate_threaded_block_debug_into walks predecessors of its first parameter
and moves debug statements to the second parameter, so it does the same job,
since the split BB is empty.

gimple_duplicate_seme_region uses the parametr to update loop header but it
does not do that correctly for loop header copying and we re-do it in
tree-ssa-loop-ch.

Still the code as it is now in trunk is very confusing, so perhaps we should
update it?

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2024-04-15 18:53 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-23  1:46 [Bug testsuite/109596] New: [14 Regression] Lots of testcases fails on x86_64 after r14-162-gcda246f8b421ba 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
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

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).