* don't zero out in a move in the VM

* Add testcases for #17199

* Update tests/arc/tarcmisc.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* Update tests/vm/tissues.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* Fix test failures

* Fix test

* Fix tests

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
This commit is contained in:
Clyybber 2021-03-26 13:05:51 +01:00 • committed by GitHub
commit bb3769975b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 63 additions and 18 deletions

View file

@ -1354,9 +1354,10 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest; m: TMagic) =
if dest < 0: dest = c.getTemp(arg.typ)
gABC(c, arg, whichAsgnOpc(arg, requiresCopy=false), dest, a)
# XXX use ldNullOpcode() here?
c.gABx(n, opcLdNull, a, c.genType(arg.typ))
c.gABx(n, opcNodeToReg, a, a)
c.genAsgnPatch(arg, a)
# Don't zero out the arg for now #17199
# c.gABx(n, opcLdNull, a, c.genType(arg.typ))
# c.gABx(n, opcNodeToReg, a, a)
# c.genAsgnPatch(arg, a)
c.freeTemp(a)
of mNodeId:
c.genUnaryABC(n, dest, opcNodeId)