public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/113765] New: autofdo: val-profiler-threads-1.c compilation,  error: probability of edge from entry block not initialized
@ 2024-02-05 11:47 andi-gcc at firstfloor dot org
  2024-02-05 12:26 ` [Bug gcov-profile/113765] " andi-gcc at firstfloor dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: andi-gcc at firstfloor dot org @ 2024-02-05 11:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113765
           Summary: autofdo: val-profiler-threads-1.c compilation,  error:
                    probability of edge from entry block not initialized
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andi-gcc at firstfloor dot org
  Target Milestone: ---

With recent trunk (019dc63819be)

When running the test suite on a Intel system with autofdo installed

Executing on host: /home/ak/gcc/obj-full/gcc/xgcc -B/home/ak/gcc/obj-full/gcc/ 
/home/ak/gcc/gcc/gcc/testsuite/gcc.dg/tree-prof/val-profiler-threads-1.c   
-fdi
agnostics-plain-output   -O0 -pthread -fprofile-update=atomic
-fauto-profile=/home/ak/gcc/obj-full/gcc/testsuite/gcc20/afdo.val-profiler-threads-1.gcda
-DFOR_AU
TOFDO_TESTING -fearly-inlining -dumpbase-ext .x02  -lm  -o
/home/ak/gcc/obj-full/gcc/testsuite/gcc20/val-profiler-threads-1.x02   
(timeout = 300)
spawn -ignore SIGHUP /home/ak/gcc/obj-full/gcc/xgcc
-B/home/ak/gcc/obj-full/gcc/
/home/ak/gcc/gcc/gcc/testsuite/gcc.dg/tree-prof/val-profiler-threads-1.c -fdiag
nostics-plain-output -O0 -pthread -fprofile-update=atomic
-fauto-profile=/home/ak/gcc/obj-full/gcc/testsuite/gcc20/afdo.val-profiler-threads-1.gcda
-DFOR_AUTOFD
O_TESTING -fearly-inlining -dumpbase-ext .x02 -lm -o
/home/ak/gcc/obj-full/gcc/testsuite/gcc20/val-profiler-threads-1.x02
/home/ak/gcc/gcc/gcc/testsuite/gcc.dg/tree-prof/val-profiler-threads-1.c: In
function 'copy_memory':
/home/ak/gcc/gcc/gcc/testsuite/gcc.dg/tree-prof/val-profiler-threads-1.c:13:7:
error: probability of edge from entry block not initialized
/home/ak/gcc/gcc/gcc/testsuite/gcc.dg/tree-prof/val-profiler-threads-1.c:13:7:
error: probability of edge 2->4 not initialized
/home/ak/gcc/gcc/gcc/testsuite/gcc.dg/tree-prof/val-profiler-threads-1.c:13:7:
error: probability of edge 5->1 not initialized
during GIMPLE pass: fixup_cfg
/home/ak/gcc/gcc/gcc/testsuite/gcc.dg/tree-prof/val-profiler-threads-1.c:13:7:
internal compiler error: verify_flow_info failed
0xafb91e verify_flow_info()
        ../../gcc/gcc/cfghooks.cc:287
0xf0e8a7 execute_function_todo
        ../../gcc/gcc/passes.cc:2100
0xf0edde execute_todo
        ../../gcc/gcc/passes.cc:2142
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
compiler exited with status 1

I'm not attaching the source because it also needs the autofdo gcov file to
reproduce and the test case is already in tree.

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

* [Bug gcov-profile/113765] autofdo: val-profiler-threads-1.c compilation,  error: probability of edge from entry block not initialized
  2024-02-05 11:47 [Bug gcov-profile/113765] New: autofdo: val-profiler-threads-1.c compilation, error: probability of edge from entry block not initialized andi-gcc at firstfloor dot org
@ 2024-02-05 12:26 ` andi-gcc at firstfloor dot org
  2024-02-05 14:56 ` [Bug gcov-profile/113765] ICE: " rguenth at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: andi-gcc at firstfloor dot org @ 2024-02-05 12:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andi Kleen <andi-gcc at firstfloor dot org> ---
Seems to be a regression, I tested the same setup on gcc 13 and the test passes
there:

55:PASS: gcc.dg/tree-prof/val-profiler-threads-1.c compilation, 
-fprofile-generate -D_PROFILE_GENERATE
59:PASS: gcc.dg/tree-prof/val-profiler-threads-1.c execution,   
-fprofile-generate -D_PROFILE_GENERATE
62:PASS: gcc.dg/tree-prof/val-profiler-threads-1.c compilation,  -fprofile-use
-D_PROFILE_USE
66:PASS: gcc.dg/tree-prof/val-profiler-threads-1.c execution,    -fprofile-use
-D_PROFILE_USE
76:PASS: gcc.dg/tree-prof/val-profiler-threads-1.c compilation,  -g
-DFOR_AUTOFDO_TESTING
108:PASS: gcc.dg/tree-prof/val-profiler-threads-1.c execution,    -g
-DFOR_AUTOFDO_TESTING
111:PASS: gcc.dg/tree-prof/val-profiler-threads-1.c compilation, 
-fauto-profile -DFOR_AUTOFDO_TESTING -fearly-inlining
115:PASS: gcc.dg/tree-prof/val-profiler-threads-1.c execution,   
-fauto-profile -DFOR_AUTOFDO_TESTING -fearly-inlining

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

* [Bug gcov-profile/113765] ICE: autofdo: val-profiler-threads-1.c compilation,  error: probability of edge from entry block not initialized
  2024-02-05 11:47 [Bug gcov-profile/113765] New: autofdo: val-profiler-threads-1.c compilation, error: probability of edge from entry block not initialized andi-gcc at firstfloor dot org
  2024-02-05 12:26 ` [Bug gcov-profile/113765] " andi-gcc at firstfloor dot org
