linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Chen Gang <gang.chen@asianux.com>
Cc: Michael Neuling <mikey@neuling.org>,
	"paulus@samba.org" <paulus@samba.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	jovi.zhangwei@huawei.com
Subject: Re: [Suggestion] powerpc: xmon: about 'longjmp' related warning.
Date: Tue, 23 Jul 2013 23:58:10 +1000	[thread overview]
Message-ID: <20130723135809.GG31944@concordia> (raw)
In-Reply-To: <51ECD91D.7090903@asianux.com>

On Mon, Jul 22, 2013 at 03:02:53PM +0800, Chen Gang wrote:
> Hello Maintainers:
> 
> With allmodconfig and EXTRA_CFLAGS=-W", it reports warnings below:

> 
> arch/powerpc/xmon/xmon.c:3027:6: warning: variable ‘i’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
> arch/powerpc/xmon/xmon.c:3068:6: warning: variable ‘i’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]

In both these cases we are inside the body of a for loop and we do a
if (setjmp) / else block. Although looking at the source the value of i
is not modified by the setjmp, I guess it's possible that the compiler
might reorder the increment of i inside the setjmp and loose the value
when we longjmp.

> arch/powerpc/xmon/xmon.c:352:48: warning: argument ‘fromipi’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]

This one I can't see, but I assume it's a similar case.

> Excuse me, I am not quite sure about it whether can cause issue or not.

I've never seen it get stuck in those loops or anything, but I guess
it's possible.

The first thing to do would be to analyse the generated assembler code
to determine if there really is any possiblity of the value being
clobbered, or if it's just a theoretical bug.

cheers

  reply	other threads:[~2013-07-23 13:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-22  7:02 [Suggestion] powerpc: xmon: about 'longjmp' related warning Chen Gang
2013-07-23 13:58 ` Michael Ellerman [this message]
2013-07-24  0:38   ` Chen Gang
2013-07-26  4:11     ` Chen Gang
2013-07-26 11:45       ` Chen Gang
2013-07-26 11:47         ` Chen Gang
2013-07-26 11:55         ` Chen Gang

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=20130723135809.GG31944@concordia \
    --to=michael@ellerman.id.au \
    --cc=akpm@linux-foundation.org \
    --cc=gang.chen@asianux.com \
    --cc=jovi.zhangwei@huawei.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=paulus@samba.org \
    /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).