This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][4.3] Deprecate -ftrapv
On Sat, 1 Mar 2008, Joseph S. Myers wrote:
> On Fri, 29 Feb 2008, Mark Mitchell wrote:
> > Thanks for the explanations. It seems like tree-ssa should in theory make it
> > easier to implement this; for example, at the point of gimplification one
> > could insert checks, and then just let everything else do its thing. I don't
> > see how libcalls and such would matter in that scheme. I'm not denying that
> > this is a project, though.
> Obviously you need to keep the functions in libgcc in any event for the
> sake of old object code (just as we keep __eprintf there), even if you
> make GCC generate inline code rather than libcalls or remove the option
> You also need to deal with fold, which will optimize away potentially
> trapping computations with -ftrapv and runs before gimplification
> (possibly in association with making fold run at gimplification time and
> not before).
It should not - at least we have various tests in place to ensure fold
does not remove traps nor insert traps. Of course this is a very badly
tested part of the compiler, so possibly both may happen.