Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gcc/dist/gcc Gcc emit overflows warnings on VA...



details:   https://anonhg.NetBSD.org/src/rev/24bf513adf0e
branches:  trunk
changeset: 773547:24bf513adf0e
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Feb 05 17:43:47 2012 +0000

description:
Gcc emit overflows warnings on VAX when you try to use HUGE_VAL.  Make these
warning supressable if -Wno-overflow is given.

diffstat:

 external/gpl3/gcc/dist/gcc/c-lex.c |  33 ++++++++++++++++++---------------
 1 files changed, 18 insertions(+), 15 deletions(-)

diffs (44 lines):

diff -r d7578868cbfc -r 24bf513adf0e external/gpl3/gcc/dist/gcc/c-lex.c
--- a/external/gpl3/gcc/dist/gcc/c-lex.c        Sun Feb 05 17:40:48 2012 +0000
+++ b/external/gpl3/gcc/dist/gcc/c-lex.c        Sun Feb 05 17:43:47 2012 +0000
@@ -718,22 +718,25 @@
      outside the range of representable values of its type.  Since we
      have __builtin_inf* to produce an infinity, this is now a
      mandatory pedwarn if the target does not support infinities.  */
-  if (REAL_VALUE_ISINF (real)
-      || (const_type != type && REAL_VALUE_ISINF (real_trunc)))
+  if (warn_overflow)
     {
-      if (!MODE_HAS_INFINITIES (TYPE_MODE (type)))
-       pedwarn (input_location, 0, "floating constant exceeds range of %qT", type);
-      else
-       warning (OPT_Woverflow, "floating constant exceeds range of %qT", type);
-    }
-  /* We also give a warning if the value underflows.  */
-  else if (REAL_VALUES_EQUAL (real, dconst0)
-          || (const_type != type && REAL_VALUES_EQUAL (real_trunc, dconst0)))
-    {
-      REAL_VALUE_TYPE realvoidmode;
-      int overflow = real_from_string (&realvoidmode, copy);
-      if (overflow < 0 || !REAL_VALUES_EQUAL (realvoidmode, dconst0))
-       warning (OPT_Woverflow, "floating constant truncated to zero");
+      if (REAL_VALUE_ISINF (real)
+          || (const_type != type && REAL_VALUE_ISINF (real_trunc)))
+        {
+         if (!MODE_HAS_INFINITIES (TYPE_MODE (type)))
+           pedwarn (input_location, 0, "floating constant exceeds range of %qT", type);
+         else
+           warning (OPT_Woverflow, "floating constant exceeds range of %qT", type);
+       }
+      /* We also give a warning if the value underflows.  */
+      else if (REAL_VALUES_EQUAL (real, dconst0)
+              || (const_type != type && REAL_VALUES_EQUAL (real_trunc, dconst0)))
+       {
+         REAL_VALUE_TYPE realvoidmode;
+         int overflow = real_from_string (&realvoidmode, copy);
+         if (overflow < 0 || !REAL_VALUES_EQUAL (realvoidmode, dconst0))
+           warning (OPT_Woverflow, "floating constant truncated to zero");
+       }
     }
 
   /* Create a node with determined type and value.  */



Home | Main Index | Thread Index | Old Index