From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by sourceware.org (Postfix) with ESMTP id 5B2B73846077 for ; Fri, 11 Sep 2020 09:30:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5B2B73846077 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-59-Wyar9gZgORGwCCwTBzbBtQ-1; Fri, 11 Sep 2020 05:29:59 -0400 X-MC-Unique: Wyar9gZgORGwCCwTBzbBtQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E6893425D8; Fri, 11 Sep 2020 09:29:57 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-113-252.ams2.redhat.com [10.36.113.252]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 724E960C07; Fri, 11 Sep 2020 09:29:57 +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 08B9Trng011620; Fri, 11 Sep 2020 11:29:54 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 08B9Tr84011619; Fri, 11 Sep 2020 11:29:53 +0200 Date: Fri, 11 Sep 2020 11:29:52 +0200 From: Jakub Jelinek To: Christophe Lyon Cc: gcc Patches , Richard Earnshaw Subject: Re: [PATCH] arm: Fix up arm_override_options_after_change [PR96939] Message-ID: <20200911092952.GM18149@tucnak> Reply-To: Jakub Jelinek References: <20200908084512.GH18149@tucnak> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Fri, 11 Sep 2020 09:30:02 -0000 On Fri, Sep 11, 2020 at 09:46:37AM +0200, Christophe Lyon via Gcc-patches wrote: > I'm seeing an ICE with this new test on most of my arm configurations, > for instance: > --target arm-none-linux-gnueabi --with-cpu cortex-a9 > /aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-linux-gnueabi/gcc3/gcc/xgcc > -B/aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-ar > m-none-linux-gnueabi/gcc3/gcc/ c_lto_pr96939_0.o c_lto_pr96939_1.o > -fdiagnostics-plain-output -flto -O2 -o > gcc-target-arm-lto-pr96939-01.exe Seems a latent issue. Neither cl_optimization_{save,restore} nor cl_target_option_{save,restore} (nor any of the target hooks they call) saves or restores any opts_set values, so I think opts_set can be trusted only during option processing (if at all), but not later. So, short term a fix would be IMHO just stop using opts_set altogether in arm_configure_build_target, it doesn't make much sense to me, it should test if those strings are non-NULL instead, or at least do that when it is invoked from arm_option_restore (e.g. could be done by calling it with opts instead of &global_options_set ). Longer term, the question is if cl_optimization_{save,restore} and cl_target_option_{save,restore} shouldn't be changed not to only save/restore the options, but also save the opts_set flags. It could be done e.g. by adding a bool array or set of bool members to struct cl_optimization and struct cl_target_option , or even more compact by using bitmasks, pack each 64 adjacent option flags into a UHWI element of an array. > In function 'crc': > lto1: internal compiler error: Segmentation fault > 0xba720f crash_signal > /gcc/toplev.c:327 > 0x172beb9 strchr > /usr/include/string.h:227 > 0x172beb9 arm_parse_cpu_option_name(cpu_option const*, char const*, > char const*, bool) > /gcc/common/config/arm/arm-common.c:349 > 0xfa9372 arm_configure_build_target(arm_build_target*, > cl_target_option*, gcc_options*, bool) > /gcc/config/arm/arm.c:3209 > 0xfbf8e1 arm_set_current_function > /gcc/config/arm/arm.c:32334 > 0x86b68b invoke_set_current_function_hook > /gcc/function.c:4670 > 0x870d77 invoke_set_current_function_hook > /gcc/function.c:4836 > 0x870d77 allocate_struct_function(tree_node*, bool) > /gcc/function.c:4793 > 0xa25943 input_function > /gcc/lto-streamer-in.c:1385 > 0xa25943 lto_read_body_or_constructor > /gcc/lto-streamer-in.c:1624 > 0x6f37ff cgraph_node::get_untransformed_body() > /gcc/cgraph.c:3932 > 0x703f42 cgraph_node::expand() > /gcc/cgraphunit.c:2274 > 0x70567c expand_all_functions > /gcc/cgraphunit.c:2476 > 0x70567c symbol_table::compile() > /gcc/cgraphunit.c:2839 > 0x63970b lto_main() > /gcc/lto/lto.c:653 > > This is with a cross-compiler. Jakub