Issue 184435
Summary clang-21 compile time regression with `-Og` on Python's `ceval.c`
Labels new issue
Assignees
Reporter colesbury
    clang-21 takes ~110 seconds to compile the [Python/ceval.c](https://github.com/python/cpython/blob/main/Python/ceval.c) when building with `--disable-gil` and `-Og`. clang-20 takes about ~6 seconds. The regression seems to be limited to `-Og`. Building with `O0/O1/O2/O3` takes about 6 seconds.

The ceval.c file Python's interpreter, with lots of computed gotos. Note that CPython also supports a a switch based interpreter and a tail calling interpreter (using `[[musttail]]`), but this problem seems to be limited to the computed goto interpreter.

### Steps to reproduce

```
git clone https://github.com/python/cpython && cd cpython
CC=clang-21 ./configure --disable-gil --with-pydebug
```

Then you can either run `make` or build the file explicitly:

```
time clang-21 -c -fno-strict-overflow -Wsign-compare -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -O3 -Wall    -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -DPy_BUILD_CORE -o Python/ceval.o Python/ceval.c
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to