Bug#148529: gnat-3.1: sin/cos is random exception/result generator
Package: gnat-3.1
Version: 1:3.1-2
Followup-For: Bug #148529
The following code is the same as before, except with 2 extra lines:
--- CUT ---
with Ada.Text_IO;
use Ada.Text_IO;
with Ada.Numerics;
use Ada.Numerics;
with Ada.Numerics.Generic_Elementary_Functions;
procedure TestBug2 is
type F is new Float;
subtype Radians is F;
package Maths is new Generic_Elementary_Functions(F);
use Maths;
begin
Ada.Text_IO.Put_Line(F'Image(Sin(5.49779)));
Ada.Text_IO.Put_Line(F'Image(Sin(0.0*pi)));
Ada.Text_IO.Put_Line(F'Image(Sin(1.0*pi)));
Ada.Text_IO.Put_Line(F'Image(Sin(2.0*pi)));
Ada.Text_IO.Put_Line(F'Image(Sin(5.49779)));
end TestBug2;
--- CUT ---
If I comment out any 2 of the Put_Line calls (even the last two), the
program works but gives bad results (ie. 0).
If I run the program as is, it doesn't get past the first line:
[625] [scrooge:bam] ~/tmp/ada/testbug >./testbug2
raised CONSTRAINT_ERROR : s-imgrea.adb:236
(which is funny in a way, I don't see where this function is getting
called)
I find it really troubling that commenting out the last two lines
causes it to crash on the first line, and until it is fixed, I consider
the compiler to be badly broken.
Of course, the previous gnat works without any problems:
[629] [scrooge:bam] ~/tmp/ada/testbug >./testbug2
-7.07105E-01
0.00000E+00
-8.74228E-08
1.74846E-07
-7.07105E-01
...however both versions of the compiler seem to be buggy, as reported
in my other bug reports (bug #147145 applies to both versions).
Is the quality of the Gnat compiler likely to improve any time in the
not-too-distant future, or should I be concentrating my efforts for the
moment at least on other languages?
-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux scrooge 2.4.18 #1 Wed Apr 3 13:18:14 EST 2002 i686
Locale: LANG=C, LC_CTYPE=
Versions of packages gnat-3.1 depends on:
ii gcc-3.1 1:3.1-2 The GNU C compiler.
ii gcc-3.1-base 1:3.1-2 The GNU Compiler Collection (base
ii libc6 2.2.5-6 GNU C Library: Shared libraries an
ii libgnat3.15a 1:3.1-2 Runtime library for GNU Ada applic
--
To UNSUBSCRIBE, email to debian-gcc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: