https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110154
Bug ID: 110154 Summary: When compiling __builtin_frame_address with a relatively large argument, GCC-trunk takes up a significant amount of time. Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: 141242068 at smail dot nju.edu.cn Target Milestone: --- This behavior can be verified on https://gcc.godbolt.org/z/7967MTMrP When compile below program with gcc: ``` void *h() { return __builtin_frame_address(0xFFFFF); } ``` gcc takes over 40 seconds to finish: ``` $ time gcc-14 -c -O2 a.c gcc-14 -c -O2 a.c 43.33s user 1.04s system 99% cpu 44.381 total ``` in contrast, clang immediately returns: ``` $ clang-17 -c -O2 a.c <source>:2:10: error: argument value 1048575 is outside the valid range [0, 65535] 2 | return __builtin_frame_address(0xFFFFF); | ^ ~~~~~~~ 1 error generated. Compiler returned: 1 ```