From patchwork Fri Apr 7 05:25:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?44Od44OL44O86Zu75qmfKOagqikg5pif6YeO?= X-Patchwork-Id: 80660 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp60995vqo; Thu, 6 Apr 2023 22:25:56 -0700 (PDT) X-Google-Smtp-Source: AKy350Z/PkE4CcwJQDCbq9sjsRQAGoh1ZK5BAuLIWVUkQhUGJ3d3di/59gMiGDFGos4San6LC6On X-Received: by 2002:a50:ee06:0:b0:502:2a76:5781 with SMTP id g6-20020a50ee06000000b005022a765781mr1531400eds.5.1680845156597; Thu, 06 Apr 2023 22:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680845156; cv=none; d=google.com; s=arc-20160816; b=id3+tWTz52Xin4Wchms5pBvPjJmRrUBzlTxtfnRcXC7bG/2+X9/Ab8ghW1eS7DBrpz gr8AEmcZ5OekIyFESfkzenymuPxAbaMV4H+iCsX9XahuGkBD1bkhQG1uB8yzvkqCSfSQ JGRbLJNXVaZrg1J8mxZALUie4iLL4fAEonskexO+Nndm+TZuoa6qNeRYdSECruR8JTL8 3VtEmBYOckmf5VpRRFT5AiwkZA5njjIZNos0jMzy4KlvkZE3IzfVA4k08zp9fnKi2bnF EiEt/5fDQ2WHnjoociQ1Jz1yT30WSD8MTQdgq/c/tKBnBeHqG7BzY6htFiQoLYicVLGh fyfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject:to :from:dmarc-filter:delivered-to; bh=uDF3nJtxXDc3uGHaWUqmRlf4IUnAn9L6bfwOXJZ7z3E=; b=bsVTmtdjbefMr0G/SQn7qFFf985JKR+ozROXnIpvUkhtATZxUYrKQ78dBSNYC4cNo3 1Lj/kcZKOmgiA3UUtScUuYrYcu4OTk8E2FxE4U3KxpDFdpoRF+DLt70D8rWTHdfI6+Qn dWRpP2K31BoHxZ3EjzTAdVCc8jcKJU5/6CbQ/S15HRwIiq0sFbr+rVZY1dF0ygfltrJz tUpdvMqwTUSdor/2j/ZleimdXwOv08ou/8I8fEgsu68/IZQ+dIZc+JB3vCb89bwuhDzH RbIP6zNPlzQdtdDpJLXQ64YTa65vaXL7zrML+tMvXpRxs3UobJB1+pXLwEPhSQwyvHqP gWEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h14-20020a50ed8e000000b00504784766fdsi1074774edr.373.2023.04.06.22.25.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 22:25:56 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6B8CF3858C83 for ; Fri, 7 Apr 2023 05:25:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mwb-ckd-mts-003c29.ocn.ad.jp (mwb-ckd-mts-003c29.ocn.ad.jp [180.55.251.30]) by sourceware.org (Postfix) with ESMTPS id 1FECD3858D28 for ; Fri, 7 Apr 2023 05:25:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1FECD3858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=pony-e.jp Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=pony-e.jp Received: from cmn-spm-mts-005c1.ocn.ad.jp (cmn-spm-mts-005c1.ocn.ad.jp [153.153.67.157]) by mwb-ckd-mts-003c29.ocn.ad.jp (Postfix) with ESMTP id 81BAC38004001 for ; Fri, 7 Apr 2023 14:25:20 +0900 (JST) Received: from mwb-vc-mts-001c1.ocn.ad.jp ([153.138.237.203]) by cmn-spm-mts-005c1.ocn.ad.jp with ESMTP id kebApZw3Yoc2bkebAp1jU9; Fri, 07 Apr 2023 14:25:20 +0900 X-BIZ-RELAY: yes Received: from mwb-sdgw-mts-003c1.ocn.ad.jp ([122.28.88.78]) by mwb-vc-mts-001c1.ocn.ad.jp with ESMTP id kebApJz4T5TrlkebApPneb; Fri, 07 Apr 2023 14:25:20 +0900 Received: from pony-e.jp (pony-e.jp [60.43.139.89]) by mwb-sdgw-mts-003c1.ocn.ad.jp (Postfix) with ESMTP id 5A9668000442 for ; Fri, 7 Apr 2023 14:25:20 +0900 (JST) Received: from LNPC030 (p4939090-ipxg23501hodogaya.kanagawa.ocn.ne.jp [153.217.15.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by pony-e.jp (Postfix) with ESMTPSA id 27E0F40A7BF04 for ; Fri, 7 Apr 2023 14:25:23 +0900 (JST) From: =?iso-2022-jp?b?GyRCJV0lSyE8RUU1IRsoQigbJEIzdBsoQikgGyRCQDFMbhsoQg==?= To: Subject: [PATCH] PR target/109402: v850 (not v850e) variant of __muldi3() moves sp in reversed direction [PR109402] Date: Fri, 7 Apr 2023 14:25:19 +0900 Message-ID: <000201d96911$5824d670$086e8350$@pony-e.jp> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdlpD/hnBlih7cPRRqmuw7fR3VQZlg== Content-Language: ja X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, CHARSET_FARAWAY_HEADER, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762493891126699641?= X-GMAIL-MSGID: =?utf-8?q?1762493891126699641?= Where I talk about is: /libgcc/config/v850/lib1funcs.S L2214, L2259 - in a commit 8b1204d7. There are stack-pointer operations. I think these operations: shrink before, grow after --- may reversed way. There is one more consideration; this version of __muldi3() does not use local storage in stack. So the problem will be resolved simply to remove sp-operations. I have no idea to show a reproduce way in shortly. Because a problem happens with inter-procedure such as interrupt service routines which use storage in stack. In my environment, the next patch works well. diff --git a/libgcc/config/v850/lib1funcs.S b/libgcc/config/v850/lib1funcs.S index 00dd61d..99e79bf 100644 --- a/libgcc/config/v850/lib1funcs.S +++ b/libgcc/config/v850/lib1funcs.S @@ -2211,7 +2211,6 @@ ___muldi3: #ifdef __v850__ jarl __save_r26_r31, r10 - addi 16, sp, sp mov r6, r28 shr 15, r28 movea lo(32767), r0, r14 @@ -2256,7 +2255,6 @@ mulh r12, r6 mov r28, r17 mulh r10, r17 - add -16, sp mov r28, r12 mulh r8, r12 add r17, r18