From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7066 invoked by alias); 28 Nov 2015 09:37:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 7049 invoked by uid 89); 28 Nov 2015 09:36:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS 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; Sat, 28 Nov 2015 09:36:58 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1a2bw5-0002rb-AJ from Tom_deVries@mentor.com ; Sat, 28 Nov 2015 01:36:53 -0800 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.3.224.2; Sat, 28 Nov 2015 09:36:51 +0000 Subject: Re: [RFC] Getting LTO incremental linking work To: Jan Hubicka References: <20151125085912.GD58491@kam.mff.cuni.cz> <20151125191740.GB5371@kam.mff.cuni.cz> <20151125230758.GF20593@kam.mff.cuni.cz> CC: "H.J. Lu" , Richard Biener , GCC Patches , Andi Kleen , Cary Coutant , Ian Lance Taylor , Kirill Yukhin From: Tom de Vries Message-ID: <5659757A.2080700@mentor.com> Date: Sat, 28 Nov 2015 10:35:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151125230758.GF20593@kam.mff.cuni.cz> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2015-11/txt/msg03408.txt.bz2 On 26/11/15 00:07, Jan Hubicka wrote: > (flinker_output): New flag. Hi, this seems to have cause a regression when using a compiler configured for offloading (giving ~1000 fails in libgomp testing). For test-case libgomp.c/examples-4/array_sections-3.c, we enter run_gcc in lto-wrapper with args: ... Breakpoint 1, run_gcc (argc=4, argv=0x7fffffffde68) at src/gcc-gomp-4_0-branch/gcc/lto-wrapper.c:897 897 char *list_option_full = NULL; (gdb) p argv[0] $8 = 0x7fffffffe104 "lto-wrapper" (gdb) p argv[1] $9 = 0x7fffffffe1af "-fresolution=array_sections-3.res" (gdb) p argv[2] $10 = 0x7fffffffe1d1 "-flinker-output=exec" (gdb) p argv[3] $11 = 0x7fffffffe1e6 "array_sections-3.o" ... And here (cc-ing author of this bit) we decide that -flinker-output=exec is a file: ... /* If object files contain offload sections, but do not contain LTO sections, then there is no need to perform a link-time recompilation, i.e. lto-wrapper is used only for a compilation of offload images. */ if (have_offload && !have_lto) { for (i = 1; i < argc; ++i) if (strncmp (argv[i], "-fresolution=", sizeof ("-fresolution=") - 1)) { char *out_file; /* Can be ".o" or ".so". */ char *ext = strrchr (argv[i], '.'); if (ext == NULL) out_file = make_temp_file (""); else out_file = make_temp_file (ext); /* The linker will delete the files we give it, so make copies. */ copy_file (out_file, argv[i]); printf ("%s\n", out_file); } goto finish; } ... And try to copy it: ... Program received signal SIGSEGV, Segmentation fault. 0x00007ffff783d7e0 in feof () from /lib/libc.so.6 (gdb) bt #0 0x00007ffff783d7e0 in feof () from /lib/libc.so.6 #1 0x0000000000406ff5 in copy_file (dest=0x71cdd0 "/tmp/ccL6HCCe", src=0x7fffffffe1d1 "-flinker-output=exec") at lto-wrapper.c:769 #2 0x00000000004080b7 in run_gcc (argc=4, argv=0x7fffffffde68) at gcc/lto-wrapper.c:1109 #3 0x0000000000409873 in main (argc=4, argv=0x7fffffffde68) at gcc/lto-wrapper.c:1396 ... Thanks, - Tom