This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/36575] [4.3/4.4 Regression] ACATS c460011 fails at -O3
- From: "ebotcazou at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Sep 2008 09:25:00 -0000
- Subject: [Bug ada/36575] [4.3/4.4 Regression] ACATS c460011 fails at -O3
- References: <bug-36575-7210@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from ebotcazou at gcc dot gnu dot org 2008-09-26 09:24 -------
> I would bet this is VRP triggered by more inlining.
It's constant-folding triggered by more inlining, this already fails at -O0:
procedure P is
type Unsigned_Over_8 is mod 2**8+2;
type Signed_Over_8 is range -200 .. 200;
procedure Assert(Truth: Boolean) is
begin
if not Truth then
raise Program_Error;
end if;
end;
type Decim is delta 0.1 digits 5;
Halfway : Decim := 2.5;
Neg_Half : Decim := -2.5;
Big : Unsigned_Over_8;
Also_Big : Signed_Over_8;
begin
Big := Unsigned_Over_8 (Halfway); -- Rounds up by 4.6(33).
Assert(Big = 3);
Also_Big := Signed_Over_8 (Halfway); -- Rounds up by 4.6(33).
Assert(Also_Big = 3);
Also_Big := Signed_Over_8 (Neg_Half); -- Rounds down by 4.6(33).
Assert(Also_Big = -3);
end;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36575