From patchwork Tue Jan 22 10:20:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 1029237 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-494505-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.b="mlXssa7C"; 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 43kPZD75jfz9s2P for ; Tue, 22 Jan 2019 21:20:35 +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=aZcyffLtfMsAGJk7 oVKIDtsRzSD/IxnyHIZvfeJEtaCmP71L6Lkxe2uZYpp9kCWVfYVJRv9hzx/UUYI3 qwQwJpHGPLtcAJMuWNp+3FDfwUI4DPCX19peEQk1ycC5NKvsC/KbfyS5m9VQwEIh dfQj7PknzAfGPb4291qlrfZfk9Q= 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=n/83MFKj6AHpfjmGIAQLZS b9YiI=; b=mlXssa7CWFwdxn9kU0uriwctAWm94g3P3ehHUwU0ZH8I/z1xLr9IF3 NrGWuP2sVvb+4w1axeaHJ02WWkT1QvQN/k0/QKVUiXqETQ+pS7415v275NKSjMzi AR2apz1PSrbUJNdu61xZ0QOaAdW1zo9lEDILgfnuFglr+6Q7TEf/M= Received: (qmail 54323 invoked by alias); 22 Jan 2019 10:20:28 -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 54312 invoked by uid 89); 22 Jan 2019 10:20:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HIGH 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; Tue, 22 Jan 2019 10:20:26 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id AFBDF81354 for ; Tue, 22 Jan 2019 11:20:23 +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 x1x4cseJFLcs for ; Tue, 22 Jan 2019 11:20:23 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (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 897EE81353 for ; Tue, 22 Jan 2019 11:20:23 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [SPARC] Fix more UNSPEC notes during libgo build Date: Tue, 22 Jan 2019 11:20:21 +0100 Message-ID: <2165141.vqUrzexPze@polaris> MIME-Version: 1.0 There were a couple of issues in the code for mov{si,di}_pic_label_ref in sparc_delegitimize_address: it wouldn't recognize the GOT register and it wouldn't recognize a decoded HIGH/LO_SUM combination. Tested on SPARC/Solaris 11, applied on the mainline. 2019-01-22 Eric Botcazou * config/sparc/sparc.c (parc_delegitimize_address): Recognize the GOT register and decoded HIGH/LO_SUM combinations for labels in PIC mode. Index: config/sparc/sparc.c =================================================================== --- config/sparc/sparc.c (revision 268071) +++ config/sparc/sparc.c (working copy) @@ -4995,17 +4995,23 @@ sparc_delegitimize_address (rtx x) /* This is generated by mov{si,di}_pic_label_ref in PIC mode. */ if (GET_CODE (x) == MINUS - && sparc_pic_register_p (XEXP (x, 0)) - && GET_CODE (XEXP (x, 1)) == LO_SUM - && GET_CODE (XEXP (XEXP (x, 1), 1)) == UNSPEC - && XINT (XEXP (XEXP (x, 1), 1), 1) == UNSPEC_MOVE_PIC_LABEL) + && (XEXP (x, 0) == global_offset_table_rtx + || sparc_pic_register_p (XEXP (x, 0)))) { - x = XVECEXP (XEXP (XEXP (x, 1), 1), 0, 0); - gcc_assert (GET_CODE (x) == LABEL_REF - || (GET_CODE (x) == CONST - && GET_CODE (XEXP (x, 0)) == PLUS - && GET_CODE (XEXP (XEXP (x, 0), 0)) == LABEL_REF - && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT)); + rtx y = XEXP (x, 1); + + if (GET_CODE (y) == LO_SUM) + y = XEXP (y, 1); + + if (GET_CODE (y) == UNSPEC && XINT (y, 1) == UNSPEC_MOVE_PIC_LABEL) + { + x = XVECEXP (y, 0, 0); + gcc_assert (GET_CODE (x) == LABEL_REF + || (GET_CODE (x) == CONST + && GET_CODE (XEXP (x, 0)) == PLUS + && GET_CODE (XEXP (XEXP (x, 0), 0)) == LABEL_REF + && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT)); + } } return x;