Re: [PATCH] powerpc/lib/xor_vmx: Relax frame size for clang

From: Christophe Leroy
Date: Fri Sep 09 2022 - 01:02:04 EST




Le 08/09/2022 à 15:48, Segher Boessenkool a écrit :
> On Thu, Sep 08, 2022 at 06:00:24AM +0000, Christophe Leroy wrote:
>> Looking at it more deeply, I see strange things.
>
> I'll have to see full generated machine code to be able to see strange
> things, there isn't enough information at all here yet. Sorry.

Well, what I call strange is the fact that with GCC the number of bytes
reported by -Wframe-larger-than doesn't match the value the offset used
for the stwu at the start of the function, while it does with clang.

>
> Use private mail if it is too big or uninteresting for the list :-)
>
>> What is that frame size ? I thought it was the number of bytes r1 is
>> decremented at the begining of the function, but it seems not, at least
>> on GCC. It seems GCC substrats 112 bytes while clang doesn't.
>
> That is the vars size + the fixed size + the size of the parameter
> save area + the size of the regs save area, rounded up to a multiple
> of 16. Fixed size is 8 on 32-bit PowerPC ELF. Frame size used by GCC
> here is just the vars size.

Ok, so it means that the stack utilisation is underestimated when using
GCC ? Or is it clang that overestimates it ?

>
>> So it seems that GCC and CLANG don't warn on the same thing, is that
>> expected ? GCC substrats 112 bytes, which is the minimum frame size on a
>> ppc64, but here I'm building a ppc32 kernel, min frame size is 16.
>
> I need to see the generated code to make sense of what is happening
> here. It sounds like it is doing varargs calls or similar expensive
> stack juggling. Or just saving a boatload of registers on the stack.
>

Ok, I'll send it to you. But once again, I don't mind what the code
really look like, I'm just worried that GCC doesn't report the entire
stack usage.


Christophe