From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27953 invoked by alias); 27 Apr 2008 00:44:12 -0000 Received: (qmail 27939 invoked by uid 22791); 27 Apr 2008 00:44:10 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 27 Apr 2008 00:43:53 +0000 Received: (qmail 11325 invoked from network); 27 Apr 2008 00:43:51 -0000 Received: from unknown (HELO ?192.168.0.2?) (mitchell@127.0.0.2) by mail.codesourcery.com with ESMTPA; 27 Apr 2008 00:43:51 -0000 Message-ID: <4813CC38.40907@codesourcery.com> Date: Sun, 27 Apr 2008 14:56:00 -0000 From: Mark Mitchell User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Simon Baldwin CC: gcc-patches@gcc.gnu.org, Richard Guenther , Dirk Mueller , "Joseph S. Myers" Subject: Re: [PATCH][RFC] Add a subset of -Warray-bounds warnings to C/C++ front ends References: <20080404000715.3C75741AB58@localhost> <84fc9c000804040241l98b2f6esd052290fa66b4303@mail.gmail.com> <47FBC58A.5020702@codesourcery.com> <47FFC01A.6050000@google.com> <48124DC3.5080508@google.com> In-Reply-To: <48124DC3.5080508@google.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2008-04/txt/msg01990.txt.bz2 Simon Baldwin wrote: > Thanks to a well targeted pointer from Tom Tromey, I've now added the > extra logic to suppress warnings about "sizeof(a[-1])" in the C and C++ > frontends. Attached is the revised version. Thanks for following up. I think this is a worthwhile patch. > +This option performs a subset of checks in unoptimized compilations, and > +stricter checking when @option{-ftree-vrp} is active > (default for -O2 and above). I think "stricter" could be made more explicit. How about something like: This option detects some cases of out-of-bounds accesses in unoptimized compilations. More cases are detected when @option{-ftree-vrp} is enabled. (The @option{-ftree-vrp} option is enabled automatically when compiling with @option{-O2} or higher optimization options.) Joseph, do you have any comments on the C changes? Simon, if you do not hear otherwise from Joseph within 72 hours, this patch is OK. Thanks, -- Mark Mitchell CodeSourcery mark@codesourcery.com (650) 331-3385 x713