[Bug c++/91215] Compiled program loops endlessly because of -O2 with g++ 8.3.0

2023-06-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91215 Andrew Pinski changed: What|Removed |Added Resolution|INVALID |DUPLICATE --- Comment #6 from Andrew

[Bug c++/91215] Compiled program loops endlessly because of -O2 with g++ 8.3.0

2019-07-19 Thread sboisvert at gydle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91215 --- Comment #5 from Sebastien Boisvert --- OK, thanks for the link, this is interesting. A previous release, g++ 7.4.0, does not generate an infinite loop in the executable. Like g++ 8.3.0, it does print the warning: no return statement in

[Bug c++/91215] Compiled program loops endlessly because of -O2 with g++ 8.3.0

2019-07-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91215 --- Comment #4 from Andrew Pinski --- Also read https://gcc.gnu.org/gcc-8/porting_to.html : -Wreturn-type is enabled by default G++ now assumes that control never reaches the end of a non-void function (i.e. without reaching a return statement).

[Bug c++/91215] Compiled program loops endlessly because of -O2 with g++ 8.3.0

2019-07-19 Thread sboisvert at gydle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91215 --- Comment #3 from Sebastien Boisvert --- That was fast, thanks !

[Bug c++/91215] Compiled program loops endlessly because of -O2 with g++ 8.3.0

2019-07-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91215 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/91215] Compiled program loops endlessly because of -O2 with g++ 8.3.0

2019-07-19 Thread sboisvert at gydle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91215 --- Comment #1 from Sebastien Boisvert --- 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: