All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <dan@debian.org>
To: Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>
Cc: Jun Sun <jsun@mvista.com>, Ralf Baechle <ralf@linux-mips.org>,
	David Daney <ddaney@avtrex.com>,
	"Maciej W. Rozycki" <macro@ds2.pg.gda.pl>,
	linux-mips@linux-mips.org
Subject: Re: [patch] Prevent dead code/data removal with gcc 3.4
Date: Sat, 14 Feb 2004 20:44:40 -0500	[thread overview]
Message-ID: <20040215014440.GA19373@nevyn.them.org> (raw)
In-Reply-To: <20040214062849.GA20171@rembrandt.csv.ica.uni-stuttgart.de>

On Sat, Feb 14, 2004 at 07:28:49AM +0100, Thiemo Seufer wrote:
> Jun Sun wrote:
> > On Sat, Feb 14, 2004 at 03:17:40AM +0100, Thiemo Seufer wrote:
> > > Ralf Baechle wrote:
> > > [snip]
> > > > Anyway, gcc could load next weeks lucky lottery numbers into the
> > > > s-registers after saving them.  That'd break save_static but not the
> > > > ABI which only promises to restore the old values in s-registers on
> > > > return.
> > > 
> > > Ok, it could, but adding such insns to the prologue wouldn't make
> > > sense at all, so this is unlikely to happen.
> > > 
> > 
> > OS people who have been around long enough know "unlikely" things
> > always end up happening. :)
> [snip]
> > sys_sigsuspend(struct pt_regs regs)
> > {
> >     8008e280:   27bdffc0        addiu   $sp,$sp,-64
> >     8008e284:   afb00030        sw      $s0,48($sp)
> >         sigset_t *uset, saveset, newset;
> > 
> >         save_static(&regs);
> 
> Which is a compiler bug, because it schedules around __asm__ __volatile__,
> but not a breakage caused by the prologue.
> 
> There's no way to be safe from broken compilers.

Not at all.  It's not code being scheduled around the asm - it's _part
of the prologue_ to save $s0 to the stack.  Register saves are
considered part of the prologue.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

  reply	other threads:[~2004-02-15  1:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-13 14:20 [patch] Prevent dead code/data removal with gcc 3.4 Maciej W. Rozycki
2004-02-13 14:53 ` Ralf Baechle
2004-02-13 17:51   ` Jun Sun
2004-02-13 18:35     ` Maciej W. Rozycki
2004-02-13 22:07       ` Ralf Baechle
2004-02-16  9:18         ` Maciej W. Rozycki
2004-02-13 22:22   ` Thiemo Seufer
2004-02-13 22:35     ` David Daney
2004-02-13 22:50       ` Thiemo Seufer
2004-02-14  1:15         ` Ralf Baechle
2004-02-14  1:22           ` Eric Christopher
2004-02-14  1:28           ` Thiemo Seufer
2004-02-14  1:45             ` Ralf Baechle
2004-02-14  2:17               ` Thiemo Seufer
2004-02-14  6:13                 ` Jun Sun
2004-02-14  6:28                   ` Thiemo Seufer
2004-02-15  1:44                     ` Daniel Jacobowitz [this message]
2004-02-17 12:50         ` Maciej W. Rozycki
2004-06-28 13:12   ` Maciej W. Rozycki

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=20040215014440.GA19373@nevyn.them.org \
    --to=dan@debian.org \
    --cc=ddaney@avtrex.com \
    --cc=ica2_ts@csv.ica.uni-stuttgart.de \
    --cc=jsun@mvista.com \
    --cc=linux-mips@linux-mips.org \
    --cc=macro@ds2.pg.gda.pl \
    --cc=ralf@linux-mips.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.