qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] cpu-exec: Fix compiler warning (-Werror=clobber


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH] cpu-exec: Fix compiler warning (-Werror=clobbered)
Date: Wed, 18 Sep 2013 09:48:05 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2013-09-18 09:26, Peter Maydell wrote:
> On 18 September 2013 08:06, Jan Kiszka <address@hidden> wrote:
>> On 2013-09-17 23:24, Peter Maydell wrote:
>>> On 17 September 2013 18:03, Stefan Weil <address@hidden> wrote:
>>>> could you please review this patch which removes code added by you earlier?
>>>> I have run tests with the old code and assertions to see whether the values
>>>> were really smashed. They never were, and from the documentation of setjmp
>>>> I'd not expect that they ever might be.
>>>
>>> We had a discussion about this back in 2011. Any compiler which needs
>>> these statements is definitely buggy -- the C standard mandates that
>>> they're not needed.
>>
>> I'm not that sure about this. We have a no-return function involved
>> between setjmp and the actual longjmp. Why should the compiler have to
>> preserve local variables when entering cpu_loop_exit?
> 
> Because the C standard specification for setjmp and longjmp
> says it must (if they are not changed between the setjmp and
> the longjmp call; locals which are changed need not be preserved).
> I quoted the relevant section from C99 in the discussion I linked.

> And gcc's documentation of the 'noreturn' attribute specifically
> says it does not affect the exceptional path where the function
> returns via longjmp.

OK, that is the clarifying bit of information.

Now the question is if want to drop support for faulty compilers again,
work around the false-positive warning, or avoid the issue differently
than via reloading.

Jan


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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