public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/103264] New: [12 regression] gcc.dg/tree-prof/merge_block.c fails after r12-5236
@ 2021-11-15 18:43 seurer at gcc dot gnu.org
  2021-11-15 21:04 ` [Bug testsuite/103264] " hubicka at kam dot mff.cuni.cz
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: seurer at gcc dot gnu.org @ 2021-11-15 18:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103264
           Summary: [12 regression] gcc.dg/tree-prof/merge_block.c fails
                    after r12-5236
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

Tried g:5aa91072e24c1e16a5ec641b48b64c9c9f199f13, r12-5236
make  -k check-gcc RUNTESTFLAGS="tree-prof.exp=gcc.dg/tree-prof/merge_block.c"
FAIL: gcc.dg/tree-prof/merge_block.c scan-tree-dump-not optimized "Invalid sum"
# of expected passes            4
# of unexpected failures        1
# of unsupported tests          1

commit 5aa91072e24c1e16a5ec641b48b64c9c9f199f13 (HEAD, refs/bisect/bad)
Author: Jan Hubicka <jh@suse.cz>
Date:   Sat Nov 13 22:25:23 2021 +0100

    Implement DSE of dead functions calls storing memory.

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

* [Bug testsuite/103264] [12 regression] gcc.dg/tree-prof/merge_block.c fails after r12-5236
  2021-11-15 18:43 [Bug testsuite/103264] New: [12 regression] gcc.dg/tree-prof/merge_block.c fails after r12-5236 seurer at gcc dot gnu.org
@ 2021-11-15 21:04 ` hubicka at kam dot mff.cuni.cz
  2021-11-16  8:30 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hubicka at kam dot mff.cuni.cz @ 2021-11-15 21:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from hubicka at kam dot mff.cuni.cz ---
What breaks in the testcase is updating profile after complete loop
unroling.  I suspect the unrolling is enabled by the extra DSE.

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

* [Bug testsuite/103264] [12 regression] gcc.dg/tree-prof/merge_block.c fails after r12-5236
  2021-11-15 18:43 [Bug testsuite/103264] New: [12 regression] gcc.dg/tree-prof/merge_block.c fails after r12-5236 seurer at gcc dot gnu.org
  2021-11-15 21:04 ` [Bug testsuite/103264] " hubicka at kam dot mff.cuni.cz
@ 2021-11-16  8:30 ` marxin at gcc dot gnu.org
  2021-11-16  9:36 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-16  8:30 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-11-16
             Status|UNCONFIRMED                 |NEW

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

* [Bug testsuite/103264] [12 regression] gcc.dg/tree-prof/merge_block.c fails after r12-5236
  2021-11-15 18:43 [Bug testsuite/103264] New: [12 regression] gcc.dg/tree-prof/merge_block.c fails after r12-5236 seurer at gcc dot gnu.org
  2021-11-15 21:04 ` [Bug testsuite/103264] " hubicka at kam dot mff.cuni.cz
  2021-11-16  8:30 ` marxin at gcc dot gnu.org
@ 2021-11-16  9:36 ` rguenth at gcc dot gnu.org
  2021-11-21 12:10 ` hubicka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-11-16  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
   Target Milestone|---                         |12.0

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

