This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ada/12052] New: ada program fails to print floatingpoint numbers


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12052

           Summary: ada program fails to print floatingpoint numbers
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: olle at cb dot uu dot se
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: def-alpha-osf5.1
  GCC host triplet: dec-alpha-osf5.1
GCC target triplet: dec-alpha-osf5.1

When running the attached ada-program, it fails to print the floating point values.

This is 3.3.1 usingHP Tru64 UNIX 5.1B

It was bootstrapped using gnat 3.14p.

setenv ADAC /usr/local/gnat-3.14/bin/gcc
../gcc-3.3.1/configure --enable-libgcj alpha-dec-osf5.1


The program runs OK compiled with gnat-3.14p

> cat print_roots.adb
With TEXT_IO,ADA,ADA.NUMERICS.GENERIC_ELEMENTARY_FUNCTIONS;
Procedure Print_roots is
   use Text_IO,ADA;
   Package Math is new NUMERICS.GENERIC_ELEMENTARY_FUNCTIONS(Long_Float);
   Package Flt_IO is new Float_IO(Long_Float);
   use Flt_IO,Math;
   R,X : Long_Float;
begin
   X := 2.0;
   Put("Roots of various numbers ");
   Put(X,5,2);
   New_line(2);
   Loop
      Begin
         Get(X);
         Exit When X = 0.0;
         R := Sqrt(X);
         Put("Root of ");
         Put(X);
         Put(" is ");
         Put(R);
         New_Line;
      Exception
         When Data_Error => Put("Data Error");New_Line;skip_line;
      End;
   End Loop;
   New_line;
   Put("Program finished");
   New_Line;
End Print_Roots;

> gcc -v
Reading specs from /usr/local/lib/gcc-lib/alpha-dec-osf5.1/3.3.1/specs
Configured with: ../gcc-3.3.1/configure --enable-libgcj alpha-dec-osf5.1
Thread model: single
gcc version 3.3.1

> gnat make print_roots.adb
gcc -c print_roots.adb
gnatbind -x print_roots.ali
gnatlink print_roots.ali
> print_roots
Roots of various numbers    -0.00E+00

5
Root of -0.00000000000000E+00 is -0.00000000000000E+00
4
Root of -0.00000000000000E+00 is -0.00000000000000E+00
0

Program finished

--------------------------
Trying gnat 3.14p instead
--------------------------

> set path=(/usr/local/gnat-3.14/bin $path)
> gnat make print_roots.adb
gcc -c print_roots.adb
gnatbind -x print_roots.ali
gnatlink print_roots.ali
> print_roots
Roots of various numbers     2.00E+00

4
Root of  4.00000000000000E+00 is  2.00000000000000E+00
5
Root of  5.00000000000000E+00 is  2.23606797749979E+00
0

Program finished
> exit
> exit

Process shell finished


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]