qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Stefan Weil <sw@weilnetz.de>, qemu-devel <qemu-devel@nongnu.org>,
	Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [Qemu-devel] [PATCH] cpu-exec: Fix compiler warning (-Werror=clobbered)
Date: Wed, 18 Sep 2013 09:48:05 +0200	[thread overview]
Message-ID: <52395AB5.60309@web.de> (raw)
In-Reply-To: <CAFEAcA-iaVkgohK3xKiVy_8_GtYTUizMXfAJr+c+PXUU1KPxgg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1567 bytes --]

On 2013-09-18 09:26, Peter Maydell wrote:
> On 18 September 2013 08:06, Jan Kiszka <jan.kiszka@web.de> wrote:
>> On 2013-09-17 23:24, Peter Maydell wrote:
>>> On 17 September 2013 18:03, Stefan Weil <sw@weilnetz.de> 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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  reply	other threads:[~2013-09-18  7:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-17 17:03 [Qemu-devel] [PATCH] cpu-exec: Fix compiler warning (-Werror=clobbered) Stefan Weil
2013-09-17 17:17 ` Jan Kiszka
2013-09-17 17:27   ` Stefan Weil
2013-09-17 21:24 ` Peter Maydell
2013-09-18  7:06   ` Jan Kiszka
2013-09-18  7:26     ` Peter Maydell
2013-09-18  7:48       ` Jan Kiszka [this message]
2013-10-28 19:18         ` Stefan Weil
2013-10-29  8:07           ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52395AB5.60309@web.de \
    --to=jan.kiszka@web.de \
    --cc=anthony@codemonkey.ws \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).