Skip to content

gh-148535: Don't use gcc -fprofile-update=atomic flag on i686#148554

Merged
vstinner merged 1 commit intopython:mainfrom
vstinner:i686_profile_atomic
Apr 16, 2026
Merged

gh-148535: Don't use gcc -fprofile-update=atomic flag on i686#148554
vstinner merged 1 commit intopython:mainfrom
vstinner:i686_profile_atomic

Conversation

@vstinner
Copy link
Copy Markdown
Member

@vstinner vstinner commented Apr 14, 2026

The -fprofile-update=atomic flag was 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.

The -fprofile-update=atomic flag was added to fix a random GCC
internal error on PGO build (pythongh-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.
Comment thread configure.ac
],[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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Currently, you cannot override PGO_PROF_GEN_FLAG variable when running configure. My PR doesn't change that, it just moves code around.

But if you really want to override these flags, you can override the variable when running make. Example: make PGO_PROF_GEN_FLAG="--my-flags". Again, my PR doesn't change that (it remains possible).

@vstinner vstinner merged commit 2faceee into python:main Apr 16, 2026
55 checks passed
@vstinner vstinner deleted the i686_profile_atomic branch April 16, 2026 17:13
@miss-islington-app
Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 16, 2026
…ythonGH-148554)

The -fprofile-update=atomic flag was added to fix a random GCC
internal error on PGO build (pythongh-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.
(cherry picked from commit 2faceeec5c0fb06498a9654d429180ac4610c65a)

Co-authored-by: Victor Stinner <vstinner@python.org>
@miss-islington-app
Copy link
Copy Markdown

Sorry, @vstinner, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 2faceeec5c0fb06498a9654d429180ac4610c65a 3.13

@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 16, 2026

GH-148655 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Apr 16, 2026
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 16, 2026

GH-148656 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Apr 16, 2026
vstinner added a commit that referenced this pull request Apr 16, 2026
…H-148554) (#148655)

gh-148535: Don't use gcc -fprofile-update=atomic flag on i686 (GH-148554)

The -fprofile-update=atomic flag was 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.
(cherry picked from commit 2faceee)

Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this pull request Apr 16, 2026
…148554) (#148656)

gh-148535: Don't use gcc -fprofile-update=atomic flag on i686 (#148554)

The -fprofile-update=atomic flag was 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.

(cherry picked from commit 2faceee)
@bedevere-bot
Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 FreeBSD Refleaks 3.14 (tier-3) has failed when building commit 2fdccb3.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1800/builds/1165) and take a look at the build logs.
  4. Check if the failure is related to this commit (2fdccb3) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1800/builds/1165

Failed tests:

  • test_httpservers
  • test.test_concurrent_futures.test_interpreter_pool
  • test_datetime

Failed subtests:

  • test_large_content_length_truncated - test.test_httpservers.CGIHTTPServerTestCase.test_large_content_length_truncated

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/buildbot/buildarea/3.14.ware-freebsd.refleak/build/Lib/test/libregrtest/single.py", line 236, in _runtest_env_changed_exc
    return
ResourceWarning: unclosed <socket.socket fd=5, family=2, type=1, proto=6, laddr=('127.0.0.1', 16947)>


Traceback (most recent call last):
  File "/buildbot/buildarea/3.14.ware-freebsd.refleak/build/Lib/test/test_httpservers.py", line 1139, in test_large_content_length_truncated
    res = self.request('/cgi-bin/file1.py', 'POST', b'x', headers)
  File "/buildbot/buildarea/3.14.ware-freebsd.refleak/build/Lib/test/test_httpservers.py", line 131, in request
    self.connection.request(method, uri, body, headers)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/3.14.ware-freebsd.refleak/build/Lib/http/client.py", line 1358, in request
    self._send_request(method, url, body, headers, encode_chunked)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/3.14.ware-freebsd.refleak/build/Lib/http/client.py", line 1404, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/3.14.ware-freebsd.refleak/build/Lib/http/client.py", line 1353, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/3.14.ware-freebsd.refleak/build/Lib/http/client.py", line 1152, in _send_output
    self.send(chunk)
    ~~~~~~~~~^^^^^^^
  File "/buildbot/buildarea/3.14.ware-freebsd.refleak/build/Lib/http/client.py", line 1077, in send
    self.sock.sendall(data)
    ~~~~~~~~~~~~~~~~~^^^^^^
BrokenPipeError: [Errno 32] Broken pipe


Traceback (most recent call last):
  File "/buildbot/buildarea/3.14.ware-freebsd.refleak/build/Lib/test/libregrtest/single.py", line 236, in _runtest_env_changed_exc
    return
ResourceWarning: unclosed <socket.socket fd=4, family=2, type=1, proto=6, laddr=('127.0.0.1', 11373)>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants