https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96954
Bug ID: 96954 Summary: gcc times out with -O2/-O3/-Os Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, gcc times out during execution of ./a.out with -O2/-O3/-Os: $ cat s.cpp template < class A > int B ( const A &){ int a = B ( a ); return a ; } int main (){ return B (0);} $ g++ -O2 1337-2-runtime-out.C && ./a.out times out $ g++ -O0 1337-2-runtime-out.C && ./a.out Segmentation fault (core dumped) $ g++ -v Using built-in specs. COLLECT_GCC=/usr/local/gcc-20200823/bin/g++ COLLECT_LTO_WRAPPER=/usr/local/gcc-20200823/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-11-20200823/configure --prefix=/usr/local/gcc-20200823 --enable-checking=release --enable-languages=c,c++ --disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.0.0 20200823 (experimental) (GCC)