This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/32628] [4.3 Regression] bogus integer overflow warning
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jul 2007 04:12:35 -0000
- Subject: [Bug middle-end/32628] [4.3 Regression] bogus integer overflow warning
- References: <bug-32628-7834@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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