This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Linux and EGCS
- To: Paul Koning <pkoning at xedia dot com>
- Subject: Re: Linux and EGCS
- From: Linus Torvalds <torvalds at transmeta dot com>
- Date: Wed, 10 Dec 1997 09:05:31 -0800 (PST)
- cc: "Martin.Dalecki" <dalecki at u23 dot num dot math dot uni-goettingen dot de>, egcs at cygnus dot com
- Reply-To: egcs at cygnus dot com
On Wed, 10 Dec 1997, Paul Koning wrote:
>
> Not knowing much about Linux, I simply added them for any __asm__ that
> was documented as "no outputs" but didn't currently have one.
>
> Things seem more stable now.
This sounds like a egcs bug. gcc documentation states that if an asm
doesn't have any outputs, it is automatically considered volatile:
"An instruction without output operands will not be deleted or
moved significantly, regardless, unless it is unreachable."
It turns out that the earlier "lidt" bug that I thought was a Linux bug
also falls under this category. In short, egcs is to be considered buggy,
or at least the documentation needs to be updated.
Quite frankly, I think the old (and documented) gcc behaviour is the
correct one: if an asm does not have any outputs, the only reason for
having that asm in the first place is various "magic side effects" that
you cannot do in C. As such, such an asm should automatically be
considered volatile and not moved.
Linus