From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from delivery.mailspamprotection.com (delivery.mailspamprotection.com [185.56.84.16]) by sourceware.org (Postfix) with ESMTPS id 3BC073858407 for ; Thu, 20 Jan 2022 23:48:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3BC073858407 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tantosonline.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=tantosonline.com Received: from 107.112.208.35.bc.googleusercontent.com ([35.208.112.107] helo=siteground277.com) by se22.mailspamprotection.com with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1nAh9o-000EWn-Jo for gcc@gcc.gnu.org; Thu, 20 Jan 2022 17:47:59 -0600 Received: from [73.169.135.95] (port=42584 helo=kakukkfu.lan) by siteground277.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.90-.1) (envelope-from ) id 1nAh9o-000PKM-4A; Thu, 20 Jan 2022 23:47:56 +0000 Received: from dell-laptop.lan (router.lan [192.168.139.254]) by kakukkfu.lan (Postfix) with ESMTPSA id 3903B167; Thu, 20 Jan 2022 15:47:55 -0800 (PST) Message-ID: <68513876d24698f479260a083443f999a8b50fc7.camel@tantosonline.com> Subject: Re: How to generate a call inst. sequence? From: Andras Tantos To: Richard Sandiford Cc: gcc@gcc.gnu.org Date: Thu, 20 Jan 2022 15:47:55 -0800 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - siteground277.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tantosonline.com X-Source: X-Source-Args: X-Source-Dir: X-Originating-IP: 35.208.112.107 X-SpamExperts-Domain: siteground277.com X-SpamExperts-Username: 35.208.112.107 Authentication-Results: mailspamprotection.com; auth=pass smtp.auth=35.208.112.107@siteground277.com X-SpamExperts-Outgoing-Class: unsure X-SpamExperts-Outgoing-Evidence: Combined (0.47) X-Recommended-Action: accept X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT9gYUn/qu27ZDCWriaOODxhPUtbdvnXkggZ 3YnVId/Y5jcf0yeVQAvfjHznO7+bT5xBytxzJBgOlCIhBVn7zf5DAxQ+GhOWeJSm0X/4oD2rzVrv F0l2Apb4gyeY+Acfrswh55uqY3MhMgFAHq5BxPxPnSWXEV458bUmxaOKcxICtcN9X9K1DzVKciEj mqsTuLPQAKujagVaTNLZ5X+kLHvN+ufcSwqqOlrljbZrM+IOzcdMIqsIyb3aJqs33ZX4HJh0xl54 MAEbe1oNTNeaZ2bNJnWeeuYTXKpbWwq0Jmmi2pLxzMxjTMOIW0hJGap8jYKPi0A2vLwcNEjxGjiC Erd+eL9iLYdOcyHraxewUpAKXozIacMilJyGVyjpEgOg2D9z7iXziAEKWBLXmO85pBwPqzCIm5KW OOhysksoiNj+qLCGVypsM2xk+Fb6Uy9BG+eG09xLM7yGwGwdmctNXf+yF45HU3lWdqhlsf8B0aV+ vIf5itlPSlOnlHsOzAcsbJQVKmAJ7OJs72aipglbE2sZdXycisnpz6u996GfGwMiZh0K7aaWJsTJ LX1F+5HwflHXs2KsRjKrCowEavDwQuKoPeHc3Twps6Q+RBc2YClaVwT9fL1uqHa3zvHAM0nVlCe9 iTOXh8SPFTJTt+1n/xaA3WYdNxMU6g6rgAqTbJg65XJ7Wcw/vHrkNz0yR/nxmRhzHDeqqFz43py4 SDhdaHkWKPqbvJCLuIcLc1HAHXa882DBMbH0v8gcjXAQeMZ6xKmf+oBab9tG/uQnuXXW/2h1ivdr vrmHiNUb21LL+yx5LWwKG+ZcCRzNK8fNkVrNZvT30LCTI1bmgn6vkthdwyTiERWeKKG4PAQYNyav p7c49B/DJbMbYOVEtpY4vizytl9rd7LxO2Sd17WFtAXaE0Et/2h5zmIUr0JVBKIrexgv4uA8yRP7 MbO4XoZUP0SeAlGDwv6iyzFIP7BrjEJQ8DvdZuM7jUXIESohoO51xWmU8eh11sJzpNFtoqmr9SUW P1f1fie+pHpW4VdPX4gyeudlU9KeHOp7Gh0lP3fyggel4EnRTcLox3EWLuFQqEN5MF0s0ueeSQv3 iRNCdtD1uwyAV9ECIyIwp9c70LlMQgcOCcDAiZiHY8GrN8vWM87O+XZFbmmSJO16cxgsUiIMNhk8 NGIkmRqMvibFDXQSwgqdCcknyyU0QBpiK1Qf+zrSKJ0= X-Report-Abuse-To: spam@quarantine1.mailspamprotection.com X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2022 23:48:01 -0000 On Wed, 2022-01-19 at 10:45 +0000, Richard Sandiford wrote: > Andras Tantos writes: > > All, > > > > I'm working on porting GCC to a processor architecture that doesn't > > have > > a (HW) stack nor a call instruction. This means that for calls, I > > need > > to generate the following instruction sequence: > > > > // move stack-pointer: > > $sp <- $sp-4 > > // load return address: > > $r3 <- return_label > > // store return address on stack: > > mem[$sp] <- $r3 > > // jump to callee: > > $pc <- > > Even though this is internally a jump, it still needs to be > represented > as a (call …) rtx in rtl, and emitted using emit_call_insn. > > In other words, the "call" expander must always emit a call_insn > of some kind. (But it can emit other instructions too, such as the > ones you describe above.) > > Richard > Richard, Thanks for the reply. While what you're saying makes sense, it didn't solve my problems. The symptoms changed, but didn't completely go away. At the same time, I realized that - in this architecture - link- register-style calls are more efficient anyway, so I've changed my call implementation to that configuration. That got rid of the need for sloving this particular problem. So, just to document for people who might be looking at this thread in the future: this wasn't the complete answer to my problem, but I took a different route which removed the whole problem class. Thanks again, Andras