[Bug middle-end/32628] [4.3 Regression] bogus integer overflow warning
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Jul 6 04:12:00 GMT 2007
------- 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
More information about the Gcc-bugs
mailing list