From patchwork Sun Jul 4 13:31:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 57843 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 29D2AB6F18 for ; Sun, 4 Jul 2010 23:31:30 +1000 (EST) Received: (qmail 32396 invoked by alias); 4 Jul 2010 13:31:29 -0000 Received: (qmail 32387 invoked by uid 22791); 4 Jul 2010 13:31:28 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam-dmz.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 04 Jul 2010 13:31:24 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 315B59AC7EC; Sun, 4 Jul 2010 15:31:22 +0200 (CEST) Date: Sun, 4 Jul 2010 15:31:22 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, rguenther@suse.de Subject: Fix cgraph reading seen in Mozila LTO build Message-ID: <20100704133122.GC22746@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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 Hi, mozilla build fails with streamer getting out of sync. This is because of input_edge condition ignoring edges for preemted nodes. This is wrong, since then we get out of sync reading bitpack and even if we fix that we get out of sync later reading jump functions. The overall idea always has been to read everythign it and then throw away stuff during merging. This patch and additional fix to lto-symtab lets me to build the Mozilla's javascript interpretter with LTO (but not with WHOPR because of unrelated bug elsewhere). Bootstrapped/regtested x86_64-linux, OK? Honza * lto-cgrah.c (input_edge): Do not care about resolution decisions. Index: lto-cgraph.c =================================================================== --- lto-cgraph.c (revision 161774) +++ lto-cgraph.c (working copy) @@ -1158,7 +1158,6 @@ input_edge (struct lto_input_block *ib, unsigned int nest; cgraph_inline_failed_t inline_failed; struct bitpack_d bp; - enum ld_plugin_symbol_resolution caller_resolution; int ecf_flags = 0; caller = VEC_index (cgraph_node_ptr, nodes, lto_input_sleb128 (ib)); @@ -1183,13 +1182,6 @@ input_edge (struct lto_input_block *ib, freq = (int) bp_unpack_value (&bp, HOST_BITS_PER_INT); nest = (unsigned) bp_unpack_value (&bp, 30); - /* If the caller was preempted, don't create the edge. - ??? Should we ever have edges from a preempted caller? */ - caller_resolution = lto_symtab_get_resolution (caller->decl); - if (caller_resolution == LDPR_PREEMPTED_REG - || caller_resolution == LDPR_PREEMPTED_IR) - return; - if (indirect) edge = cgraph_create_indirect_edge (caller, NULL, 0, count, freq, nest); else