Bug report
Bug description:
fails: ./configure CFLAGS=-O0 --enable-optimizations --with-lto
succeeds: ./configure CFLAGS=-O1 --enable-optimizations --with-lto
It fails when it runs the tests to build the profile. The problematic test is TestLRUC.test_lru_recursion in Lib/test/test_functools.py. It runs out of stack at well below the expected limit. Py_C_RECURSION_LIMIT is set to 10000. The test runs a simple recursive fibonacci function starting at 2857 (limit*2//7). It keeps crashing with smaller values, down to about 450. I'm not sure why the combination of PGO and -O0 special in this regard. (FYI, my build toolchain is probably a bit outdated, but I'm not sure that's a significant factor.)
I can think of several solutions here:
- "don't do that!": document that
-O0 should not be combined with --enable-optimizations (docs, maybe devguide)
- print a warning in
configure with that combination
- lower
Py_C_RECURSION_LIMIT with that combination
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
Bug report
Bug description:
fails:
./configure CFLAGS=-O0 --enable-optimizations --with-ltosucceeds:
./configure CFLAGS=-O1 --enable-optimizations --with-ltoIt fails when it runs the tests to build the profile. The problematic test is
TestLRUC.test_lru_recursionin Lib/test/test_functools.py. It runs out of stack at well below the expected limit.Py_C_RECURSION_LIMITis set to 10000. The test runs a simple recursive fibonacci function starting at 2857 (limit*2//7). It keeps crashing with smaller values, down to about 450. I'm not sure why the combination of PGO and-O0special in this regard. (FYI, my build toolchain is probably a bit outdated, but I'm not sure that's a significant factor.)I can think of several solutions here:
-O0should not be combined with--enable-optimizations(docs, maybe devguide)configurewith that combinationPy_C_RECURSION_LIMITwith that combinationCPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
configurewarns when CFLAGS=-O0 and --enable-optimizations #137975