From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16353 invoked by alias); 19 Apr 2006 15:13:36 -0000 Received: (qmail 16329 invoked by uid 48); 19 Apr 2006 15:13:32 -0000 Date: Wed, 19 Apr 2006 15:13:00 -0000 Message-ID: <20060419151332.16328.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/27214] The C frontend introduces undefined pointer overflow In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-04/txt/msg01544.txt.bz2 List-Id: ------- Comment #2 from rguenth at gcc dot gnu dot org 2006-04-19 15:13 ------- "-CST" in this case is unsigned 4294967292, it just happens to be printed as -4B. So the addition wraps, as it is done using unsigned arithmetic. Writing char *foo(char *p) { return p + 4294967292; } results in the same D.1523 = p + -4B; but the above source would be invalid due to the wrapping pointer. Now the middle-end in some places assumes/assumed that pointers do not wrap. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27214