This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][20/n] Remove GENERIC stmt combining from SCCVN
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 12 Sep 2015 18:28:43 +0200
- Subject: Re: [PATCH][20/n] Remove GENERIC stmt combining from SCCVN
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1507241400450 dot 19642 at zhemvz dot fhfr dot qr>
> * 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 operand has side effects, you cannot
replace the entire comparison with just 'true' or 'false'.
* gnat.dg/overflow_sum3.adb: New test.
--
Eric Botcazou
-- { dg-do run }
-- { dg-options "-gnato" }
procedure Overflow_Sum3 is
function Ident (I : Integer) return Integer is
begin
return I;
end;
X : Short_Short_Integer := Short_Short_Integer (Ident (127));
begin
if X+1 <= 127 then
raise Program_Error;
end if;
exception
when Constraint_Error => null;
end;