• Than McIntosh's avatar
    cmd/compile: second attempt at fix for issue 23179 · 841d865a
    Than McIntosh authored
    My previous fix for issue 23179 was incomplete; it turns out that if
    an unnamed parameter is below a specific size threshold, it gets
    register-promoted away by the compiler (hence not encountered during
    some parts of DWARF inline info processing), but if it is sufficiently
    large, it is allocated to the stack as a named variable and treated as
    a regular parameter by DWARF generation. Interestingly, something in
    the ppc64le build of k8s causes an unnamed parameter to be retained
    (where on amd64 it is deleted), meaning that this wasn't caught in my
    amd64 testing.
    
    The fix is to insure that "_" params are treated in the same way that
    "~r%d" return temps are when matching up post-optimization inlined
    routine params with pre-inlining declarations. I've also updated the
    test case to include a "_" parameter with a very large size, which
    also triggers the bug on amd64.
    
    Fixes #23179.
    
    Change-Id: I961c84cc7a873ad3f8f91db098a5e13896c4856e
    Reviewed-on: https://go-review.googlesource.com/84975
    Run-TryBot: Than McIntosh <thanm@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarDavid Chase <drchase@google.com>
    Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
    Reviewed-by: 's avatarHeschi Kreinick <heschi@google.com>
    841d865a
b.go 241 Bytes