[PATCH v8 07/14] riscv: prevent compressed instructions in alternatives
Christoph Hellwig
hch at lst.de
Thu Mar 31 02:56:58 PDT 2022
On Thu, Mar 24, 2022 at 01:07:03AM +0100, Heiko Stuebner wrote:
> Instructions are opportunistically compressed by the RISC-V assembler
> when possible, but in alternatives-blocks both the old and new content
> need to be the same size, so having the toolchain do somewhat random
> optimizations will cause strange side-effects like
> "attempt to move .org backwards" compile-time errors.
>
> Already a simple "and" used in alternatives assembly will cause these
> mismatched code sizes.
>
> So prevent compressed instructions to be generated in alternatives-
> code and use option-push and -pop to only limit this to the relevant
> code blocks
Yes, that makes sense:
Reviewed-by: Christoph Hellwig <hch at lst.de>
More information about the linux-riscv
mailing list