RFA: MN10300: Include saved registers in stack usage

Jeff Law law@redhat.com
Wed Feb 5 17:23:00 GMT 2014


On 02/05/14 03:44, Nick Clifton wrote:
> Hi Jeff, Hi Alex,
>
>    Sorry - another MN10300 patch - this time for the stack size reported
>    with -fstack-usage.  Currently the value includes the stack frame, but
>    it does not take into account any registers that might have been
>    pushed onto the stack.
>
>    The patch below fixes this problem, but there is one thing that I am
>    not sure about - is it OK to use __builtin_popcount() or should I be
>    calling some other function ?
According to our coding conventions, the ability to build with something 
other than gcc is still desirable.  You could argue that you're unlikely 
to be bootstrapping on a mn103 with something other than GCC and if 
you're building a cross, you could start by first building gcc native.

However, it's pretty easy to avoid the headaches and just provide a 
popcount routine.   I don't think this code is at all performance 
critical (once per function being compiled), so a simple popcount should 
be sufficient.  No need for lookup tables IMHO.

jeff



More information about the Gcc-patches mailing list