This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFC: -fstrict-overflow
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, "Joseph S. Myers" <joseph at codesourcery dot com>, Tom Tromey <tromey at redhat dot com>, Ian Lance Taylor <iant at google dot com>, Mark Mitchell <mark at codesourcery dot com>
- Date: Thu, 25 Jan 2007 12:21:40 +0100
- Subject: Re: PATCH RFC: -fstrict-overflow
- References: <Pine.LNX.4.64.0701242325210.14238@digraph.polyomino.org.uk> <20070125092215.GA20002@atrey.karlin.mff.cuni.cz>
> what about to fix it? IMHO, it could be made much more reliable if
> instead of testing -ftrapv everywhere, we just instrumented the program
> early (perhaps during gimplification, or in a separate pass immediatelly
> after it), and then just behaved the same way as with -fno-wrapv?
We would be very interested in such an approach for the -gnato option of the
Ada compiler. Currently it is entirely implemented in the front-end, but at
the cost of runtime efficiency; it could be piggybacked on a working, more
high-level implementation of -ftrapv instead. The ACATS testsuite could be
used as a regression tester for the implementation, it contains several tests
raising an exception on overflow (see testsuite/ada/acats/overflow.lst).
--
Eric Botcazou