From: Greg Ungerer <gerg@uclinux.org>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: linux-m68k@vger.kernel.org
Subject: Re: [PATCH] m68k: use conventional function parameters for do_sigreturn
Date: Tue, 9 Feb 2016 10:21:26 +1000 [thread overview]
Message-ID: <56B93106.4050806@uclinux.org> (raw)
In-Reply-To: <871t8mkcd1.fsf@linux-m68k.org>
Hi Andreas,
On 09/02/16 09:31, Andreas Schwab wrote:
> Greg Ungerer <gerg@uclinux.org> writes:
>> Attached is a test case - derived from the original signal.c code.
>
> It looks like with all those trivial functions in the non-MMU case the
> compiler sees enough to consider the writes to the (pseudo) function
> arguments dead.
>
> How about this:
>
> diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
> index af1c4f3..3cc9eaa 100644
> --- a/arch/m68k/kernel/signal.c
> +++ b/arch/m68k/kernel/signal.c
> @@ -757,6 +757,11 @@ asmlinkage int do_sigreturn(unsigned long __unused)
>
> if (restore_sigcontext(regs, &frame->sc, frame + 1))
> goto badframe;
> + /*
> + * Force a barrier so that the compiler does not consider writes
> + * to *sw and *regs as dead.
> + */
> + barrier();
> return regs->d0;
>
> badframe:
> @@ -781,6 +786,11 @@ asmlinkage int do_rt_sigreturn(unsigned long __unused)
>
> if (rt_restore_ucontext(regs, sw, &frame->uc))
> goto badframe;
> + /*
> + * Force a barrier so that the compiler does not consider writes
> + * to *sw and *regs as dead.
> + */
> + barrier();
> return regs->d0;
>
> badframe:
Yes that works too. It forces generation of correct code.
So what is the best path forward here?
Should I submit a gcc bug report?
Regards
Greg
next prev parent reply other threads:[~2016-02-09 0:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-19 5:56 [PATCH] m68k: use conventional function parameters for do_sigreturn Greg Ungerer
2016-02-01 4:33 ` Greg Ungerer
2016-02-01 18:39 ` Andreas Schwab
2016-02-01 23:59 ` Greg Ungerer
2016-02-02 19:25 ` Andreas Schwab
2016-02-03 4:14 ` Greg Ungerer
2016-02-08 23:31 ` Andreas Schwab
2016-02-09 0:21 ` Greg Ungerer [this message]
2016-02-09 9:48 ` Andreas Schwab
2016-02-09 13:05 ` Greg Ungerer
2016-02-09 13:17 ` Andreas Schwab
2016-02-09 14:01 ` Philippe De Muyter
2016-02-09 14:36 ` Andreas Schwab
2016-02-09 15:26 ` Philippe De Muyter
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=56B93106.4050806@uclinux.org \
--to=gerg@uclinux.org \
--cc=linux-m68k@vger.kernel.org \
--cc=schwab@linux-m68k.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.