[Bug c++/79373] For loop optimization bug: condition ignored

2017-02-05 Thread steven.p.pigeon at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79373 --- Comment #10 from Steven Pigeon --- (In reply to Jonathan Wakely from comment #9) > (In reply to Steven Pigeon from comment #7) > > I do understand that this is what happens (the code is fixed by promoting > > int32_t t=x to int64_t t=x) but t

[Bug c++/79373] For loop optimization bug: condition ignored

2017-02-04 Thread steven.p.pigeon at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79373 --- Comment #7 from Steven Pigeon --- (In reply to Andrew Pinski from comment #6) > Once undefined behavior happens all bets are off of any behavior of the > program. > > In this case the function is in lined and the optimizers see i cannot > o

[Bug c++/79373] For loop optimization bug: condition ignored

2017-02-04 Thread steven.p.pigeon at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79373 --- Comment #5 from Steven Pigeon --- The problem is not the function that overflows. It's the loop that calls them that never stops. I don't see how that's "resolved": the overflow in the function should not affect the loop that calls it.

[Bug c++/79373] For loop optimization bug: condition ignored

2017-02-03 Thread steven.p.pigeon at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79373 --- Comment #2 from Steven Pigeon --- (In reply to Andrew Pinski from comment #1) > I am suspecting this: > t*=65793; > > overflows. > > Can you try with -fsanitize=undefined ? The bug disappears with g++ -fsanitize=undefined -O3 -std

[Bug c++/79373] New: For loop optimization bug: condition ignored

2017-02-03 Thread steven.p.pigeon at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: steven.p.pigeon at gmail dot com Target Milestone: --- Created attachment 40668 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40668&action=edit Collected data for bug (followed collection instructions) The condi