Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
No longer use the ``gcc -fprofile-update=atomic`` flag on i686. The flag has
been added to fix a random GCC internal error on PGO build (:gh:`145801`)
caused by corruption of profile data (.gcda files). The problem is that it
makes the PGO build way slower (up to 47x slower) on i686. Since the GCC
internal error was not seen on i686 so far, don't use
``-fprofile-update=atomic`` on i686 anymore. Patch by Victor Stinner.
59 changes: 56 additions & 3 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 26 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2090,10 +2090,32 @@ case "$ac_cv_cc_name" in
fi
;;
gcc)
AX_CHECK_COMPILE_FLAG(
[-fprofile-update=atomic],
[PGO_PROF_GEN_FLAG="-fprofile-generate -fprofile-update=atomic"],
[PGO_PROF_GEN_FLAG="-fprofile-generate"])
# Check for 32-bit x86 ISA
AC_CACHE_CHECK([for i686], [ac_cv_i686], [
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([
#ifdef __i386__
# error "i386"
#endif
], [])
],[ac_cv_i686=no],[ac_cv_i686=yes])
])

PGO_PROF_GEN_FLAG="-fprofile-generate"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do PGO_PROF_GEN_FLAG="PGO_PROF_GEN_FLAG -fprofile-generate" (i forgot the proper substitution) or is this something that won't be set by user?


# Use -fprofile-update=atomic to fix a random GCC internal error on PGO
# build (gh-145801) caused by corruption of profile data (.gcda files).
#
# gh-148535: On i686, using -fprofile-update=atomic makes the PGO build
# way slower (up to 47x slower). So far, the GCC internal error on PGO
# build was not seen on i686, so don't use this flag on i686.
AS_VAR_IF([ac_cv_i686], [no], [
AX_CHECK_COMPILE_FLAG(
[-fprofile-update=atomic],
[PGO_PROF_GEN_FLAG="$PGO_PROF_GEN_FLAG -fprofile-update=atomic"],
[])
])

PGO_PROF_USE_FLAG="-fprofile-use -fprofile-correction"
LLVM_PROF_MERGER="true"
LLVM_PROF_FILE=""
Expand Down
Loading