This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Inline Assembly queries
- From: kernel mailz <kernelmailz at googlemail dot com>
- To: gcc at gcc dot gnu dot org, gcc-help at gcc dot gnu dot org
- Date: Sun, 28 Jun 2009 01:19:51 +0530
- Subject: Inline Assembly queries
- References: <abe8a1fd0906271246q920124ard61422d9577e2d09@mail.gmail.com>
Hello All the gurus,
I've been fiddling my luck with gcc 4.3.2 inline assembly on powerpc
There are a few queries
1. asm volatile or simply asm produce the same assembly code.
Tried with a few examples but didnt find any difference by adding
volatile with asm
2. Use of "memory" and clobbered registers.
"memory" -
a. announce to the compiler that the memory has been modified
b. this instruction writes to some memory (other than a listed output)
and GCC shouldn’t cache memory values in registers across this asm.
I tried with stw and stwcx instruction, adding "memory" has no effect.
Is there any example scenerio where gcc would generate different
assembly by adding / removing "memory" ?
-TZ