https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79373

--- Comment #2 from Steven Pigeon <steven.p.pigeon at gmail dot com> ---
(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=c++11 test-wave-stream.cpp 

Yes, it overflows for some values (and is undefined behavior?).

But it shouldn't affect the for-loop. At worse, the returned values should be
random-looking and the unit test should fail with a message.

Reply via email to