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

[Bug middle-end/32628] [4.3 Regression] bogus integer overflow warning



------- Comment #6 from pinskia at gcc dot gnu dot org  2007-07-06 04:12 -------
This patch is most likely better:
Index: fold-const.c
===================================================================
--- fold-const.c        (revision 126396)
+++ fold-const.c        (working copy)
@@ -2063,9 +2063,7 @@
      appropriately sign-extended or truncated.  */
   t = force_fit_type_double (type, TREE_INT_CST_LOW (arg1),
                             TREE_INT_CST_HIGH (arg1),
-                            /* Don't set the overflow when
-                               converting a pointer  */
-                            !POINTER_TYPE_P (TREE_TYPE (arg1)),
+                            0,
                             (TREE_INT_CST_HIGH (arg1) < 0
                              && (TYPE_UNSIGNED (type)
                                  < TYPE_UNSIGNED (TREE_TYPE (arg1))))



So don't set overflow for conversion.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32628


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