This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Linux and EGCS




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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]