From patchwork Fri Feb 14 18:29:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 1238314 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-519560-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=F9xp4ZnT; dkim-atps=neutral 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 48K23T4jn6z9sjG for ; Sat, 15 Feb 2020 05:29:40 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=F0vz2p4fpfHWEKIA 5IdIZrY0hzOaUay96oSMN6pxffKvlDusPYeVPTATlMxWnE38mKhn5zKi7kI84RxN TkioAREiJCBIuxASkP3L9uNExbymwf1fnMEPSaQJHJdkpS8MLWoEKzxQKbgtgAyq lSJGKvbnvUUcLmVynahIdLvjqiI= 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:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=feJP2g5rEaIADstyfmt07T NMDqI=; b=F9xp4ZnTQnsiwKF3z0f9mVhwpHTZPmns+KRQ6qnzPzj4LzcwGi5Xqo IVUWqs6TbDH3u3YhcZniMYzwkfuOdcwLvMONyTDqF0Pg1J7QM1BQucdofWpCNdDH tbm09xvOBawc0TPU3AtW5oEdunelp86rkGxhU/QCN1m7p6lD/EdR0= Received: (qmail 29793 invoked by alias); 14 Feb 2020 18:29:32 -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 29752 invoked by uid 89); 14 Feb 2020 18:29:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Feb 2020 18:29:31 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 854F281369 for ; Fri, 14 Feb 2020 19:29:28 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WkG4ufUBlTPR for ; Fri, 14 Feb 2020 19:29:28 +0100 (CET) Received: from polaris.localnet (unknown [IPv6:2a01:e0a:41b:9230:1a03:73ff:fe45:373a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 658D681354 for ; Fri, 14 Feb 2020 19:29:28 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [SPARC] Fix PR target/93704 Date: Fri, 14 Feb 2020 19:29:27 +0100 Message-ID: <8889192.1BZndx10Uc@polaris> MIME-Version: 1.0 This is an old thinko pertaining to the interaction between TLS sequences and delay slot filling: the compiler knows that it cannot put instructions with TLS relocations into delay slots with the original Sun TLS model, but it tests TARGET_SUN_TLS in this context, which depends only on the assembler. So if the compiler is configured with the GNU assembler and the Solaris linker, then TARGET_GNU_TLS is set instead and the limitation is not enforced. Tested on SPARC/Solaris and SPARC64/Linux, applied on all active branches. 2020-02-14 Eric Botcazou PR target/93704 * config/sparc/sparc.c (eligible_for_call_delay): Test HAVE_GNU_LD in conjunction with TARGET_GNU_TLS in early return. diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 7e05e1a6f82..aefced85fe1 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -3959,11 +3959,8 @@ eligible_for_call_delay (rtx_insn *trial) if (get_attr_in_branch_delay (trial) == IN_BRANCH_DELAY_FALSE) return 0; - /* Binutils allows - call __tls_get_addr, %tgd_call (foo) - add %l7, %o0, %o0, %tgd_add (foo) - while Sun as/ld does not. */ - if (TARGET_GNU_TLS || !TARGET_TLS) + /* The only problematic cases are TLS sequences with Sun as/ld. */ + if ((TARGET_GNU_TLS && HAVE_GNU_LD) || !TARGET_TLS) return 1; pat = PATTERN (trial);