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

[Bug rtl-optimization/50065] -Os, -O2, -O3 optimization breaks LD/ST ordering on 32-bit SPARC


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50065

--- Comment #3 from Zhangxi Tan <tanzhangxi at gmail dot com> 2011-08-14 00:57:07 UTC ---
The code is equivalent to

volatile unsigned char lock;
int remap_barrier;

while (atomic_test_and_set(lock)) {
   while (lock) {
     ;
   }
}
remap_barrier++;
lock = 0;

Eric: could you let me know you you think the code inside function  
spinlock_lock(&remap_lock) is a NOP? This is a suggested lock implementation by
the SPARC spec. Also, the arch_write_lock/unlock in the SPARC port of Linux
uses a very similar implementation.

Andrew: could you let me know in which version I can find this ipa-sra fix? At
least, the stable 4.6.1 doesn't work.


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