Issue 179695
Summary clang -Og takes 2 minutes to build a C program vs 6 seconds for clang -O3, and uses 1.8 GiB of memory
Labels clang
Assignees
Reporter vstinner
    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](https://github.com/user-attachments/files/25076295/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
* -Og: `time clang -c -Og bug.c -o bug` takes **2 minutes 45 seconds** and consumes up to 1,8 GiB of RSS memory

`clang -O0`, `clang -O1` and `clang -O2` take between 1 and 6 seconds.

I cannot reproduce this issue on a 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).
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to