@ 2024-02-05 14:56 ` rguenth at gcc dot gnu.org
  2024-02-05 16:11 ` andi-gcc at firstfloor dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-02-05 14:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org
           Keywords|                            |ice-checking
            Version|unknown                     |14.0

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Honza added extra checking for this for gcc14.

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

* [Bug gcov-profile/113765] ICE: autofdo: val-profiler-threads-1.c compilation,  error: probability of edge from entry block not initialized
  2024-02-05 11:47 [Bug gcov-profile/113765] New: autofdo: val-profiler-threads-1.c compilation, error: probability of edge from entry block not initialized andi-gcc at firstfloor dot org
  2024-02-05 12:26 ` [Bug gcov-profile/113765] " andi-gcc at firstfloor dot org
  2024-02-05 14:56 ` [Bug gcov-profile/113765] ICE: " rguenth at gcc dot gnu.org
@ 2024-02-05 16:11 ` andi-gcc at firstfloor dot org
  2024-02-06  8:41 ` [Bug gcov-profile/113765] [14 Regression] " rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: andi-gcc at firstfloor dot org @ 2024-02-05 16:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andi Kleen <andi-gcc at firstfloor dot org> ---
-O1 fixes it, so an easy patch would be 

diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc
index 63d0c3dc36df..180ed7a8260f 100644
--- a/gcc/auto-profile.cc
+++ b/gcc/auto-profile.cc
@@ -1758,7 +1758,7 @@ public:
   bool
   gate (function *) final override
   {
-    return flag_auto_profile;
+    return flag_auto_profile && optimize > 0;
   }
   unsigned int
   execute (function *) final override

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

* [Bug gcov-profile/113765] [14 Regression] ICE: autofdo: val-profiler-threads-1.c compilation,  error: probability of edge from entry block not initialized
  2024-02-05 11:47 [Bug gcov-profile/113765] New: autofdo: val-profiler-threads-1.c compilation, error: probability of edge from entry block not initialized andi-gcc at firstfloor dot org
                   ` (2 preceding siblings ...)
  2024-02-05 16:11 ` andi-gcc at firstfloor dot org
@ 2024-02-06  8:41 ` rguenth at gcc dot gnu.org
  2024-03-07 20:41 ` law at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-02-06  8:41 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug gcov-profile/113765] [14 Regression] ICE: autofdo: val-profiler-threads-1.c compilation,  error: probability of edge from entry block not initialized
  2024-02-05 11:47 [Bug gcov-profile/113765] New: autofdo: val-profiler-threads-1.c compilation, error: probability of edge from entry block not initialized andi-gcc at firstfloor dot org
                   ` (3 preceding siblings ...)
  2024-02-06  8:41 ` [Bug gcov-profile/113765] [14 Regression] " rguenth at gcc dot gnu.org
@ 2024-03-07 20:41 ` law at gcc dot gnu.org
  2024-03-16  1:31 ` erozen at microsoft dot com
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: law at gcc dot gnu.org @ 2024-03-07 20:41 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
                 CC|                            |law at gcc dot gnu.org

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

* [Bug gcov-profile/113765] [14 Regression] ICE: autofdo: val-profiler-threads-1.c compilation,  error: probability of edge from entry block not initialized
  2024-02-05 11:47 [Bug gcov-profile/113765] New: autofdo: val-profiler-threads-1.c compilation, error: probability of edge from entry block not initialized andi-gcc at firstfloor dot org
                   ` (4 preceding siblings ...)
  2024-03-07 20:41 ` law at gcc dot gnu.org
@ 2024-03-16  1:31 ` erozen at microsoft dot com
  2024-03-26 10:54 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: erozen at microsoft dot com @ 2024-03-16  1:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Eugene Rozenfeld <erozen at microsoft dot com> ---
auto-profile currently doesn't guarantee that it will set probabilities on all
edges because of zero basic block counts. Normally those edges just have
probabilities set by the preceding profile_estimate pass but under -O0
profile_estimate pass doesn't run. I think the correct fix is not to set
full_profile to true in auto-profile.cc. Under -O1 and higher it's already set
in profile_estimate and under -O0 auto_profile doesn't guarantee a full profile
so shouldn't set the flag.

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

* [Bug gcov-profile/113765] [14 Regression] ICE: autofdo: val-profiler-threads-1.c compilation,  error: probability of edge from entry block not initialized
  2024-02-05 11:47 [Bug gcov-profile/113765] New: autofdo: val-profiler-threads-1.c compilation, error: probability of edge from entry block not initialized andi-gcc at firstfloor dot org
                   ` (5 preceding siblings ...)
  2024-03-16  1:31 ` erozen at microsoft dot com
@ 2024-03-26 10:54 ` rguenth at gcc dot gnu.org
  2024-03-26 13:03 ` hubicka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-03-26 10:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Can somebody prepare a patch along this line?

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

* [Bug gcov-profile/113765] [14 Regression] ICE: autofdo: val-profiler-threads-1.c compilation,  error: probability of edge from entry block not initialized
  2024-02-05 11:47 [Bug gcov-profile/113765] New: autofdo: val-profiler-threads-1.c compilation, error: probability of edge from entry block not initialized andi-gcc at firstfloor dot org
                   ` (6 preceding siblings ...)
  2024-03-26 10:54 ` rguenth at gcc dot gnu.org
@ 2024-03-26 13:03 ` hubicka at gcc dot gnu.org
  2024-03-26 20:49 ` erozen at microsoft dot com
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: hubicka at gcc dot gnu.org @ 2024-03-26 13:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Running auto-fdo without guessing branch probabilities is somewhat odd idea in
general.  I suppose we can indeed just avoid setting full_profile flag. Though
the optimization passes are not that much tested to work with non-full profiles
so there is some risk that resulting code will be worse than without auto-FDO.

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

* [Bug gcov-profile/113765] [14 Regression] ICE: autofdo: val-profiler-threads-1.c compilation,  error: probability of edge from entry block not initialized
  2024-02-05 11:47 [Bug gcov-profile/113765] New: autofdo: val-profiler-threads-1.c compilation, error: probability of edge from entry block not initialized andi-gcc at firstfloor dot org
                   ` (7 preceding siblings ...)
  2024-03-26 13:03 ` hubicka at gcc dot gnu.org
@ 2024-03-26 20:49 ` erozen at microsoft dot com
  2024-04-03 11:56 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: erozen at microsoft dot com @ 2024-03-26 20:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Eugene Rozenfeld <erozen at microsoft dot com> ---
I'll prepare a patch this week.

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

* [Bug gcov-profile/113765] [14 Regression] ICE: autofdo: val-profiler-threads-1.c compilation,  error: probability of edge from entry block not initialized
  2024-02-05 11:47 [Bug gcov-profile/113765] New: autofdo: val-profiler-threads-1.c compilation, error: probability of edge from entry block not initialized andi-gcc at firstfloor dot org
                   ` (8 preceding siblings ...)
  2024-03-26 20:49 ` erozen at microsoft dot com
@ 2024-04-03 11:56 ` rguenth at gcc dot gnu.org
  2024-04-04  0:31 ` cvs-commit at gcc dot gnu.org
  2024-04-09 11:48 ` rguenth at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-04-03 11:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2024-04-03
           Assignee|unassigned at gcc dot gnu.org      |erozen at microsoft dot com

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

* [Bug gcov-profile/113765] [14 Regression] ICE: autofdo: val-profiler-threads-1.c compilation,  error: probability of edge from entry block not initialized
  2024-02-05 11:47 [Bug gcov-profile/113765] New: autofdo: val-profiler-threads-1.c compilation, error: probability of edge from entry block not initialized andi-gcc at firstfloor dot org
                   ` (9 preceding siblings ...)
  2024-04-03 11:56 ` rguenth at gcc dot gnu.org
@ 2024-04-04  0:31 ` cvs-commit at gcc dot gnu.org
  2024-04-09 11:48 ` rguenth at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-04  0:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Eugene Rozenfeld <erozen@gcc.gnu.org>:

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

commit r14-9780-gfe385c219994f6d5c1ffe00bcaf5a62c3d18caaf
Author: Eugene Rozenfeld <erozen@microsoft.com>
Date:   Tue Mar 26 16:28:08 2024 -0700

    Don't set full_profile in auto-profile [PR113765]

    auto-profile currently doesn't guarantee that it will set probabilities
    on all edges because of zero basic block counts. Normally those edges
    just have probabilities set by the preceding profile_estimate pass but
    under -O0 profile_estimate pass doesn't run. The patch removes setting
    of full_profile to true in auto-profile.

    Tested on x86_64-pc-linux-gnu.

    gcc/ChangeLog:
            PR gcov-profile/113765
            * auto-profile.cc (afdo_annotate_cfg): Don't set full_profile to
true

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

* [Bug gcov-profile/113765] [14 Regression] ICE: autofdo: val-profiler-threads-1.c compilation,  error: probability of edge from entry block not initialized
  2024-02-05 11:47 [Bug gcov-profile/113765] New: autofdo: val-profiler-threads-1.c compilation, error: probability of edge from entry block not initialized andi-gcc at firstfloor dot org
                   ` (10 preceding siblings ...)
  2024-04-04  0:31 ` cvs-commit at gcc dot gnu.org
@ 2024-04-09 11:48 ` rguenth at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-04-09 11:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2024-04-09 11:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-05 11:47 [Bug gcov-profile/113765] New: autofdo: val-profiler-threads-1.c compilation, error: probability of edge from entry block not initialized andi-gcc at firstfloor dot org
2024-02-05 12:26 ` [Bug gcov-profile/113765] " andi-gcc at firstfloor dot org
2024-02-05 14:56 ` [Bug gcov-profile/113765] ICE: " rguenth at gcc dot gnu.org
2024-02-05 16:11 ` andi-gcc at firstfloor dot org
2024-02-06  8:41 ` [Bug gcov-profile/113765] [14 Regression] " rguenth at gcc dot gnu.org
2024-03-07 20:41 ` law at gcc dot gnu.org
2024-03-16  1:31 ` erozen at microsoft dot com
2024-03-26 10:54 ` rguenth at gcc dot gnu.org
2024-03-26 13:03 ` hubicka at gcc dot gnu.org
2024-03-26 20:49 ` erozen at microsoft dot com
2024-04-03 11:56 ` rguenth at gcc dot gnu.org
2024-04-04  0:31 ` cvs-commit at gcc dot gnu.org
2024-04-09 11:48 ` rguenth 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).