Re: Possible kernel function with stack frame > 2048 bytes

2016-03-27 Thread Michael McConville
Michael McConville wrote:
> Clang 3.7 gives this warning when building the kernel:
> 
> > ../../../../dev/audio.c:1852:1: warning: stack frame size of 2504 bytes in 
> > function 'wskbd_initvol' [-Wframe-larger-than=]
> > wskbd_initvol(struct audio_softc *sc, struct wskbd_vol *vol, char *cn, char 
> > *dn)
> > ^
> 
> -Wframe-larger-than was backported to base GCC, so maybe there's a bug
> that caused it to erroneously overlook this one. It's also possible that
> Clang just compiles this function differently, but >450 bytes seems like
> a really big difference.
> 
> Maybe it isn't worth fixing, but I thought it was worth pointing out. It
> seems like it may have been introduced by the simplifications last June:
> 
> https://marc.info/?t=14340075202&r=1&w=2

I broke out objdump (should have done that initially) and, if I'm
reading the asm right, the stack frame is only 1,688 bytes with base
GCC. Maybe there's more aggressive stack space reuse.



Possible kernel function with stack frame > 2048 bytes

2016-03-27 Thread Michael McConville
Clang 3.7 gives this warning when building the kernel:

> ../../../../dev/audio.c:1852:1: warning: stack frame size of 2504 bytes in 
> function 'wskbd_initvol' [-Wframe-larger-than=]
> wskbd_initvol(struct audio_softc *sc, struct wskbd_vol *vol, char *cn, char 
> *dn)
> ^

-Wframe-larger-than was backported to base GCC, so maybe there's a bug
that caused it to erroneously overlook this one. It's also possible that
Clang just compiles this function differently, but >450 bytes seems like
a really big difference.

Maybe it isn't worth fixing, but I thought it was worth pointing out. It
seems like it may have been introduced by the simplifications last June:

https://marc.info/?t=14340075202&r=1&w=2