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

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Luca Rocca from comment #2)
> Consider also for comparison the approach of GCC up to gcc-6.4.0,
> reading this comment from the corresponding file gcc-6.4.0/gcc/match.pd:
> 
> /* Make sure to preserve divisions by zero.  This is the reason why
>    we don't simplify x / x to 1 or 0 / x to 0.  */
> 
> For the same code, GCC up to 6.4.0 does not perform the simplification and
> when
> X = 0 we have an exception raised at runtime as expected

And that was changed intentionally by r242636.

The code is undefined, so GCC is not required to always compile it the same
way.

Reply via email to