From patchwork Thu Apr 27 20:20:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 756124 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 3wDSyN50Jvz9s8W for ; Fri, 28 Apr 2017 06:21:14 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Tl0F2X4X"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=Kv/gERvK964e3HWobLfHdjmY9Xbo0 ehaL7TdUEC/DVYmrOX/56D/Tp3Bo/F6o9Hpj4VgET1vLsWtPajDgwfHQi2XwDBWK HhUYuM4MRSzofEqLof/7iQLxxwijQlsfaNWNhGx9nFQFS6+Z4Q+tsiXVnZOighFw doeb7C7VFIbTb4= 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:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; s=default; bh=vaAVTdhfI9QXcZhLSkrVH2C8P0w=; b=Tl0 F2X4XKZw2nrvmv6XBrYpudgD/Y9hrwZG8ptwJLeGxmT6dok6r6jtrWsUg3PhtNI4 1PaSLdGmLydxx0WwhuipPbhwn5qt/2i258sxnJ8ignUxAd/gQFrKA6IB5O4hdFL0 nELUlaQMWGQzST6Ej1qUuN0RQYXiKnqR5vRdK9sE= Received: (qmail 26576 invoked by alias); 27 Apr 2017 20:21:04 -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 26491 invoked by uid 89); 27 Apr 2017 20:21:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Apr 2017 20:21:02 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 088AA24852A; Thu, 27 Apr 2017 20:21:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 088AA24852A Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 088AA24852A Received: from tucnak.zalov.cz (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A79482746; Thu, 27 Apr 2017 20:21:01 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v3RKKxjs026839; Thu, 27 Apr 2017 22:20:59 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v3RKKvWL026838; Thu, 27 Apr 2017 22:20:57 +0200 Date: Thu, 27 Apr 2017 22:20:57 +0200 From: Jakub Jelinek To: David Edelsohn , David Malcolm , Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix AIX bootstrap comparison due to empty *-tests.c and selftest* files (PR bootstrap/80531) Message-ID: <20170427202057.GE1809@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes Hi! This is something that fails bootstrap newly in GCC 7 and only with (now on the branch default --enable-checking=release (or --disable-checking)). The problem is that the *-tests.c and selftest*.c sources after including some headers have the whole body guarded with #if CHECKING_P and with release checking thus there are no global symbols. symtab_node::debug_symtab is a static inline method with DEBUG_FUNCTION and thus is emitted (due to __attribute__((used))) - something we should really fix, by moving its definition out of cgraph.h. For some unknown reason AIX cc1plus emits: .csect _functiontests.ro_[RO],4 .align 2 .globl _GLOBAL__F_.._.._gcc_function_tests.c_DFF67DD7_0x28c82f7f _GLOBAL__F_.._.._gcc_function_tests.c_DFF67DD7_0x28c82f7f: Lframe..1: .vbyte 4,LECIE..1-LSCIE..1 and thus has the random seed in the symbol table. The following patch fixes it by making sure we build all the selftest*/*tests* objects with -frandom-seed=$@ and thus it is consistent. As a bonus for other targets, the objects are now put together and thus should be improve code locality for actual compiler code, not tests, when doing checking builds. Bootstrapped/regtested on x86_64-linux, i686-linux and (together with the libgomp patch I've already committed) on powerpc-ibm-aix7.2.0.0, ok for trunk/7.1? I'd like to do a RC2 tomorrow. 2017-04-27 Jakub Jelinek PR bootstrap/80531 * Makefile.in (SELFTEST_OBJS): New variable. For $(SELFTEST_OBJS) and selftest.o append -frandom-seed=$@ to ALL_COMPILERFLAGS. (OBJS): Remove *-tests.o and selftest-*.o, add $(SELFTEST_OBJS). Jakub --- gcc/Makefile.in.jj 2017-04-25 21:44:02.000000000 +0200 +++ gcc/Makefile.in 2017-04-27 18:32:06.661511629 +0200 @@ -1187,6 +1187,11 @@ C_COMMON_OBJS = c-family/c-common.o c-fa c-family/array-notation-common.o c-family/cilk.o c-family/c-ubsan.o \ c-family/c-attribs.o c-family/c-warn.o +# The self-test objects that are empty in release checking builds. +SELFTEST_OBJS = selftest-rtl.o selftest-run-tests.o \ + function-tests.o ggc-tests.o hash-map-tests.o hash-set-tests.o \ + rtl-tests.o + # Language-independent object files. # We put the *-match.o and insn-*.o files first so that a parallel make # will build them sooner, because they are large and otherwise tend to be @@ -1279,13 +1284,11 @@ OBJS = \ fold-const.o \ fold-const-call.o \ function.o \ - function-tests.o \ fwprop.o \ gcc-rich-location.o \ gcse.o \ gcse-common.o \ ggc-common.o \ - ggc-tests.o \ gimple.o \ gimple-builder.o \ gimple-expr.o \ @@ -1319,8 +1322,6 @@ OBJS = \ graphite-sese-to-poly.o \ gtype-desc.o \ haifa-sched.o \ - hash-map-tests.o \ - hash-set-tests.o \ hsa-common.o \ hsa-gen.o \ hsa-regalloc.o \ @@ -1429,7 +1430,6 @@ OBJS = \ resource.o \ rtl-chkp.o \ rtl-error.o \ - rtl-tests.o \ rtl.o \ rtlhash.o \ rtlanal.o \ @@ -1443,8 +1443,6 @@ OBJS = \ sel-sched-ir.o \ sel-sched-dump.o \ sel-sched.o \ - selftest-rtl.o \ - selftest-run-tests.o \ sese.o \ shrink-wrap.o \ simplify-rtx.o \ @@ -1574,7 +1572,8 @@ OBJS = \ xcoffout.o \ $(out_object_file) \ $(EXTRA_OBJS) \ - $(host_hook_obj) + $(host_hook_obj) \ + $(SELFTEST_OBJS) # Objects in libcommon.a, potentially used by all host binaries and with # no target dependencies. @@ -1607,6 +1606,10 @@ $(ALL_HOST_BACKEND_OBJS): ALL_COMPILERFL $(ALL_HOST_BACKEND_OBJS): cc1plus.fda endif +# The self-test objects are empty in release checking builds, make sure +# AIX/HPUX don't trigger comparison failures on them. +$(SELFTEST_OBJS) selftest.o: ALL_COMPILERFLAGS += -frandom-seed=$@ + # This lists all host object files, whether they are included in this # compilation or not. ALL_HOST_OBJS = $(ALL_HOST_FRONTEND_OBJS) $(ALL_HOST_BACKEND_OBJS)