From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 141513858C52 for ; Mon, 4 Apr 2022 09:04:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 141513858C52 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-609-lOjJ-fVTPH6ByxDDAnUtmA-1; Mon, 04 Apr 2022 05:04:53 -0400 X-MC-Unique: lOjJ-fVTPH6ByxDDAnUtmA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 361001C09408; Mon, 4 Apr 2022 09:04:53 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DF59543E906; Mon, 4 Apr 2022 09:04:52 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 23494n3j2052008 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 4 Apr 2022 11:04:50 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 23494mue2052007; Mon, 4 Apr 2022 11:04:48 +0200 Date: Mon, 4 Apr 2022 11:04:48 +0200 From: Jakub Jelinek To: Richard Earnshaw , Richard Sandiford , Kyrylo Tkachov Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] aarch64: Fix aarch64-tune.md (re)generation [PR105144] Message-ID: Reply-To: Jakub Jelinek MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, MEDICAL_SUBJECT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2022 09:05:09 -0000 Hi! As I wrote in the PR, our Fedora trunk gcc builds likely after r12-7842 change are now failing (lto1 crashes). What happens is that when one bootstraps into an empty build directory (or set of them), mddeps.mk doesn't exist yet and so Makefile doesn't include it. When building from an empty dir, that is usually not a big issue, it is enough when various build directory files depend on just $(srcdir)/config/aarch64/aarch64.md, those files don't exist and aarch64.md does, so they are built, so is mddeps.mk. But because the other dependencies aren't there (in particular $(srcdir)/config/aarch64/aarch64-tune.md ), the s-aarch64-tune-md rule isn't invoked to regenerate that file and the r12-7842 commit reordered aarch64-cores.def entries but didn't commit regenerated aarch64-tune.md. Because it is just reordering in aarch64-tune.md, it actually doesn't matter and bootstraps succeeds. But then during make install, mddeps.mk exists already in gcc/ directory, it sees that aarch64-cores.def is newer than aarch64-tune.md (unless gen_update is used, that just touches aarch64-tune.md to make sure it is newer) and regenerates it and as it is different, make install rebuilds a large subset of the *.o files, but this time with the system g++ rather than previous stage one. And during lto linking of it there are differences in LTO bytecode between the compilers and we crash. The following patch fixes that by regenerating aarch64-tune.md (what was forgotten in r12-7842) and by adding a dependency from s-mddeps to s-aarch64-tune-md, which makes sure that even when mddeps.mk doesn't exist yet make sees the dependency and regenerates aarch64-tune.md if needed. Tested on aarch64-linux and x86_64-linux (cross there), ok for trunk? 2022-04-04 Jakub Jelinek PR target/105144 * config/aarch64/t-aarch64 (s-mddeps): Depend on s-aarch64-tune-md. * config/aarch64/aarch64-tune.md: Regenerated. --- gcc/config/aarch64/t-aarch64.jj 2022-01-18 11:58:59.024990028 +0100 +++ gcc/config/aarch64/t-aarch64 2022-04-04 10:14:30.256323070 +0200 @@ -34,6 +34,8 @@ s-aarch64-tune-md: $(srcdir)/config/aarc $(srcdir)/config/aarch64/aarch64-tune.md $(STAMP) s-aarch64-tune-md +s-mddeps: s-aarch64-tune-md + aarch64-builtins.o: $(srcdir)/config/aarch64/aarch64-builtins.cc $(CONFIG_H) \ $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(TREE_H) expr.h $(TM_P_H) $(RECOG_H) langhooks.h \ --- gcc/config/aarch64/aarch64-tune.md.jj 2022-04-03 23:30:25.710798806 +0200 +++ gcc/config/aarch64/aarch64-tune.md 2022-04-04 10:14:55.668962478 +0200 @@ -1,5 +1,5 @@ ;; -*- buffer-read-only: t -*- ;; Generated automatically by gentune.sh from aarch64-cores.def (define_attr "tune" - "cortexa34,cortexa35,cortexa53,cortexa57,cortexa72,cortexa73,thunderx,thunderxt88p1,thunderxt88,octeontx,octeontxt81,octeontxt83,thunderxt81,thunderxt83,ampere1,emag,xgene1,falkor,qdf24xx,exynosm1,phecda,thunderx2t99p1,vulcan,thunderx2t99,cortexa55,cortexa75,cortexa76,cortexa76ae,cortexa77,cortexa78,cortexa78ae,cortexa78c,cortexa65,cortexa65ae,cortexx1,ares,neoversen1,neoversee1,octeontx2,octeontx2t98,octeontx2t96,octeontx2t93,octeontx2f95,octeontx2f95n,octeontx2f95mm,a64fx,tsv110,thunderx3t110,zeus,neoversev1,neoverse512tvb,saphira,neoversen2,cortexa57cortexa53,cortexa72cortexa53,cortexa73cortexa35,cortexa73cortexa53,cortexa75cortexa55,cortexa76cortexa55,cortexr82,cortexa510,cortexa710,cortexx2,demeter" + "cortexa34,cortexa35,cortexa53,cortexa57,cortexa72,cortexa73,thunderx,thunderxt88p1,thunderxt88,octeontx,octeontxt81,octeontxt83,thunderxt81,thunderxt83,ampere1,emag,xgene1,falkor,qdf24xx,exynosm1,phecda,thunderx2t99p1,vulcan,thunderx2t99,cortexa55,cortexa75,cortexa76,cortexa76ae,cortexa77,cortexa78,cortexa78ae,cortexa78c,cortexa65,cortexa65ae,cortexx1,ares,neoversen1,neoversee1,octeontx2,octeontx2t98,octeontx2t96,octeontx2t93,octeontx2f95,octeontx2f95n,octeontx2f95mm,a64fx,tsv110,thunderx3t110,zeus,neoversev1,neoverse512tvb,saphira,cortexa57cortexa53,cortexa72cortexa53,cortexa73cortexa35,cortexa73cortexa53,cortexa75cortexa55,cortexa76cortexa55,cortexr82,cortexa510,cortexa710,cortexx2,neoversen2,demeter" (const (symbol_ref "((enum attr_tune) aarch64_tune)"))) Jakub