This is the mail archive of the gcc-patches@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]

[PATCH] catch overflow for dfp->dfp conversions


Check for overflow after a conversion between decimal float types.  This
lets gcc.dg/dfp/fe-convert-1.c pass for dpd runtime support.

Tested on powerpc64-linux, checked into mainline as obvious.

2007-08-22  Janis Johnson  <janis187@us.ibm.com>

	* config/dfp-bit.c (DFP_TO_DFP): Check for overflow.

Index: gcc/config/dfp-bit.c
===================================================================
--- gcc/config/dfp-bit.c	(revision 127709)
+++ gcc/config/dfp-bit.c	(working copy)
@@ -414,7 +414,8 @@
     {
       /* decNumber exception flags we care about here.  */
       int ieee_flags;
-      int dec_flags = DEC_IEEE_854_Inexact | DEC_IEEE_854_Invalid_operation;
+      int dec_flags = DEC_IEEE_854_Inexact | DEC_IEEE_854_Invalid_operation
+		      | DEC_IEEE_854_Overflow;
       dec_flags &= context.status;
       ieee_flags = DFP_IEEE_FLAGS (dec_flags);
       if (ieee_flags != 0)



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