Re: [PATCH][20/n] Remove GENERIC stmt combining from SCCVN

2015-09-15 Thread Eric Botcazou
> > That's old code and the comment makes it quite clear why this is done > > though. > > Yeah, but then here "we don't need to evaluate it just for the check" > applies - the check is dead code as the outer comparison is always > false. I think what the code in the Ada frontend tries to achieve >

Re: [PATCH][20/n] Remove GENERIC stmt combining from SCCVN

2015-09-14 Thread Richard Biener
On Mon, 14 Sep 2015, Eric Botcazou wrote: > > Ok, so it's folding > > > > x == 127 ? .gnat_rcheck_CE_Overflow_Check ("overflow_sum3.adb", 14);, 0 : > > (short_short_integer) x + 1 > > > > <= 127 > > > > where op0 (the COND_EXPR) does not have TREE_SIDE_EFFECTS set but > > its operand 1 has: > >

Re: [PATCH][20/n] Remove GENERIC stmt combining from SCCVN

2015-09-14 Thread Eric Botcazou
> Ok, so it's folding > > x == 127 ? .gnat_rcheck_CE_Overflow_Check ("overflow_sum3.adb", 14);, 0 : > (short_short_integer) x + 1 > > <= 127 > > where op0 (the COND_EXPR) does not have TREE_SIDE_EFFECTS set but > its operand 1 has: > > (gdb) p debug_tree (op0) > type public visited QI >

Re: [PATCH][20/n] Remove GENERIC stmt combining from SCCVN

2015-09-14 Thread Eric Botcazou
> Still trying to reproduce, but I suppose you hit The testcase fails as of r227729 on x86-64/Linux. > /* Comparisons with the highest or lowest possible integer of > the specified precision will have known values. */ > (simplify > (cmp (convert?@2 @0) INTEGER_CST@1) > (if ((INTEGRAL_T

Re: [PATCH][20/n] Remove GENERIC stmt combining from SCCVN

2015-09-14 Thread Richard Biener
On Mon, 14 Sep 2015, Richard Biener wrote: > On Sat, 12 Sep 2015, Eric Botcazou wrote: > > > > * fold-const.c (fold_binary_loc): Move simplifying of comparisons > > > against the highest or lowest possible integer ... > > > * match.pd: ... as patterns here. > > > > This incorrectly dropped

Re: [PATCH][20/n] Remove GENERIC stmt combining from SCCVN

2015-09-14 Thread Richard Biener
On Sat, 12 Sep 2015, Eric Botcazou wrote: > > * fold-const.c (fold_binary_loc): Move simplifying of comparisons > > against the highest or lowest possible integer ... > > * match.pd: ... as patterns here. > > This incorrectly dropped the calls to omit_one_operand_loc, resulting in the

Re: [PATCH][20/n] Remove GENERIC stmt combining from SCCVN

2015-09-12 Thread Eric Botcazou
> * fold-const.c (fold_binary_loc): Move simplifying of comparisons > against the highest or lowest possible integer ... > * match.pd: ... as patterns here. This incorrectly dropped the calls to omit_one_operand_loc, resulting in the failure of the attached Ada test: if the oper

[PATCH][20/n] Remove GENERIC stmt combining from SCCVN

2015-07-24 Thread Richard Biener
This moves simplifying of comparisons against the highest or lowest possible integer. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. This needs the GENERIC code-gen fix, otherwise we miscompile GCC. Richard. 2015-07-24 Richard Biener * fold-const.c (fold_binary_loc