From patchwork Fri Mar 17 22:54:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 740549 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 3vlLMG3JhTz9rvt for ; Sat, 18 Mar 2017 09:57:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="M+DA+Ht+"; 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:from :to:cc:subject:date:message-id; q=dns; s=default; b=BD0yyVNHbXsu bcPhZbKOYErPHGSjbm5ebFFGtAJqpm045OvDv0POewv4HKOy0nIX4WEs8QWZYE9M Je+/5TQbouqIhAtxFqvZoZWlstbA+NRI/2+d1FptkkMJAPey0U4eGEnYyfcsRON3 cbXXaswgKoyM3PeHgPlEZRSWmvogIoo= 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:cc:subject:date:message-id; s=default; bh=VrEtycY4KLrx3/TRWx jHs5m6N3g=; b=M+DA+Ht+i3CqB8fanGvLlZUlm7yzPzQ5XT4dnJIVBAYxto8Jg2 HWiLSd72g9XS5zp6mah9S0AXdSedqXEb7LKXkhjvqWBTPf01gijEMX2d/89VdH3Y IIsf/6Vs2S4i0mvJ7ScDTABqgkVRXeN3IPJ9c3CaCkx/zfNn9MucHlJrE= Received: (qmail 82252 invoked by alias); 17 Mar 2017 22:56:48 -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 81817 invoked by uid 89); 17 Mar 2017 22:56:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=forbidden, H*RU:209.85.192.196, Hx-spam-relays-external:209.85.192.196 X-HELO: mail-pf0-f196.google.com Received: from mail-pf0-f196.google.com (HELO mail-pf0-f196.google.com) (209.85.192.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Mar 2017 22:56:43 +0000 Received: by mail-pf0-f196.google.com with SMTP id r137so6166200pfr.3 for ; Fri, 17 Mar 2017 15:56:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bY0pY61QkpAsmOaqsY89Gjiw78rFesX/MmqRzRpqnT0=; b=Lg+KcRwrKYgQ9gRlSi8qVsM6eUMdvXZbIhMwNpJX9OeEBCUvGcG5stDJ7kFdYFay/P f7tJmRV9XcYNOZY/yUsG3fylrIAUWuj0jK2P0jeywbQ1lpfqx5N6KTF5C8kuKS7nXK5d 6tTjX+vXabpSgSEglrjWj1qWW/z65PE92tKp94EHZFU7wC48FzmA1ptCuKPj7VKUadh9 IebhkEg6y/s3SObC0OUD3cpwBDv3NIp5EkAA13Hz9wtRLtfxicUOlnjdYCraMvTi8MaY Pgjb+5tWMm01+CgasyHoi7uhfUhFKHhgLBD+iuqYMxtL5TIwpBvr5o/SO+Xr3nU0+eNa Bp0Q== X-Gm-Message-State: AFeK/H0mOM2/AEugRmnRn68JXcXLAYpwsBrym1we2BF2Lff5F5B9cAeyMYaL0FbnSlRb0g== X-Received: by 10.98.66.155 with SMTP id h27mr19187927pfd.182.1489791402880; Fri, 17 Mar 2017 15:56:42 -0700 (PDT) Received: from localhost ([216.38.154.21]) by smtp.gmail.com with ESMTPSA id y67sm18724813pfa.96.2017.03.17.15.56.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Mar 2017 15:56:42 -0700 (PDT) From: Palmer Dabbelt To: gcc-patches@gcc.gnu.org Cc: Palmer Dabbelt Subject: [PATCH] RISC-V: Don't prefer FP_REGS for integers Date: Fri, 17 Mar 2017 15:54:16 -0700 Message-Id: <20170317225416.19343-1-palmer@dabbelt.com> X-IsSubscribed: yes On RISC-V we can't store integers in floating-point registers as this is forbidden by the ISA. We've always disallowed this, but we were setting the preferred mode to FP_REGS for some integer modes. This caused the LRA to blow up with some hard to read error messages. This patch removes the prefered mode hook, as the right thing to do here is nothing. Thanks to Kito for finding the bug, and mpf for the fix. See also . PR target/79912 --- gcc/ChangeLog | 6 ++++++ gcc/config/riscv/riscv.c | 13 ------------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index de32689..5e90179 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2017-03-17 Palmer Dabbelt + PR target/79912 + * config/riscv/riscv.c (riscv_preferred_reload_class): Remove. + (TARGET_PREFERRED_RELOAD_CLASS): Likewise. + +2017-03-17 Palmer Dabbelt + * config/riscv/riscv.c (riscv_print_operand): Use "fence iorw,ow". * config/riscv/sync.mc (mem_thread_fence_1): Use "fence diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c index fa93c3c..d5928c3 100644 --- a/gcc/config/riscv/riscv.c +++ b/gcc/config/riscv/riscv.c @@ -3629,16 +3629,6 @@ riscv_class_max_nregs (reg_class_t rclass, enum machine_mode mode) return 0; } -/* Implement TARGET_PREFERRED_RELOAD_CLASS. */ - -static reg_class_t -riscv_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, reg_class_t rclass) -{ - return reg_class_subset_p (FP_REGS, rclass) ? FP_REGS : - reg_class_subset_p (GR_REGS, rclass) ? GR_REGS : - rclass; -} - /* Implement TARGET_MEMORY_MOVE_COST. */ static int @@ -4031,9 +4021,6 @@ riscv_cannot_copy_insn_p (rtx_insn *insn) #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST riscv_address_cost -#undef TARGET_PREFERRED_RELOAD_CLASS -#define TARGET_PREFERRED_RELOAD_CLASS riscv_preferred_reload_class - #undef TARGET_ASM_FILE_START #define TARGET_ASM_FILE_START riscv_file_start #undef TARGET_ASM_FILE_START_FILE_DIRECTIVE