OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] mark read_crX() asm code as volatile
Re: [PATCH] mark read_crX() asm code as volatile [message #21192 is a reply to message #21145] Wed, 03 October 2007 08:45 Go to previous message
Andi Kleen is currently offline  Andi Kleen
Messages: 33
Registered: February 2006
Member
> 
> How does the compiler know it doesn't depend on memory?

When it has no m (or equivalent like g) constrained argument 
and no memory clobber.
 
> How do you say it depends on memory?

You add any of the above.

> You really need something as heavy as volatile?

You could do a memory clobber, but it would be heavier than the volatile
because the memory clobber clobbers all cached variables. volatile essentially 
just says "don't remove; has side effects". Normally gcc does that automatically
for something without outputs, but this one has.

Besides a CRx access does not actually clobber memory.

-Andi
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH] Consolidate IPC namespace cleanup functions
Next Topic: [patch 0/1][NETNS49] Make af_unix autobind per namespace
Goto Forum:
  


Current Time: Thu Aug 15 07:41:07 GMT 2024

Total time taken to generate the page: 0.03716 seconds