lightning
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fallback_casx build error on s390x


From: Paulo César Pereira de Andrade
Subject: Re: fallback_casx build error on s390x
Date: Mon, 3 Oct 2022 09:42:19 -0300

Em dom., 2 de out. de 2022 às 14:49, Paul Cercueil
<paul@crapouillou.net> escreveu:

  Hi Paul,

> In file included from deps/lightning/lib/jit_s390.c:1570,
>                  from deps/lightning/lib/lightning.c:3700:
> deps/lightning/lib/jit_fallback.c: In function '_fallback_casx':
> deps/lightning/lib/jit_fallback.c:157:10: error: void value not ignored
> as it ought to be
>   157 | jump = bnei(_jit->pc.w, r0, 1);
>       | ^
> deps/lightning/lib/lightning.c: In function '_redundant_store':
> deps/lightning/lib/lightning.c:3098:1: warning: control reaches end of
> non-void function [-Wreturn-type]
>  3098 | }
>       | ^
> make: *** [Makefile:394: deps/lightning/lib/lightning.o] Error 1

  The first implementation of the fallback was not tested, and there
were bugs or cases it would not compile as you did notice.

  Please test with a more recent git checkout.

> It looks to me like jit_fallback.c expects "bnei" to return a
> jit_word_t. Shouldn't it use bnei_p() instead? But then some archs
> (e.g. MIPS) don't provide bnei_p().

    Only the s390 port has an optimization for conditional branches
that do not need to be patched. Other ports eventually could also
have such optimization, when there are short branch instructions
relative to the instruction pointer.

  Either way, the fallback CAS should now only be used for armv6
or older and hppa. (I need to cleanup the Itanium preprocessor
checks, as I was able to test in an Itanium system, and did add
the proper code generation for compare and swap).

> The warning is also a bit concerning.
>
> Cheers,
> -Paul

Thanks!
Paulo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]