https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80114

--- Comment #8 from Arnd Bergmann <arnd at linaro dot org> ---
Looking at the kernel code again, I came up with an alternative that avoids the
large stack size and produces good executable code in all configurations I
found with the file that showed up a -Wframe-larger-than= warning for me, with
slightly larger .rodata and .data sections

-#define _PICK(__index, ...) (((const u32 []){ __VA_ARGS__ })[__index])
+#define _PICK(__index, ...) ({static const u32 __arr[] = { __VA_ARGS__ };
__arr[__index];})

Unfortunately this requires a constant argument set, and a number of other
files contain callers with non-constant arguments. We'd have to see if those
can be changed to use constant arguments instead.

Reply via email to