This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][4.3] Deprecate -ftrapv
- From: Richard Guenther <rguenther at suse dot de>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Sat, 1 Mar 2008 01:13:55 +0100 (CET)
- Subject: Re: [PATCH][4.3] Deprecate -ftrapv
- References: <Pine.LNX.email@example.com> <47C89DB1.firstname.lastname@example.org>
On Fri, 29 Feb 2008, Mark Mitchell wrote:
> Richard Guenther wrote:
> > This is a request to depcrecate -ftrapv which has numerous problems
> > making it not work as expected since a long time. As nobody seems
> > to have the energy to ensure it is working I propose to deprecate it
> > for GCC 4.3 to make it possible to remove it during 4.4 (and not
> > block removing libcall notes by it).
> Why doesn't it work? Can it be made to work relatively easily? Do we need
> functionality like this for Ada or Java?
The tree optimizers do not recognize +-* of singed integers as
possibly trapping which causes functions to become const/pure that
should not and causes 'dead' code to be removed that should not.
We do expand +-* allowing LIBCALL_WIDEN which will for example
use DImode on x86_64 where the libgcc implementation then of course
traps on DImode overflow rather than whatever smaller mode we
were interested in.
We wrap the libcalls inside libcall notes using REG_EQUAL notes
which indicate the libcalls compute non-trapping +-* (there's no
RTX code for the trappingness), so we combine and simplify the
operations making the libcall possibly dead and remove it again.
Just to mention the few problems I stumbled over while looking
at PR19020 some time ago.