RE: objtool warning "uses BP as a scratch register" with clang-9

From: David Laight
Date: Fri Aug 30 2019 - 12:12:10 EST


From: Arnd Bergmann
> Sent: 30 August 2019 16:59
...
> > Or even better, it would be great if we could get Clang to change their
> > memset() insertion heuristics, so that KASAN acts more like non-KASAN
> > code in that regard.
>
> I suspect that's going to be harder. The clang-9 release is going to be
> soon, and that change probably wouldn't be considered a regression fix.
>
> Maybe Nick can find what happens, but I don't actually see any reference
> to KASAN in the llvm source code related to the memset generation.
>
> https://github.com/llvm-mirror/clang/blob/master/lib/CodeGen/CGExprAgg.cpp#L1803
> has a check for >16 bytes, but that again does not match my observation.

That looks like the code for initialising a local structure variable,
not for merging 'random' writes into a memset().

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)