This is the mail archive of the gcc-help@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]

Is there any other optimization for memory?


Hi,

Gcc manual describes "memory" clobber in a inline assembly as follows:

If your assembler instructions access memory in an unpredictable
fashion, add `memory' to the list of clobbered registers. This will
cause GCC to not keep memory values cached in registers across the
assembler instruction and not optimize stores or loads to that memory.

I have two questions about it.

1. "This will cause GCC to not keep memory values cached in registers
***across*** the assembler instruction"
What's the exact meaning of "across"? I think that the gcc will reload
a memory value into a register ***after*** the assembler instruction.
Is that the case?

2.  "and not optimize stores or loads to that memory"
Except caching memory values in registers, is there any other
optimizaiton for stores or loads to memory?


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