This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix infinite recursion with div-by-zero (PR middle-end/70992)
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Marek Polacek <polacek at redhat dot com>
- Date: Tue, 25 Jul 2017 15:30:23 +0200
- Subject: Re: [PATCH] Fix infinite recursion with div-by-zero (PR middle-end/70992)
- Authentication-results: sourceware.org; auth=none
- References: <20170718160511.GP2890@redhat.com> <20170725121937.GF3397@redhat.com> <CAFiYyc2Nm8j914KkpGGS0mnqMU=MxT5YagOz0pjq8GC1=t1yfg@mail.gmail.com>
> Eric, any comments?
No objection for the build2_stat hunk, I think it's in keeping with the Ada
semantics. But the tree_could_trap_p hunk is certainly an abomination...
> We could also avoid tree_could_trap_p by special-casing only
> *_DIV_EXPR and *_MOD_EXPR
> with integer zero 2nd operand explicitely in build2 given there's no
> "constant" value for this. That is,
> for FP 1./0. is NaN (a "constant" value) even if the operation might trap.
Yes, that would be faster & simpler and avoids the abomination.
--
Eric Botcazou