Hellu
I submitted a patch for windows/amd64 (
http://codereview.appspot.com/
4958042/diff/9011/src/pkg/runtime/windows/amd64/sys.s)
This patch has assembler code which causes two 6l warnings.
First, my procedure has more POPs than PUSHes.
That's OK, it is not a procedure designed to be called from C code,
this code is to deal with callback thunks.
6l warns it as "unbalanced PUSH/POP"
It can be easily workaround as:
MOVQ 0(SP), DX // POPQ DX
MOVQ 8(SP), AX // POPQ AX
ADDQ $16, SP
But this causes reviewer's warnings "why not just POP?":
http://codereview.appspot.com/4958042/diff/9011/src/pkg/runtime/windows/amd64/sys.s
Also I do not like this kind of workaround as it makes code bigger.
Source code, binary code and comments to explain what is if for and
why not just POP)
Second, the procedure needs to save 8 64-byte registers to follow
windows/amd64 calling convention.
If I wrote 8 PUSHQ and 8 POPQ, 6l warns
runtime.callbackasm: nosplit stack overflow
120 assumed on entry to runtime.callbackasm
40 after runtime.callbackasm uses 80
32 on entry to runtime.cgocallback
0 after runtime.cgocallback uses 32
-8 on entry to runtime.cgocallbackg
The procedure is executed on OS thread stack, which is virtually
unlimited.
If I workaround if with MOVQ, ... then you know the story :)
So, how to deal with the 6l warnings?
Even if 6l warns, not fails, it causes building process to stop.
So I cannot just ignore them.