Building (the main branch of) Python with clang 21 fails randomly with a timeout of 20 minutes. I identified that the build is especially slow for Python/ceval.c and Modules/_testinternalcapi/interpreter.c. I built interpreter.c with -E to create a reproducer:
Reproducer: bug.c
On my Fedora 43 laptop (x86-64) with clang 21.1.8:
- -O3:
time clang -c -O3 bug.c -o bug takes 6 seconds, and consumes around 202 MiB of RSS memory
- -Og:
time clang -c -Og bug.c -o bug takes 2 minutes 45 seconds => 28x slower, and consumes up to 1.8 GiB of RSS memory (9x more)
clang -O0, clang -O1 and clang -O2 take between 1 and 6 seconds.
I cannot reproduce this issue on a Fedora ppc64le machine with clang 20.1.8:
- -Og: 17.5 seconds
- -O3: 18.9 seconds
How can I help you to debug this issue?
I'm trying to reduce the reproducer program, but so far I failed to reduce the Test_EvalFrame() function (17k lines).