All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Wilson <wilson@cygnus.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [Linux-ia64] gcc bug (2.9-ia64-000216-final)
Date: Tue, 03 Oct 2000 01:02:02 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590678205540@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590678205537@msgid-missing>

This is a memory aliasing bug that causes the instruction scheduler to perform
invalid code movement.  It only occurs when both const and volatile are
present on a function argument.

When you use volatile, the compiler forces the argument to the stack.  When
you use const, the compiler marks the stack read as a const read, but does not
also similarly mark the stack write.  Thus the scheduler thinks the write and
read do not alias and can be re-ordered.  If I use -O2 -fno-schedule-insns I
get correct code.  For a more complicated example, you might also need to use
-fno-schedule-insns2.  Or you can just use -O to avoid the problem.

The new toolchain does not have this bug.

Jim


      reply	other threads:[~2000-10-03  1:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-02 22:43 [Linux-ia64] gcc bug (2.9-ia64-000216-final) Steve Tynor
2000-10-03  1:02 ` Jim Wilson [this message]

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=marc-linux-ia64-105590678205540@msgid-missing \
    --to=wilson@cygnus.com \
    --cc=linux-ia64@vger.kernel.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.