This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: New no-undefined-overflow branch
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 27 Feb 2009 00:08:34 +0100
- Subject: Re: New no-undefined-overflow branch
- References: <alpine.LNX.2.00.0902261204410.11836@zhemvz.fhfr.qr>
Hi,
in general, I like this proposal a lot. However,
> As a start there will be no-overflow variants of NEGATE_EXPR,
> PLUS_EXPR, MINUS_EXPR, MULT_EXPR and POINTER_PLUS_EXPR.
>
> The sizetypes will simply be operated on in no-overflow variants
> by default (by size_binop and friends).
>
> Naming suggestions welcome, at the moment I consider NEGATEV_EXPR
> (thus appending V to the first part).
introducing new codes seems like a bad idea to me. There are many
places that do not care about the distinction between PLUS_EXPR and
PLUSV_EXPR, and handling both cases will complicate the code (see eg.
the problems caused by introducing POINTER_PLUS_EXPR vs PLUS_EXPR
distinction). Why not just use a flag to mark the operation as
non-overflowing?
Zdenek