* [Bug testsuite/103264] [12 regression] gcc.dg/tree-prof/merge_block.c fails after r12-5236
  2021-11-15 18:43 [Bug testsuite/103264] New: [12 regression] gcc.dg/tree-prof/merge_block.c fails after r12-5236 seurer at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-11-16  9:36 ` rguenth at gcc dot gnu.org
@ 2021-11-21 12:10 ` hubicka at gcc dot gnu.org
  2021-11-21 12:20 ` hubicka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-11-21 12:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
OK, the test wants to verify that main() became single basic block that has
correct frequency.  This is still true.  What we get wrong is that the function
t() gets mismatches:
int t ()
{
  int i;
  int _7;
  int _10;
  int _13;

;;   basic block 2, loop depth 0, count 312727306 (estimated locally, globally
0), probably never executed
;;    prev block 0, next block 3, flags: (NEW, REACHABLE, VISITED)
;;    pred:       ENTRY [always]  count:312727306 (estimated locally, globally
0) (FALLTHRU,EXECUTABLE)
  _7 = a[0];
  if (_7 != 0)
    goto <bb 6>; [5.50%]
  else
    goto <bb 3>; [94.50%]
;;    succ:       6 [5.5% (guessed)]  count:17200002 (estimated locally,
globally 0) (TRUE_VALUE,EXECUTABLE)
;;                3 [94.5% (guessed)]  count:295527304 (estimated locally,
globally 0) (FALSE_VALUE,EXECUTABLE)

;;   basic block 3, loop depth 0, count 299827304 (estimated locally, globally
0), probably never executed
;;   Invalid sum of incoming counts 295527304 (estimated locally, globally 0),
should be 299827304 (estimated locally, globally 0)
;;    prev block 2, next block 4, flags: (NEW, REACHABLE, VISITED)
;;    pred:       2 [94.5% (guessed)]  count:295527304 (estimated locally,
globally 0) (FALSE_VALUE,EXECUTABLE)
  _10 = a[1];
  if (_10 != 0)
    goto <bb 6>; [5.50%]
  else
    goto <bb 4>; [94.50%]
;;    succ:       6 [5.5% (guessed)]  count:16490502 (estimated locally,
globally 0) (TRUE_VALUE,EXECUTABLE)
;;                4 [94.5% (guessed)]  count:283336802 (estimated locally,
globally 0) (FALSE_VALUE,EXECUTABLE)

;;   basic block 4, loop depth 0, count 287459432 (estimated locally, globally
0), probably never executed
;;   Invalid sum of incoming counts 283336802 (estimated locally, globally 0),
should be 287459432 (estimated locally, globally 0)
;;    prev block 3, next block 5, flags: (NEW, REACHABLE, VISITED)
;;    pred:       3 [94.5% (guessed)]  count:283336802 (estimated locally,
globally 0) (FALSE_VALUE,EXECUTABLE)
  _13 = a[2];
  if (_13 != 0)
    goto <bb 6>; [5.50%]
  else
    goto <bb 5>; [94.50%]
;;    succ:       6 [5.5% (guessed)]  count:15810269 (estimated locally,
globally 0) (TRUE_VALUE,EXECUTABLE)
;;                5 [94.5% (guessed)]  count:271649163 (estimated locally,
globally 0) (FALSE_VALUE,EXECUTABLE)

;;   basic block 5, loop depth 0, count 271649163 (estimated locally, globally
0), probably never executed
;;    prev block 4, next block 6, flags: (NEW)
;;    pred:       4 [94.5% (guessed)]  count:271649163 (estimated locally,
globally 0) (FALSE_VALUE,EXECUTABLE)
;;    succ:       6 [always]  count:271649163 (estimated locally, globally 0)
(FALLTHRU)

;;   basic block 6, loop depth 0, count 312727306 (estimated locally, globally
0), probably never executed
;;   Invalid sum of incoming counts 321149936 (estimated locally, globally 0),
should be 312727306 (estimated locally, globally 0)
;;    prev block 5, next block 1, flags: (NEW, REACHABLE, VISITED)
;;    pred:       3 [5.5% (guessed)]  count:16490502 (estimated locally,
globally 0) (TRUE_VALUE,EXECUTABLE)
;;                5 [always]  count:271649163 (estimated locally, globally 0)
(FALLTHRU)
;;                4 [5.5% (guessed)]  count:15810269 (estimated locally,
globally 0) (TRUE_VALUE,EXECUTABLE)
;;                2 [5.5% (guessed)]  count:17200002 (estimated locally,
globally 0) (TRUE_VALUE,EXECUTABLE)
  # i_5 = PHI <1(3), 3(5), 2(4), 0(2)>
  return i_5;
;;    succ:       EXIT [always]  count:312727306 (estimated locally, globally
0)

}

which appears in cunrolli. I don't think this is related to the modref change.

Martin, can you please bisect it?

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

* [Bug testsuite/103264] [12 regression] gcc.dg/tree-prof/merge_block.c fails after r12-5236
  2021-11-15 18:43 [Bug testsuite/103264] New: [12 regression] gcc.dg/tree-prof/merge_block.c fails after r12-5236 seurer at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-11-21 12:10 ` hubicka at gcc dot gnu.org
@ 2021-11-21 12:20 ` hubicka at gcc dot gnu.org
  2021-11-21 15:14 ` cvs-commit at gcc dot gnu.org
  2021-11-22 17:45 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-11-21 12:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Aha, I see it.  The difference with IPA modref is that we now eliminate the
loop before profile instrumentation.  This leads to difference because the
function t() is never executed and thus we use guessed profile on it.

Now without modref we are not able to optimize out the loop and we actualy
profile it and then scale down the profile to zero.  This makes the cunrolli
updating bug to disappear and also shows weird behaviour of profile scaling -
when we get count to 0 we should maintain local profile.

So to get back to the original behaviour we want to add -fno-ipa-modref but
there are at least two other issues - the cunrolli misupading profile (which if
I recall may be partly intentional) and profile scalling killing local profile
when dropping count to 0.

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

* [Bug testsuite/103264] [12 regression] gcc.dg/tree-prof/merge_block.c fails after r12-5236
  2021-11-15 18:43 [Bug testsuite/103264] New: [12 regression] gcc.dg/tree-prof/merge_block.c fails after r12-5236 seurer at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-11-21 12:20 ` hubicka at gcc dot gnu.org
@ 2021-11-21 15:14 ` cvs-commit at gcc dot gnu.org
  2021-11-22 17:45 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-21 15:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jan Hubicka <hubicka@gcc.gnu.org>:

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

commit r12-5438-gc8260767aa3b41017b075d8fde3a4065fa637db7
Author: Jan Hubicka <jh@suse.cz>
Date:   Sun Nov 21 16:13:40 2021 +0100

    Fix failure merge_block.c testcase

    gcc/testsuite/ChangeLog:

    2021-11-21  Jan Hubicka  <hubicka@ucw.cz>

            PR ipa/103264
            * gcc.dg/tree-prof/merge_block.c: Add -fno-ipa-modref

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

* [Bug testsuite/103264] [12 regression] gcc.dg/tree-prof/merge_block.c fails after r12-5236
  2021-11-15 18:43 [Bug testsuite/103264] New: [12 regression] gcc.dg/tree-prof/merge_block.c fails after r12-5236 seurer at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-11-21 15:14 ` cvs-commit at gcc dot gnu.org
@ 2021-11-22 17:45 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-11-22 17:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2021-11-22 17:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 18:43 [Bug testsuite/103264] New: [12 regression] gcc.dg/tree-prof/merge_block.c fails after r12-5236 seurer at gcc dot gnu.org
2021-11-15 21:04 ` [Bug testsuite/103264] " hubicka at kam dot mff.cuni.cz
2021-11-16  8:30 ` marxin at gcc dot gnu.org
2021-11-16  9:36 ` rguenth at gcc dot gnu.org
2021-11-21 12:10 ` hubicka at gcc dot gnu.org
2021-11-21 12:20 ` hubicka at gcc dot gnu.org
2021-11-21 15:14 ` cvs-commit at gcc dot gnu.org
2021-11-22 17:45 ` jakub 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).