From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6325 invoked by alias); 15 Mar 2008 14:29:23 -0000 Received: (qmail 5350 invoked by alias); 15 Mar 2008 14:28:39 -0000 Date: Sat, 15 Mar 2008 14:29:00 -0000 Message-ID: <20080315142839.5349.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/35593] [4.3 Regression] spurious warning "array subscript is below array bounds" with void* function argument plus -O2 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-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg01292.txt.bz2 ------- Comment #3 from rguenth at gcc dot gnu dot org 2008-03-15 14:28 ------- Subject: Bug 35593 Author: rguenth Date: Sat Mar 15 14:27:55 2008 New Revision: 133249 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133249 Log: 2008-03-15 Richard Guenther PR middle-end/35593 * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Make sure to not produce negative array indices if not allowed. Add parameter to indicate that. (maybe_fold_offset_to_component_ref): Allow negative array indices only for the first member of a structure. (maybe_fold_offset_to_reference): Allow negative array indices. (maybe_fold_stmt_addition): Likewise. * g++.dg/warn/Warray-bounds-3.C: New testcase. Added: trunk/gcc/testsuite/g++.dg/warn/Warray-bounds-3.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-ccp.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35593