From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10422 invoked by alias); 6 Jul 2007 04:12:45 -0000 Received: (qmail 10379 invoked by uid 48); 6 Jul 2007 04:12:35 -0000 Date: Fri, 06 Jul 2007 04:12:00 -0000 Message-ID: <20070706041235.10378.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/32628] [4.3 Regression] bogus integer overflow warning In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-07/txt/msg00711.txt.bz2 ------- 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