https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92617
--- Comment #6 from Andrew Pinski ---
In c++ (unlike C) return from a non void function is undefined even if the
return value is not used.
In c, only of the return value is used it would be undefined.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92617
--- Comment #7 from Andrew Pinski ---
Not you can get a runtime error if you use -fsanitizer=undefined.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92617
--- Comment #5 from Piotr Seweryn ---
Obviously there is no return statement and warning was issued, however endless
loop isn't the expected result, don't you agree? And falling-through to the
next piece of code is even worse, coze we are falling
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92617
Richard Biener changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92617
--- Comment #3 from Piotr Seweryn ---
Similar problem occurs when -O2 or -O3 is used, there is also an endless loop,
however different assembler code is generated. I can also provided appropriate
.ii and .s files for O2 and O3 case.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92617
--- Comment #2 from Piotr Seweryn ---
Created attachment 47324
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47324&action=edit
Assembler file
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92617
--- Comment #1 from Piotr Seweryn ---
Created attachment 47323
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47323&action=edit
Pre-processed file