From patchwork Fri Apr 20 21:13:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rong Xu X-Patchwork-Id: 154165 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 E1AD2B6FC9 for ; Sat, 21 Apr 2012 07:13:46 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1335561228; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:To:Subject:Message-Id:Date: From:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=SXqc6BO TK6WgcyhWINBCtSO4rhY=; b=ds7FW0aG3LMwaBC3aY71kmwuKN0wckiVrg31wAW Gj8SmPsMKw9/lFd4sxajdlGPpYd3TBGdDGXgtFn+mVA4Z+HfZwVxFtACLkhbKX9c 3rfsQjb/LDCJOWGhXsDMyXCADL3hkycHFQ51Lm6b17VVl6O+Nrd1q1IX8eB0JbZK CDEM= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:Received:Received:Received:To:Subject:Message-Id:Date:From:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=M1rGvF/7bPk0PhMv2/5bUhq+M3cnXxqj70C8+5gqqBGxKdhHn3oiDIlDugb+mn uQLpvRZNF9yW2i3RHailKZbCEkj++Z4UUo619IVg/02Nhr2ISacXpWr6M5ogoPS8 it0A4+UsiqOlzBEAc8w9rAAn5DE4HOW2PVBNeknyDRVtY=; Received: (qmail 31026 invoked by alias); 20 Apr 2012 21:13:42 -0000 Received: (qmail 31016 invoked by uid 22791); 20 Apr 2012 21:13:41 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-gy0-f201.google.com (HELO mail-gy0-f201.google.com) (209.85.160.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 Apr 2012 21:13:25 +0000 Received: by ghbg15 with SMTP id g15so1143400ghb.2 for ; Fri, 20 Apr 2012 14:13:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=to:subject:message-id:date:from:x-gm-message-state; bh=oqEffOnpDTMsxjUU31EThLRVVTTPu0xp9ZCWBnc+cnI=; b=iR9tLFtgY6bCd9VfGHuykPcQTzvgh+VmukAOAoGjQt+wcfNI256wVd1iDT1wHj98Ak o+krPMlsmPft5QFYebUSXevi7IuVlN9YsLObO1GNwvyRoI+yZVFBcFPxoI9O1tOAe8LT t+mNSYfCibTa3+ySmmEfhKFcpZVgKEt5klpFL3y4CiNv/eOQbb17xGIsUf0bDnhrh5g7 QQuci9BSJPwq3+3MuyRUP7O36svD4GnKvA45M6Ec2irECUmUpRdjMUUgdEKI34NuQdPk ViS6sRXwMkRbPuDGX3dZneJy0X5KZmAaFKXcguNEc/BTb2E9osXxPmiMOeZN91DH2CN9 YE0w== Received: by 10.236.76.4 with SMTP id a4mr9840830yhe.2.1334956405073; Fri, 20 Apr 2012 14:13:25 -0700 (PDT) Received: by 10.236.76.4 with SMTP id a4mr9840819yhe.2.1334956405003; Fri, 20 Apr 2012 14:13:25 -0700 (PDT) Received: from wpzn4.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id j51si6454620yhi.1.2012.04.20.14.13.24 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 20 Apr 2012 14:13:25 -0700 (PDT) Received: from rong.mtv.corp.google.com (rong.mtv.corp.google.com [172.18.110.233]) by wpzn4.hot.corp.google.com (Postfix) with ESMTP id DFFA01E04E5; Fri, 20 Apr 2012 14:13:24 -0700 (PDT) Received: by rong.mtv.corp.google.com (Postfix, from userid 104659) id 69D86C1B73; Fri, 20 Apr 2012 14:13:19 -0700 (PDT) To: reply@codereview.appspotmail.com, davidxl@google.com, gcc-patches@gcc.gnu.org Subject: [google-4_6] disable localization of hidden symbols in streaming LIPO (issue6101045) Message-Id: <20120420211319.69D86C1B73@rong.mtv.corp.google.com> Date: Fri, 20 Apr 2012 14:13:19 -0700 (PDT) From: xur@google.com (Rong Xu) X-Gm-Message-State: ALoCoQmtHh7fDRRXaSmo458Hxg3seJoyZwOgm8reHI0e+F5mKfCqroNt2qtDiN2kwy7dxwnQBCLI/lReltv1d4WcW2vJRfLmkHEjmS/0zN5cx6aer/7tGu6UjERYkHuTex6ikBn6AlTCiv1r6pOfYSI/6w7bIT3Zam4otDC7EFbd8vympK0e09g= X-IsSubscribed: yes 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, This patch is for google-4_6 branch only. It disables the localization of hidden and internal symbols in streaming LIPO. Otherwise, we may have undefines in link time because of the reference in other module that is not include the define module into module group. Tested with google internal benchmarks, gcc regression and bootstrap. Thanks, -Rong 2012-04-20 Rong Xu * gcc/ipa.c (cgraph_externally_visible_p): Not localize hidden symbols in streaming LIPO. (varpool_externally_visible_p): Ditto. --- This patch is available for review at http://codereview.appspot.com/6101045 Index: gcc/ipa.c =================================================================== --- gcc/ipa.c (revision 186600) +++ gcc/ipa.c (working copy) @@ -790,7 +790,9 @@ cgraph_externally_visible_p (struct cgraph_node *n return false; /* When doing link time optimizations, hidden symbols become local. */ - if (in_lto_p + /* Disable this in streaming LIPO, as the defition may not be seen by all + the references. */ + if (in_lto_p && !flag_ripa_stream && (DECL_VISIBILITY (node->decl) == VISIBILITY_HIDDEN || DECL_VISIBILITY (node->decl) == VISIBILITY_INTERNAL) /* Be sure that node is defined in IR file, not in other object @@ -885,7 +887,9 @@ varpool_externally_visible_p (struct varpool_node return false; /* When doing link time optimizations, hidden symbols become local. */ - if (in_lto_p + /* Disable this in streaming LIPO, as the defition may not be seen by all + the references. */ + if (in_lto_p && !flag_ripa_stream && (DECL_VISIBILITY (vnode->decl) == VISIBILITY_HIDDEN || DECL_VISIBILITY (vnode->decl) == VISIBILITY_INTERNAL) /* Be sure that node is defined in IR file, not in other object