From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds To: Paul Koning Cc: "Martin.Dalecki" , egcs@cygnus.com Subject: Re: Linux and EGCS Date: Wed, 10 Dec 1997 10:58:00 -0000 Message-id: References: <9712101650.AA16396@kona.> X-SW-Source: 1997-12/msg00604.html 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