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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79373
--- Comment #9 from Jonathan Wakely ---
(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 the undefined behavior affects a variable
> (and its
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79373
Eric Botcazou changed:
What|Removed |Added
CC||ebotcazou at gcc dot gnu.org
--- Comment
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79373
--- Comment #6 from Andrew Pinski ---
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 overflow
the multiply so it removes the loop check.
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.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79373
--- Comment #4 from Jonathan Wakely ---
Use -fwrapv if you want predictable behaviour from integer overflow (both that
and -fsanitize=undefined are mentioned at https://gcc.gnu.org/bugs)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79373
Jonathan Wakely changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79373
--- Comment #1 from Andrew Pinski ---
I am suspecting this:
t*=65793;
overflows.
Can you try with -fsanitize=undefined ?
10 matches
Mail list logo