mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: disable open-coded defers on riscv64
Open-coded defers are currently broken on riscv64 - disable them for the time being. All of the standard package tests now pass on linux/riscv64. Updates issue #27532 and #36786 Change-Id: I20fc25ce91dfad48be32409ba5c64ca9a6acef1d Reviewed-on: https://go-review.googlesource.com/c/go/+/216517 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Dan Scales <danscales@google.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
d8e052667f
commit
a858d15f11
2 changed files with 10 additions and 1 deletions
|
|
@ -340,12 +340,17 @@ func buildssa(fn *Node, worker int) *ssa.Func {
|
|||
s.startmem = s.entryNewValue0(ssa.OpInitMem, types.TypeMem)
|
||||
|
||||
s.hasOpenDefers = Debug['N'] == 0 && s.hasdefer && !s.curfn.Func.OpenCodedDeferDisallowed()
|
||||
if s.hasOpenDefers && (Ctxt.Flag_shared || Ctxt.Flag_dynlink) && thearch.LinkArch.Name == "386" {
|
||||
switch {
|
||||
case s.hasOpenDefers && (Ctxt.Flag_shared || Ctxt.Flag_dynlink) && thearch.LinkArch.Name == "386":
|
||||
// Don't support open-coded defers for 386 ONLY when using shared
|
||||
// libraries, because there is extra code (added by rewriteToUseGot())
|
||||
// preceding the deferreturn/ret code that is generated by gencallret()
|
||||
// that we don't track correctly.
|
||||
s.hasOpenDefers = false
|
||||
case thearch.LinkArch.Name == "riscv64":
|
||||
// The use of open-coded defers is currently broken on riscv64,
|
||||
// hence disable it for now - see issue golang.org/issue/36786
|
||||
s.hasOpenDefers = false
|
||||
}
|
||||
if s.hasOpenDefers && s.curfn.Func.Exit.Len() > 0 {
|
||||
// Skip doing open defers if there is any extra exit code (likely
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue