This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/50065] -Os, -O2, -O3 optimization breaks LD/ST ordering on 32-bit SPARC
- From: "tanzhangxi at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 14 Aug 2011 00:57:07 +0000
- Subject: [Bug rtl-optimization/50065] -Os, -O2, -O3 optimization breaks LD/ST ordering on 32-bit SPARC
- Auto-submitted: auto-generated
- References: <bug-50065-4@http.gcc.gnu.org/bugzilla/>
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.