qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] util/cacheinfo: Fix warning generated by clang


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] util/cacheinfo: Fix warning generated by clang
Date: Sat, 1 Jul 2017 23:30:00 +0100

On 1 July 2017 at 23:20, Richard Henderson <address@hidden> wrote:
> On 06/30/2017 08:39 AM, Pranith Kumar wrote:
>>
>> Clang generates the following warning on aarch64 host:
>>
>>    CC      util/cacheinfo.o
>> /home/pranith/qemu/util/cacheinfo.c:121:48: warning: value size does not
>> match register size specified by the constraint and modifier
>> [-Wasm-operand-widths]
>>          asm volatile("mrs\t%0, ctr_el0" : "=r"(ctr));
>>                                                 ^
>> /home/pranith/qemu/util/cacheinfo.c:121:28: note: use constraint modifier
>> "w"
>>          asm volatile("mrs\t%0, ctr_el0" : "=r"(ctr));
>>                             ^~
>>                             %w0
>
>
> That is an absolutely stupid warning.  There's long precedent for the
> compiler choosing the prefix for you based on the type of the argument.

Isn't that the problem? The type of the argument says "32 bits"
but the instruction here really wants 64 bits (MRS takes Xn, not Wn).

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]