This is the mail archive of the gcc-patches@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: [PATCH, i386]: Emit cld instruction when stringops are used


Hi,

On Fri, 7 Mar 2008, Jakub Jelinek wrote:

> > >  That is pretty unambiguous.  GCC always preserves this property as
> > >  well, in absence of the kernel bug.
> > 
> > Nothin prevents GCC from doing
> > 
> >  std;
> >  backward string op;
> >  asm("...");
> >  another backward string op;
> >  cld;
> 
> Given that there is tons of inline asm that has cld in it or
> "std; ...; cld", I'd say that if GCC tries that, it will break a lot of
> code.

I think what Richard wanted to bring up was that the entry conditions of 
asms aren't specified.  The chosen example is suboptimal as it could also 
suggest that the second backward-op could rely on the DF flags still being 
set after the first one (i.e. that the inline asm didn't change it).  I 
think it wasn't Richards intention to imply that.

Should we ever start lazily emitting std, I think we should make inline 
asms clobber it (it clobbers flags anyway).  But for now this point is of 
course mood.


Ciao,
Michael.


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