This is the mail archive of the
mailing list for the GCC project.
Re: Bootstrap failure on trunk: x86_64-linux-gnu
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: law at redhat dot com
- Cc: dewar at gnat dot com, gcc at gcc dot gnu dot org
- Date: Tue, 28 Feb 06 22:08:00 EST
- Subject: Re: Bootstrap failure on trunk: x86_64-linux-gnu
We have a loop with the following termination code in uintp.num_bits
This sure looks like a bug in Num_Bits to me, not in the compilation
of the front-end.
The relevant code is:
function Num_Bits (Input : Uint) return Nat is
Bits : Nat;
Num : Nat;
if UI_Is_In_Int_Range (Input) then
Num := abs (UI_To_Int (Input));
Bits := 0;
This code only works for one-complement machines, since it assumes a
symmetric range for Int. It breaks when UI_To_Int returns Integer'First, as
it did in this case. When it does, the abs produces an erroneous result
(since checking is disabled). So it almost doesn't matter what it puts into
Num (but it actually puts in an out-of-range value there too).
Robert, what's the proper fix here?