From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31031 invoked by alias); 19 Apr 2006 15:31:58 -0000 Received: (qmail 31017 invoked by uid 48); 19 Apr 2006 15:31:54 -0000 Date: Wed, 19 Apr 2006 15:31:00 -0000 Message-ID: <20060419153154.31016.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/msg01546.txt.bz2 List-Id: ------- Comment #4 from rguenth at gcc dot gnu dot org 2006-04-19 15:31 ------- How's that "the same"? Either you say that pointers follow unsigned integer types in overflow behavior (quote me the standard for that) or explain why p + -4 is treated as p + (char *)-4 but p - 4 is treated as p - (char *)4 which are different in overflow behavior as (char *) is "unsigned" as far as the middle-end concerns. I see 6.5.6/8 where it says If both the pointer operand and the result point to elements of the same array object, or one past the last element of the array object, the evaluation shall not produce an overflow; otherwise, the behavior is undefined. -- 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