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/23519] Dividing fixed point number by zero returns zero.


------- Additional Comments From laurent at guerby dot net  2005-08-22 20:42 -------
Could you try to add before "end g;" the following line:
   Ada.Text_IO.Put_Line (Boolean'Image (T'Machine_Overflows));

And report wether it prints True or False? On x86 and x86_64-linux it prints
True but I do get an exception (without -gnato as of 20050822).

>From the Ada RM

A.5.4 Attributes of Fixed Point Types

4     S'Machine_Overflows
              Yields the value True if overflow and divide-by-zero are
              detected and reported by raising Constraint_Error for every
              predefined operation that yields a result of the type T; yields
              the value False otherwise. The value of this attribute is of the
              predefined type Boolean.

I'm not sure what the compiler is supposed to do when Machine_Overflows is False.

Laurent

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


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


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