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]
Other format: [Raw text]

Re: inline asm string/line break rules change


On Saturday 13 April 2002 21:31, Andi Kleen wrote:
> Joel Sherrill <joel@OARcorp.com> writes:
> > If there was a discussion on this, I must not have missed
> > it or not realized the potential impact.  I sure don't want
> > to begin to modify other code bases until I know the intention.
>
> It's also a big problem for the linux kernel and for various other
> packages.

kernel is fixed for a long time and there are only a few packages out there 
using inline assembly heavily.

>  Even if there should be good reasons to discourage multi line string
> I think it shouldn't be warned until an alternative inline assembly
> syntax that doesn't rely on strings exists. Currently it is discouraging
> one practice with no good replacement.

Please? A warning is there since gcc-3.0! And adding the 3 chars \n\ to each 
multiline isn't that hard, with Joel's example:

 asm volatile(" movw %%ds,%0  
                movw %, %%es" 
               : "=r" (tmp_segment) :
               : "0" (tmp_segment) );


would turn into

 asm volatile(" movw %%ds,%0  \n\
                movw %, %%es" 
               : "=r" (tmp_segment) :
               : "0" (tmp_segment) );

Seems easy enough to me (did it to the ppc assmbly in glibc for example).

Franz.


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