Re: Question about local register variable

2013-08-28 Thread DJ Delorie
The purpose of local register variables is to tell gcc which register to use in an inline asm, when multiple registers could be used. Other uses are not supported and usually don't work the way you expect, especially when optimizing. If all you want is a function which returns the value in a spe

Question about local register variable

2013-08-28 Thread Jing Yu
Hi, I am wondering if the following piece of code is supposed to be valid. void* reg_v13() { register void* r __asm__ ("r13"); return r; } I did test with gcc on powerpc64, and confirmed that the function really returns r13 (thread pointer) value. However, LLVM issues a warning complaining