From patchwork Thu Nov 23 14:10:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 840802 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-467794-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="qZccg/e3"; 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 3yjLp36jCQz9rxm for ; Fri, 24 Nov 2017 01:10:50 +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 :message-id:subject:from:to:date:content-type:mime-version; q= dns; s=default; b=BwTgWvoLC9d4cXtmLvqMSiVBziOutSVTjsqI06KaN00YNu MhfbRpPfCntykpa2qcQYyyp5UqHTM3h8dzQMPeiGMv9O0ox0c2vGzreg9eZuhyUt gogKvvtMXcGL2w7W9WUghi/uVK2841wBDSDD7zTz3U+BLAyPadkfYYdjcvC0M= 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 :message-id:subject:from:to:date:content-type:mime-version; s= default; bh=KQjLrlTZv8VaMnMS1J+1Q9uW8M0=; b=qZccg/e3a6LvMvJqboQW 2zdSe/uZ6YvoJud+N9tttPGkfdKz5+YwrVlvOrBK0p/hfNB/EJJyWqDSihB+Qq8A CDCjenFDkHmLQRkpWT7Lg2O4c8yeSDCHBubm1P2luDtR3BxYr/mgesS5oAlHt6VS M1buijH8ZJcfA1rgelP/jNc= Received: (qmail 128726 invoked by alias); 23 Nov 2017 14:10:41 -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 128712 invoked by uid 89); 23 Nov 2017 14:10:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-9.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, KB_WAM_FROM_NAME_SINGLEWORD, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mailout11.t-online.de Received: from mailout11.t-online.de (HELO mailout11.t-online.de) (194.25.134.85) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 Nov 2017 14:10:37 +0000 Received: from fwd24.aul.t-online.de (fwd24.aul.t-online.de [172.20.26.129]) by mailout11.t-online.de (Postfix) with SMTP id 226EB4243563 for ; Thu, 23 Nov 2017 15:10:35 +0100 (CET) Received: from [192.168.0.55] (SUlt0cZOghh4kLDnhV2N2zo2PiLJCqnlcm5QlsUSJOnrY0NpCDpIU0V4lvLW7lBwP4@[175.177.59.196]) by fwd24.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1eHsCz-3PrdFw0; Thu, 23 Nov 2017 15:10:29 +0100 Message-ID: <1511446225.19674.16.camel@t-online.de> Subject: [SH][committed] Fix PR 83111 From: Oleg Endo To: gcc-patches Date: Thu, 23 Nov 2017 23:10:25 +0900 Mime-Version: 1.0 X-IsSubscribed: yes Hi, The attached patch fixes PR 83111. Committed to mainline as r255096 and to GCC 7 branch as r255097. Cheers, Oleg gcc/ChangeLog PR target/83111 * config/sh/sh.md (udivsi3, divsi3, sibcall_value_pcrel, sibcall_value_pcrel_fdpic): Use local variable instead of operands[3]. (calli_tbr_rel): Add missing operand 2. (call_valuei_tbr_rel): Add missing operand 3. Index: gcc/config/sh/sh.md =================================================================== --- gcc/config/sh/sh.md (revision 255095) +++ gcc/config/sh/sh.md (working copy) @@ -2277,8 +2277,8 @@ "" { rtx last; + rtx func_ptr = gen_reg_rtx (Pmode); - operands[3] = gen_reg_rtx (Pmode); /* Emit the move of the address to a pseudo outside of the libcall. */ if (TARGET_DIVIDE_CALL_TABLE) { @@ -2298,16 +2298,16 @@ emit_move_insn (operands[0], operands[2]); DONE; } - function_symbol (operands[3], "__udivsi3_i4i", SFUNC_GOT); - last = gen_udivsi3_i4_int (operands[0], operands[3]); + function_symbol (func_ptr, "__udivsi3_i4i", SFUNC_GOT); + last = gen_udivsi3_i4_int (operands[0], func_ptr); } else if (TARGET_DIVIDE_CALL_FP) { - rtx lab = function_symbol (operands[3], "__udivsi3_i4", SFUNC_STATIC).lab; + rtx lab = function_symbol (func_ptr, "__udivsi3_i4", SFUNC_STATIC).lab; if (TARGET_FPU_SINGLE) - last = gen_udivsi3_i4_single (operands[0], operands[3], lab); + last = gen_udivsi3_i4_single (operands[0], func_ptr, lab); else - last = gen_udivsi3_i4 (operands[0], operands[3], lab); + last = gen_udivsi3_i4 (operands[0], func_ptr, lab); } else if (TARGET_SH2A) { @@ -2318,8 +2318,8 @@ } else { - rtx lab = function_symbol (operands[3], "__udivsi3", SFUNC_STATIC).lab; - last = gen_udivsi3_i1 (operands[0], operands[3], lab); + rtx lab = function_symbol (func_ptr, "__udivsi3", SFUNC_STATIC).lab; + last = gen_udivsi3_i1 (operands[0], func_ptr, lab); } emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]); emit_move_insn (gen_rtx_REG (SImode, 5), operands[2]); @@ -2405,22 +2405,22 @@ "" { rtx last; + rtx func_ptr = gen_reg_rtx (Pmode); - operands[3] = gen_reg_rtx (Pmode); /* Emit the move of the address to a pseudo outside of the libcall. */ if (TARGET_DIVIDE_CALL_TABLE) { - function_symbol (operands[3], sh_divsi3_libfunc, SFUNC_GOT); - last = gen_divsi3_i4_int (operands[0], operands[3]); + function_symbol (func_ptr, sh_divsi3_libfunc, SFUNC_GOT); + last = gen_divsi3_i4_int (operands[0], func_ptr); } else if (TARGET_DIVIDE_CALL_FP) { - rtx lab = function_symbol (operands[3], sh_divsi3_libfunc, + rtx lab = function_symbol (func_ptr, sh_divsi3_libfunc, SFUNC_STATIC).lab; if (TARGET_FPU_SINGLE) - last = gen_divsi3_i4_single (operands[0], operands[3], lab); + last = gen_divsi3_i4_single (operands[0], func_ptr, lab); else - last = gen_divsi3_i4 (operands[0], operands[3], lab); + last = gen_divsi3_i4 (operands[0], func_ptr, lab); } else if (TARGET_SH2A) { @@ -2431,8 +2431,8 @@ } else { - function_symbol (operands[3], sh_divsi3_libfunc, SFUNC_GOT); - last = gen_divsi3_i1 (operands[0], operands[3]); + function_symbol (func_ptr, sh_divsi3_libfunc, SFUNC_GOT); + last = gen_divsi3_i1 (operands[0], func_ptr); } emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]); emit_move_insn (gen_rtx_REG (SImode, 5), operands[2]); @@ -6519,6 +6519,7 @@ [(call (mem (match_operand:SI 0 "symbol_ref_operand" "")) (match_operand 1 "" "")) (use (reg:SI FPSCR_MODES_REG)) + (use (match_scratch 2)) (clobber (reg:SI PR_REG))] "TARGET_SH2A && sh2a_is_function_vector_call (operands[0])" { @@ -6629,6 +6630,7 @@ (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "")) (match_operand 2 "" ""))) (use (reg:SI FPSCR_MODES_REG)) + (use (match_scratch 3)) (clobber (reg:SI PR_REG))] "TARGET_SH2A && sh2a_is_function_vector_call (operands[1])" { @@ -7044,13 +7046,11 @@ [(const_int 0)] { rtx lab = PATTERN (gen_call_site ()); - rtx call_insn; + rtx tmp = gen_rtx_REG (SImode, R1_REG); - operands[3] = gen_rtx_REG (SImode, R1_REG); - - sh_expand_sym_label2reg (operands[3], operands[1], lab, true); - call_insn = emit_call_insn (gen_sibcall_valuei_pcrel (operands[0], - operands[3], + sh_expand_sym_label2reg (tmp, operands[1], lab, true); + rtx call_insn = emit_call_insn (gen_sibcall_valuei_pcrel (operands[0], + tmp, operands[2], copy_rtx (lab))); SIBLING_CALL_P (call_insn) = 1; @@ -7078,12 +7078,11 @@ [(const_int 0)] { rtx lab = PATTERN (gen_call_site ()); + rtx tmp = gen_rtx_REG (SImode, R1_REG); - operands[3] = gen_rtx_REG (SImode, R1_REG); - - sh_expand_sym_label2reg (operands[3], operands[1], lab, true); + sh_expand_sym_label2reg (tmp, operands[1], lab, true); rtx i = emit_call_insn (gen_sibcall_valuei_pcrel_fdpic (operands[0], - operands[3], + tmp, operands[2], copy_rtx (lab))); SIBLING_CALL_P (i) = 1;