From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25232 invoked by alias); 29 May 2010 00:34:36 -0000 Received: (qmail 25124 invoked by uid 48); 29 May 2010 00:34:16 -0000 Date: Sat, 29 May 2010 00:34:00 -0000 Message-ID: <20100529003416.25122.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/44300] Spurious array subscript warning, &b[0] == &a[1] is not folded In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "segher at kernel dot crashing 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: 2010-05/txt/msg03190.txt.bz2 ------- Comment #11 from segher at kernel dot crashing dot org 2010-05-29 00:34 ------- (In reply to comment #5) > Can you recommend an elegant way to rewrite this code to avoid the warning? static inline void foo(int *p) { if ((uintptr_t)p - (uintptr_t)(a + 1) < sizeof a - sizeof a[0]) { p[-1] = 0; } } -- segher at kernel dot crashing dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |segher at kernel dot | |crashing dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44300