------- Comment #1 from laurent at guerby dot net 2006-01-03 19:44 -------
The Ada runtime does not use C complex primitives. In this case, the culprit in
all three case is likely to be the following code in ada/a-ngelfu.adb
------------
-- Arctan --
------------
-- Natural cycle
function Arctan
(Y : Float_Type'Base;
X : Float_Type'Base := 1.0)
return Float_Type'Base
is
begin
if X = 0.0
and then Y = 0.0
then
raise Argument_Error;
elsif Y = 0.0 then
if X > 0.0 then
return 0.0;
else -- X < 0.0
return Pi * Float_Type'Copy_Sign (1.0, Y);
end if;
elsif X = 0.0 then
if Y > 0.0 then
return Half_Pi;
else -- Y < 0.0
return -Half_Pi;
end if;
else
return Local_Atan (Y, X);
end if;
end Arctan;
In all three failing case (log, cos,, we end up calling Log(-1.0) which calls
Arctan (Y => 0.0, X => -1.0) which ends up in the
return Pi * Float_Type'Copy_Sign (1.0, Y);
case, so I assume 'Copy_Sign is broken in this case, Dave could you try the
following small program with your hppa-linux 4.0.x GCC:
[EMAIL PROTECTED]:~/tmp/pr20754> cat > p.adb
with ada.text_io; use ada.text_io;
procedure p is
begin
put_line(long_float'copy_sign(1.0,0.0)'img);
end p;
[EMAIL PROTECTED]:~/tmp/pr20754> gnatmake p
gcc -c p.adb
gnatbind -x p.ali
gnatlink p.ali
[EMAIL PROTECTED]:~/tmp/pr20754> ./p
1.00000000000000E+00
Laurent
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20754