Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 63e39ab

Browse files
committed
O2. Seems tas() for PPC (storage/buffer/s_lock.c) never works if
compiled with -O0. Included are patches that should fix the problem (of course I have confirmed -O2 works with this patch). BTW, here is a platforms/regression test failure(serious one--backend death) matrix. Tatsuo Ishii
1 parent 8111066 commit 63e39ab

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

src/backend/storage/buffer/s_lock.c

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/Attic/s_lock.c,v 1.9 1998/09/01 04:31:44 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/Attic/s_lock.c,v 1.10 1998/09/03 02:14:39 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -95,20 +95,23 @@ s_lock(volatile slock_t *lock, const char *file, const int line)
9595

9696
#if defined(PPC)
9797
/* Note: need a nice gcc constrained asm version so it can be inlined */
98-
int
99-
tas(volatile slock_t *lock)
98+
static void
99+
tas_dummy()
100100
{
101-
__asm__("lwarx 5,0,3 \n\
102-
cmpwi 5,0 \n\
103-
bne fail \n\
104-
addi 5,5,1 \n\
101+
__asm__(" \n\
102+
.global tas \n\
103+
tas: \n\
104+
lwarx 5,0,3 \n\
105+
cmpwi 5,0 \n\
106+
bne fail \n\
107+
addi 5,5,1 \n\
105108
stwcx. 5,0,3 \n\
106-
beq success \n\
107-
fail: li 3,1 \n\
108-
blr \n\
109-
success: \n\
110-
li 3,0 \n\
111-
blr \n\
109+
beq success \n\
110+
fail: li 3,1 \n\
111+
blr \n\
112+
success: \n\
113+
li 3,0 \n\
114+
blr \n\
112115
");
113116
}
114117

0 commit comments

Comments
 (0)