https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91215
--- Comment #1 from Sebastien Boisvert <sboisvert at gydle dot com> --- As indicated in the minimum reproducer, returning 0 fixed this bug. g++ reports this warning: g++-8.3.0-infinite-loop-bug.cpp: In function 'int doY()': g++-8.3.0-infinite-loop-bug.cpp:20:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ Thanks