From patchwork Thu Mar 20 16:41:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 332309 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9195C2C00B1 for ; Fri, 21 Mar 2014 03:43:35 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=W7ZIntqLq2luhfxgpqhGb1VEYLVDD0TvG09CmT0Ap7D mkeYZyzKzeOJ4UuRKd25FZ7ooAGnTNxh0G7H+oo5bhRoKQQqEATCaseNMS0DQ8t4 +9Mpfx+3YggnPQ8FT3Ph7gPsEVLy0BSEBzOeSS8Blqa3eum1Zgb6QDGo/W9cJD3I = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=8owaK3ylKhc5miXNry5pSbGg2Og=; b=UdxC8aqEQf/CQnfcg BOlB748jCFpz19AtKcHag5/8tVM4NeyodQP/b6PCIrnLHs4b38/wu33liK69gZeX 2zO2ICP7Gl2LlAJOCPyB/xN6SvCDDgRxEfbVay9AqvkfDRqn69s5twxCCHBiARVB dSngdAz5fV4vWLu75bxIHv1IWQ= Received: (qmail 20782 invoked by alias); 20 Mar 2014 16:43:28 -0000 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 Received: (qmail 20772 invoked by uid 89); 20 Mar 2014 16:43:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 20 Mar 2014 16:43:26 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1WQg3v-0003dX-3I from Bernd_Schmidt@mentor.com ; Thu, 20 Mar 2014 09:43:23 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 20 Mar 2014 09:43:22 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Thu, 20 Mar 2014 16:43:21 +0000 Message-ID: <532B1A30.8050307@codesourcery.com> Date: Thu, 20 Mar 2014 17:41:20 +0100 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: GCC Patches CC: Ilya Verbin , Michael Zolotukhin Subject: [gomp4] Use OMP_SECTION_NAME_PREFIX in offload compilers This makes us read in the offloaded functions in an offload compiler's lto1. This is essentially Michael Zolotukhin's patch 1/3 from a while ago. Committed on gomp-4_0-branch. Bernd Index: gcc/lto/ChangeLog =================================================================== --- gcc/lto/ChangeLog (revision 208720) +++ gcc/lto/ChangeLog (working copy) @@ -1,5 +1,11 @@ 2014-03-20 Bernd Schmidt + From Michael Zolotukhin. + * lto-object.c (lto_obj_add_section): Compare against the + section_name_prefix variable. + * lto.c (lto_section_with_id): Likewise. + (read_cgraph_and_symbols): Change it if ACCEL_COMPILER. + * lto-object.c: Include "lto-section-names.h". (LTO_SEGMENT_NAME): Don't define. * lto.c: Include "lto-section-names.h". Index: gcc/lto/lto-object.c =================================================================== --- gcc/lto/lto-object.c (revision 208720) +++ gcc/lto/lto-object.c (working copy) @@ -230,8 +230,7 @@ lto_obj_add_section (void *data, const c void **slot; struct lto_section_list *list = loasd->list; - if (strncmp (name, LTO_SECTION_NAME_PREFIX, - strlen (LTO_SECTION_NAME_PREFIX)) != 0) + if (strncmp (name, section_name_prefix, strlen (section_name_prefix))) return 1; new_name = xstrdup (name); Index: gcc/lto/lto.c =================================================================== --- gcc/lto/lto.c (revision 208720) +++ gcc/lto/lto.c (working copy) @@ -2128,7 +2128,7 @@ lto_section_with_id (const char *name, u { const char *s; - if (strncmp (name, LTO_SECTION_NAME_PREFIX, strlen (LTO_SECTION_NAME_PREFIX))) + if (strncmp (name, section_name_prefix, strlen (section_name_prefix))) return 0; s = strrchr (name, '.'); return s && sscanf (s, "." HOST_WIDE_INT_PRINT_HEX_PURE, id) == 1; @@ -2903,6 +2903,10 @@ read_cgraph_and_symbols (unsigned nfiles timevar_push (TV_IPA_LTO_DECL_IN); +#ifdef ACCEL_COMPILER + section_name_prefix = OMP_SECTION_NAME_PREFIX; +#endif + real_file_decl_data = decl_data = ggc_alloc_cleared_vec_lto_file_decl_data_ptr (nfiles + 1); real_file_count = nfiles;