This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/23519] Dividing fixed point number by zero returns zero.
- From: "laurent at guerby dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Aug 2005 20:42:04 -0000
- Subject: [Bug ada/23519] Dividing fixed point number by zero returns zero.
- References: <20050822201829.23519.listor1.rombobeorn@comhem.se>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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