bridge: multicast: work around clang bug
Subsystems (3)
PATCH 1/1 bridge: multicast: work around clang bug
Clang-10 and clang-11 run into a corner case of the register allocator on 32-bit ARM, leading to excessive stack usage from register spilling:
net/bridge/br_multicast.c:2422:6: error: stack frame size of 1472 bytes in function 'br_multicast_get_stats' [-Werror,-Wframe-larger-than=]
Work around this by marking one of the internal functions as noinline_for_stack.
--- net/bridge/br_multicast.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/bridge/br_multicast.c +2 -1
@@ -2413,7 +2413,8 @@ void br_multicast_uninit_stats(struct net_bridge *br)free_percpu (br->mcast_stats); } -static void mcast_stats_add_dir (u64 *dst,u64 *src) +/* noinline for https://bugs.llvm.org/show_bug.cgi?id=45802#c9 */ +static noinline_for_stack void mcast_stats_add_dir(u64 *dst, u64 *src) { dst[BR_MCAST_DIR_RX ] += src[BR_MCAST_DIR_RX ]; dst[BR_MCAST_DIR_TX ] += src[BR_MCAST_DIR_TX ];
Signature · 1 line
2.26.2
From: Arnd Bergmann <[email protected]>
Date: Wed, 27 May 2020 15:51:13 +0200
Quoted 11 lines
Clang-10 and clang-11 run into a corner case of the register allocator on 32-bit ARM, leading to excessive stack usage from register spilling:
net/bridge/br_multicast.c:2422:6: error: stack frame size of 1472 bytes in function 'br_multicast_get_stats' [-Werror,-Wframe-larger-than=]Work around this by marking one of the internal functions as
noinline_for_stack.
Applied.