From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14796 invoked by alias); 19 Feb 2010 23:56:23 -0000 Received: (qmail 14749 invoked by uid 48); 19 Feb 2010 23:56:13 -0000 Date: Fri, 19 Feb 2010 23:56:00 -0000 Message-ID: <20100219235613.14748.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/35903] false Warray-bounds warning when passing quoted string to function strcmp(arg,"no"); In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "manu 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-02/txt/msg02003.txt.bz2 ------- Comment #9 from manu at gcc dot gnu dot org 2010-02-19 23:56 ------- This is not an uninitialized issue. The reason this requires -O2 is that -Warray-bounds requires VRP to warn. The gimple output already looks quite different. -funsigned-char: : [pr35903.i : 309:15] D.1567 = __s1D.796 + 3; [pr35903.i : 309:15] D.1568 = [pr35903.i : 309] *D.1567; [pr35903.i : 310:11] D.1569 = (intD.0) D.1568; [pr35903.i : 318:12] D.1570 = [pr35903.i : 311] &[pr35903.i : 311] "AA"[0] + 3; [pr35903.i : 318:12] D.1571 = [pr35903.i : 318] *D.1570; [pr35903.i : 310:11] D.1572 = (intD.0) D.1571; [pr35903.i : 308:10] __resultD.797 = D.1569 - D.1572; : : -fsigned-char : [pr35903.i : 309:15] D.1568 = __s1D.796 + 3; [pr35903.i : 309:15] D.1569 = [pr35903.i : 309] *D.1568; [pr35903.i : 310:11] D.1570 = (intD.0) D.1569; [pr35903.i : 311:12] D.1540 = (const unsigned charD.10 *) [pr35903.i : 318] "AA"; [pr35903.i : 318:12] D.1571 = D.1540 + 3; [pr35903.i : 318:12] D.1572 = [pr35903.i : 318] *D.1571; [pr35903.i : 310:11] D.1573 = (intD.0) D.1572; [pr35903.i : 308:10] __resultD.797 = D.1570 - D.1573; : : : -- manu at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- OtherBugsDependingO|24639 | nThis| | Summary|false uninitialized warning |false Warray-bounds warning |when passing quoted string |when passing quoted string |to function |to function |strcmp(arg,"no"); |strcmp(arg,"no"); http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35903