Re: [PATCH v2] s390: disable -Warray-bounds

From: Heiko Carstens
Date: Tue Apr 26 2022 - 08:19:10 EST


On Mon, Apr 25, 2022 at 02:17:42PM +0200, Sven Schnelle wrote:
> gcc-12 shows a lot of array bound warnings on s390. This is caused
> by our S390_lowcore macro:
>
> which uses an hardcoded address of 0. Wrapping that with
> absolute_pointer() works, but gcc no longer knows that a 12 bit
> instruction is sufficient to access lowcore. So it emits instructions
> like 'lghi %r1,0; l %rx,xxx(%r1)' instead of a single load/store
> instruction. As s390 stores variables often read/written in lowcore,
> this is considered problematic. Therefore disable -Warray-bounds on
> s390 when gcc-12 is used until there is a better real solution.
>
> Signed-off-by: Sven Schnelle <svens@xxxxxxxxxxxxx>
> ---
> Changes in v2:
> - only remove -Warray-bounds for gcc-12
>
> arch/s390/Makefile | 10 ++++++++++
> 1 file changed, 10 insertions(+)

Applied, thanks!