On Fri, 14 Nov 2014, Marek Polacek wrote:
> On Wed, Nov 12, 2014 at 11:53:19AM +0100, Richard Biener wrote:
> > Err - please adjust fold_negate_expr instead.
>
> Like this?
>
> (It's not best that for -trapv/-fsanitize=s-i-o we don't emit
> compile-time warning "integer overflow in expression" f
On Wed, Nov 12, 2014 at 11:53:19AM +0100, Richard Biener wrote:
> Err - please adjust fold_negate_expr instead.
Like this?
(It's not best that for -trapv/-fsanitize=s-i-o we don't emit
compile-time warning "integer overflow in expression" for -INT_MIN,
because the warning relies on the folding.)
On Wed, 12 Nov 2014, Marek Polacek wrote:
> On Tue, Nov 11, 2014 at 07:45:40PM +0100, Richard Biener wrote:
> > On November 11, 2014 6:49:34 PM CET, Jakub Jelinek wrote:
> > >On Tue, Nov 11, 2014 at 06:40:25PM +0100, Marek Polacek wrote:
> > >> --- gcc/fold-const.c
> > >> +++ gcc/fold-const.c
> >
On Tue, Nov 11, 2014 at 07:45:40PM +0100, Richard Biener wrote:
> On November 11, 2014 6:49:34 PM CET, Jakub Jelinek wrote:
> >On Tue, Nov 11, 2014 at 06:40:25PM +0100, Marek Polacek wrote:
> >> --- gcc/fold-const.c
> >> +++ gcc/fold-const.c
> >> @@ -7862,9 +7862,15 @@ fold_unary_loc (location_t l
On November 11, 2014 6:49:34 PM CET, Jakub Jelinek wrote:
>On Tue, Nov 11, 2014 at 06:40:25PM +0100, Marek Polacek wrote:
>> --- gcc/fold-const.c
>> +++ gcc/fold-const.c
>> @@ -7862,9 +7862,15 @@ fold_unary_loc (location_t loc, enum tree_code
>code, tree type, tree op0)
>>return fold_view_
On Tue, Nov 11, 2014 at 06:40:25PM +0100, Marek Polacek wrote:
> --- gcc/fold-const.c
> +++ gcc/fold-const.c
> @@ -7862,9 +7862,15 @@ fold_unary_loc (location_t loc, enum tree_code code,
> tree type, tree op0)
>return fold_view_convert_expr (type, op0);
>
> case NEGATE_EXPR:
> -
While match.pd has been changed to not transform -(-A) to A
when the overflow does not wrap or the signed integer ovreflow
checking is enabled, fold_negate_expr still happily does such
a transformation. That's bad because then we can't detect
an overflow, as on the following testcase. But I allow