[Bug tree-optimization/88732] different results on -O0 and -O1, -O2, -O3, -Os

2019-01-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88732

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #4 from Richard Biener  ---
With optimization we constant-fold it, without the runtime expansion exploits
undefinedness.

[Bug tree-optimization/88732] different results on -O0 and -O1, -O2, -O3, -Os

2019-01-06 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88732

--- Comment #3 from Andrew Pinski  ---
(In reply to Amos Wang from comment #2)
> (In reply to Marc Glisse from comment #1)
> > Why not read the documentation for that function?
> > "If x is 0, the result is undefined."
> 
> Why the results are different at different optimizing optionss? If it's an
> undefined behaviour, I think all results should be the same.

undefined behavior means that the value could be different at different times.

[Bug tree-optimization/88732] different results on -O0 and -O1, -O2, -O3, -Os

2019-01-06 Thread amocywang at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88732

--- Comment #2 from Amos Wang  ---
(In reply to Marc Glisse from comment #1)
> Why not read the documentation for that function?
> "If x is 0, the result is undefined."

Why the results are different at different optimizing optionss? If it's an
undefined behaviour, I think all results should be the same.

[Bug tree-optimization/88732] different results on -O0 and -O1, -O2, -O3, -Os

2019-01-06 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88732

--- Comment #1 from Marc Glisse  ---
Why not read the documentation for that function?
"If x is 0, the result is undefined."