From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2.elektronenpumpe.de (mail2.elektronenpumpe.de [185.160.0.248]) by sourceware.org (Postfix) with ESMTPS id 75AA53858D28 for ; Wed, 15 Feb 2023 16:40:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 75AA53858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=elektronenpumpe.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=elektronenpumpe.de Received: from [127.0.0.1] (84-115-225-51.cable.dynamic.surfer.at [84.115.225.51]) by elektronenpumpe.de (Postfix) with ESMTPSA id DF091320006; Wed, 15 Feb 2023 17:40:21 +0100 (CET) Date: Wed, 15 Feb 2023 17:40:19 +0100 From: Bernhard Krug To: Richard Earnshaw , newlib@sourceware.org Subject: Re: [PATCH] libc: arm: setjmp jmp_buf exagerated size In-Reply-To: References: Message-ID: <7074AE0F-4BFC-48B4-AE8B-DCCA22D0105E@elektronenpumpe.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On February 15, 2023 5:12:04 PM GMT+01:00, Richard Earnshaw wrote: > > >On 15/02/2023 11:09, Bernhard Krug wrote: >> Patch sets correct jmp_buf size for armv6-m conforming to implementatio= n in setjmp=2ES >>=20 >> FYI a table of cortex architectures: >> __ARM_ARCH_6M__ cortex-m0/m0+/m1 no fpu option >> __ARM_ARCH_7M__ cortex-m3 no fpu option >> __ARM_ARCH_7EM__ cortex-m4 optional fpu >> check using __ARM_FP > >I don't think it's as simple as this=2E The ABI supports three variants,= two of which are call compatible=2E > >hard-float (where you must have hardware FP) >soft (where you haven't got any hardware FP) >softfp (where you have hardware FP but need to inter-operate with code th= at doesnt)=2E > >soft and softfp are call compatible and so any jump-bufs created need to = support saving and restoring the FP context=2E > >I guess a configure-time option to disable support for softfp might be an= option, but the default needs to ensure things are compatible=2E > >R=2E As far as I understand the source in setjmp=2ES in the case of armv6-m it = is=2E Looking in the source=20 https://github=2Ecom/bminor/newlib/blob/master/newlib/libc/machine/arm/set= jmp=2ES#L89 How I read this: It will never copy more than ten registers because of the= exclusive #if #else =2E=2E=2E But okay let it be 20 registers=2E Then does it have to be "long long" only for special chips that use wider = registers in their FPU? Then I'll hope for a decision-tree ARM_ARCH_xy ARM_FP ARM_NEON in the futu= re :)