From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 853 invoked by alias); 1 Jan 2010 22:42:12 -0000 Received: (qmail 813 invoked by uid 48); 1 Jan 2010 22:42:00 -0000 Date: Fri, 01 Jan 2010 22:42:00 -0000 Message-ID: <20100101224200.812.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/42577] array bounds false positive with -O3, goes away with -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: 2010-01/txt/msg00073.txt.bz2 ------- Comment #3 from rguenth at gcc dot gnu dot org 2010-01-01 22:42 ------- The array indexing is done with D.25175_104, but D.25173_102 = (uint16) cutawaySlot_256; D.25174_103 = D.25173_102 + 10; D.25175_104 = (int) D.25174_103; ... if (D.25174_103 > 9) goto ; else goto ; the actual check is done on D.25174_103. We do not add asserts for D.25175_104 on the edge to BB30. D.25174 is unsigned short. So we end up with D.25173_102: [0, 1] D.25174_103: [10, 11] D.25175_104: [10, 11] and warn for the access that is dominated by BB30. So the issue is that we warn for dead code. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42577