This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] catch overflow for dfp->dfp conversions
- From: Janis Johnson <janis187 at us dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 22 Aug 2007 10:17:55 -0700
- Subject: [PATCH] catch overflow for dfp->dfp conversions
- Reply-to: janis187 at us dot ibm dot com
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)