From patchwork Mon Jan 17 15:21:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 79191 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id AF179B70A9 for ; Tue, 18 Jan 2011 02:21:45 +1100 (EST) Received: (qmail 22707 invoked by alias); 17 Jan 2011 15:21:44 -0000 Received: (qmail 22695 invoked by uid 22791); 17 Jan 2011 15:21:43 -0000 X-SWARE-Spam-Status: No, hits=-5.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 Jan 2011 15:21:39 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0HFLbO4028209 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 17 Jan 2011 10:21:37 -0500 Received: from freie.oliva.athome.lsd.ic.unicamp.br (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p0HFLZEc016507 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 17 Jan 2011 10:21:37 -0500 Received: from livre.localdomain (livre-to-gw.oliva.athome.lsd.ic.unicamp.br [172.31.160.19]) by freie.oliva.athome.lsd.ic.unicamp.br (8.14.4/8.14.4) with ESMTP id p0HFLXQ6019323 for ; Mon, 17 Jan 2011 13:21:33 -0200 Received: from livre.localdomain (aoliva@localhost [127.0.0.1]) by livre.localdomain (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p0HFLW8s001468; Mon, 17 Jan 2011 13:21:32 -0200 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id p0HFLV1K001466; Mon, 17 Jan 2011 13:21:31 -0200 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Subject: Let c-parser.c build with g++ -O3 Date: Mon, 17 Jan 2011 13:21:31 -0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org For some reason g++ complains about an uninitialized variable where gcc doesn't. This patch fixes it. I'm checking it in as obvious unless someone objects in the next few hours. for gcc/ChangeLog from Alexandre Oliva * c-parser.c (c_parser_for_statement): Initialize collection_expression. Index: gcc/c-parser.c =================================================================== --- gcc/c-parser.c.orig 2011-01-13 08:36:59.862690502 -0200 +++ gcc/c-parser.c 2011-01-13 08:39:08.018939841 -0200 @@ -4763,7 +4763,9 @@ c_parser_for_statement (c_parser *parser { tree block, cond, incr, save_break, save_cont, body; /* The following are only used when parsing an ObjC foreach statement. */ - tree object_expression, collection_expression; + tree object_expression; + /* Silence the bogus uninitialized warning. */ + tree collection_expression = NULL; location_t loc = c_parser_peek_token (parser)->location; location_t for_loc = c_parser_peek_token (parser)->location; bool is_foreach_statement = false;