From patchwork Mon May 30 09:51:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 97898 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 44560B6F64 for ; Mon, 30 May 2011 19:55:27 +1000 (EST) Received: (qmail 17716 invoked by alias); 30 May 2011 09:55:25 -0000 Received: (qmail 17678 invoked by uid 22791); 30 May 2011 09:55:24 -0000 X-SWARE-Spam-Status: No, hits=-5.7 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, 30 May 2011 09:55:10 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4U9tAgr026373 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 30 May 2011 05:55:10 -0400 Received: from freie.oliva.athome.lsd.ic.unicamp.br (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p4U9t5aO026756 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 30 May 2011 05:55:08 -0400 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 p4U9t3xU007148 for ; Mon, 30 May 2011 06:55:04 -0300 Received: from livre.localdomain (aoliva@localhost.localdomain [127.0.0.1]) by livre.localdomain (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p4U9pw8L027788; Mon, 30 May 2011 06:51:58 -0300 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id p4U9puxc027787; Mon, 30 May 2011 06:51:56 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Subject: Initialize previous in read_state_param_structs Date: Mon, 30 May 2011 06:51:56 -0300 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 Bootstrap-O3 complains about uninitialized uses of this variable in gengtype-state.c. The variable can never actually be used before initialization, but GCC is not smart enough to realize that. read_state_structures, just before the function at hand, has a similar loop and it zero-initializes both head and previous, so I adjusted the affected function to follow the same pattern and avoid the bogus warning. Regstrapped on x86_64-linux-gnu and i686-pc-linux-gnu. Ok to install? for gcc/ChangeLog from Alexandre Oliva * gengtype-state.c (read_state_params_structs): Initialize previous. Index: gcc/gengtype-state.c =================================================================== --- gcc/gengtype-state.c.orig 2011-05-18 05:02:28.341594395 -0300 +++ gcc/gengtype-state.c 2011-05-18 05:02:32.710587356 -0300 @@ -2137,7 +2137,7 @@ read_state_param_structs (type_p *param_ int nbparamstructs = 0; int countparamstructs = 0; type_p head = NULL; - type_p previous; + type_p previous = NULL; type_p tmp; struct state_token_st *t0 = peek_state_token (0); struct state_token_st *t1 = peek_state_token (1);