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


No, gcc was never doing that, and there is no point to start doing that.
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 the
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.

-Chris


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