This is the mail archive of the 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

On Mar 6, 2008, at 12:56 PM, Richard Guenther wrote:

On Thu, Mar 6, 2008 at 6:29 PM, Chris Lattner <> wrote:
No, gcc was never doing that, and there is no point to start doing
If inline asm thinks it can't trust the psABI, it has to do cld on
its own.
And AFAIK inline asm that uses stos*/movs* etc. typically has cld at
beginning. If inline asm uses std, it must do cld before returning
back to
compiler generated code (again, from what I've seen asm that uses std
has the corresponding cld too).

You forget that there is a ton of code in the world that does:

void foo() {
  asm ( " rep; movsb", ...)

Knowing that the direction flag is clear on entry to the function.
You propose auditing all the *existing* inline asm code active in the
world?  I thought the issue here was that *user* space can't trust
that the direction flag is clear because of the kernel bug: if so,
this isn't just about inline asm in the kernel.

Such code was broken in the past anyway, no need to try to fix that now.

How so?


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