From patchwork Mon May 30 09:46:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 97897 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 2265FB6F57 for ; Mon, 30 May 2011 19:50:26 +1000 (EST) Received: (qmail 14369 invoked by alias); 30 May 2011 09:50:23 -0000 Received: (qmail 14358 invoked by uid 22791); 30 May 2011 09:50:23 -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:50:05 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4U9o4Ho024909 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 30 May 2011 05:50:04 -0400 Received: from freie.oliva.athome.lsd.ic.unicamp.br (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p4U9o19M016239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 30 May 2011 05:50:03 -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 p4U9np06006834 for ; Mon, 30 May 2011 06:49:51 -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 p4U9kjY2027756; Mon, 30 May 2011 06:46:45 -0300 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id p4U9kQwg027755; Mon, 30 May 2011 06:46:26 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Subject: initialized out.clauses in read_predicate Date: Mon, 30 May 2011 06:46:26 -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 In an -O3 bootstrap, out.clauses are reported as uninitialized. GCC is not smart enough to realize accesses to the uninitialized members will never happen. It shouldn't be too expensive to initialize them all, so this is what this patch does. Regstrapped on x86_64-linux-gnu and i686-linux-gnu. Ok to install? for gcc/ChangeLog from Alexandre Oliva * ipa-inline-analysis.c (read_predicate): Initialize all clauses. Index: gcc/ipa-inline-analysis.c =================================================================== --- gcc/ipa-inline-analysis.c.orig 2011-05-18 03:29:08.295328903 -0300 +++ gcc/ipa-inline-analysis.c 2011-05-18 03:29:38.187242177 -0300 @@ -2289,6 +2289,11 @@ read_predicate (struct lto_input_block * clause = out.clause[k++] = lto_input_uleb128 (ib); } while (clause); + + /* Zero-initialize the remaining clauses in OUT. */ + while (k <= MAX_CLAUSES) + out.clause[k++] = 0; + return out; }