[lkml]   [2022]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] s390: disable -Warray-bounds
On Fri, Apr 22, 2022 at 10:54:09AM -0700, Kees Cook wrote:
> On Fri, Apr 22, 2022 at 03:43:08PM +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 for now until there is a better real solution.
> >
> > Signed-off-by: Sven Schnelle <>
> It looks like the source of this problem (the literal-values-treated-as-NULL)
> is gcc-12 specific. From the discussions, it sounded like Jacob was
> going to fix this "correctly" in gcc-13. It might be a good idea to make
> this version-checked? (i.e. only disable on gcc-12)

That makes sense, so we still get at least some coverage for compilers
< gcc 12; and also latest clang still seems to do the right thing.

Sven, could you either send an updated patch, or an addon patch,
please? Whatever you prefer.

 \ /
  Last update: 2022-04-25 11:18    [W:0.174 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site