Index: src/cmd/compile/internal/ssa/config.go
--- src/cmd/compile/internal/ssa/config.go.orig
+++ src/cmd/compile/internal/ssa/config.go
@@ -41,6 +41,7 @@ type Config struct {
 	hasGReg        bool      // has hardware g register
 	ctxt           *obj.Link // Generic arch information
 	optimize       bool      // Do optimization
+	noDuffDevice   bool      // Don't use Duff's device
 	useAvg         bool      // Use optimizations that need Avg* operations
 	useHmul        bool      // Use optimizations that need Hmul* operations
 	SoftFloat      bool      //
@@ -191,6 +192,7 @@ func NewConfig(arch string, types Types, ctxt *obj.Lin
 		c.haveBswap64 = true
 		c.haveBswap32 = true
 		c.haveBswap16 = true
+		c.noDuffDevice = true
 	case "386":
 		c.PtrSize = 4
 		c.RegSize = 4
@@ -236,6 +238,7 @@ func NewConfig(arch string, types Types, ctxt *obj.Lin
 		c.haveBswap64 = true
 		c.haveBswap32 = true
 		c.haveBswap16 = true
+		c.noDuffDevice = true
 	case "ppc64":
 		c.BigEndian = true
 		fallthrough
@@ -303,6 +306,7 @@ func NewConfig(arch string, types Types, ctxt *obj.Lin
 		c.FPReg = framepointerRegS390X
 		c.LinkReg = linkRegS390X
 		c.hasGReg = true
+		c.noDuffDevice = true
 		c.BigEndian = true
 		c.unalignedOK = true
 		c.haveBswap64 = true
@@ -323,6 +327,7 @@ func NewConfig(arch string, types Types, ctxt *obj.Lin
 		c.FPReg = framepointerRegMIPS
 		c.LinkReg = linkRegMIPS
 		c.hasGReg = true
+		c.noDuffDevice = true
 	case "riscv64":
 		c.PtrSize = 8
 		c.RegSize = 8
@@ -350,6 +355,7 @@ func NewConfig(arch string, types Types, ctxt *obj.Lin
 		c.FPReg = framepointerRegWasm
 		c.LinkReg = linkRegWasm
 		c.hasGReg = true
+		c.noDuffDevice = true
 		c.useAvg = false
 		c.useHmul = false
 	default:
