• Russ Cox's avatar
    cmd/8c: fix store to complex uint64 ptr · 30bc5d7b
    Russ Cox authored
    Assignment of a computed uint64 value to an
    address derived with a function call was executing
    the call after computing the value, which trashed
    the value (held in registers).
    
    long long *f(void) { return 0; }
    void g(int x, int y) {
            *f() = (long long)x | (long long)y<<32;
    }
    
    Before:
    
    (x.c:3)	TEXT	g+0(SB),(gok(71))
    ...
    (x.c:4)	ORL	AX,DX
    (x.c:4)	ORL	CX,BX
    (x.c:4)	CALL	,f+0(SB)
    (x.c:4)	MOVL	DX,(AX)
    (x.c:4)	MOVL	BX,4(AX)
    
    After:
    (x.c:3)	TEXT	g+0(SB),(gok(71))
    (x.c:4)	CALL	,f+0(SB)
    ...
    (x.c:4)	ORL	CX,BX
    (x.c:4)	ORL	DX,BP
    (x.c:4)	MOVL	BX,(AX)
    (x.c:4)	MOVL	BP,4(AX)
    
    Fixes #3501.
    
    R=ken2
    CC=golang-dev
    https://golang.org/cl/5998043
    30bc5d7b
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...