OSDN Git Service

* config/dfp-bits.c (DFP_TO_INT): Remove code to saturate result
authorjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Nov 2006 20:40:26 +0000 (20:40 +0000)
committerjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Nov 2006 20:40:26 +0000 (20:40 +0000)
  of conversion that doesn't fit.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119069 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/dfp-bit.c

index 74c9854..c32942e 100644 (file)
@@ -1,5 +1,8 @@
 2006-11-21  Janis Johnson  <janis187@us.ibm.com>
 
+       * config/dfp-bits.c (DFP_TO_INT): Remove code to saturate result
+       of conversion that doesn't fit.
+
        * config/dfp-bit.h (CONTEXT_TRAPS, CONTEXT_ERRORS, DFP_RAISE): Delete.
        * config/dfp-bit.c (dfp_unary_op, dfp_binary_op, dfp_compare_op,
        DFP_TO_DFP, INT_TO_DFP, BFP_TO_DFP): Remove calls to DFP_RAISE.
index fafe7dc..fc75a8b 100644 (file)
@@ -404,29 +404,6 @@ DFP_TO_INT (DFP_C_TYPE x)
   decNumberFromString (&qval, (char *) "1.0", &context);
   /* Force the exponent to zero.  */
   decNumberQuantize (&n1, &n2, &qval, &context);
-  /* This is based on text in N1107 section 5.1; it might turn out to be
-     undefined behavior instead.  */
-  if (context.status & DEC_Invalid_operation)
-    {
-#if defined (L_sd_to_si) || defined (L_dd_to_si) || defined (L_td_to_si)
-      if (decNumberIsNegative(&n2))
-        return INT_MIN;
-      else
-        return INT_MAX;
-#elif defined (L_sd_to_di) || defined (L_dd_to_di) || defined (L_td_to_di)
-      if (decNumberIsNegative(&n2))
-        /* Find a defined constant that will work here.  */
-        return (-9223372036854775807LL - 1LL);
-      else
-        /* Find a defined constant that will work here.  */
-        return 9223372036854775807LL;
-#elif defined (L_sd_to_usi) || defined (L_dd_to_usi) || defined (L_td_to_usi)
-      return UINT_MAX;
-#elif defined (L_sd_to_udi) || defined (L_dd_to_udi) || defined (L_td_to_udi)
-        /* Find a defined constant that will work here.  */
-      return 18446744073709551615ULL;
-#endif
-    }
   /* Get a string, which at this point will not include an exponent.  */
   decNumberToString (&n1, buf);
   /* Ignore the fractional part.  */