This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/53805] combine_comparisons changes trapping behavior
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 29 Jun 2012 14:54:21 +0000
- Subject: [Bug tree-optimization/53805] combine_comparisons changes trapping behavior
- Auto-submitted: auto-generated
- References: <bug-53805-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53805
--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-29 14:54:21 UTC ---
(In reply to comment #6)
> On Fri, 29 Jun 2012, rguenth at gcc dot gnu.org wrote:
>
> > We happily remove dead trapping statements:
> >
> > void foo(double x, int y)
> > {
> > 1 / x;
>
> Bug with -ftrapping-math. Maybe a known bug - there are plenty of open
> bugs for ways in which -ftrapping-math -frounding-math fail to implement
> standard C semantics - but a bug.
>
> > 1 / y;
>
> Arguably a bug with -ftrapv (again, the option could reasonably be split
> into different cases), but not otherwise.
All CPUs I know trap for 1 / 0, even in the integer division case. -ftrapv
is a completely different story - for it we'd even have to preserve
void foo (int x, int y)
{
x + y;
}