Skip to content

Commit

Permalink
cmd/6g, cmd/internal/gc: use Etype instead of Ostk
Browse files Browse the repository at this point in the history
Change-Id: Ifda5d84b28717986c93b63767298180a6d6236c0
Reviewed-on: https://go-review.googlesource.com/10140
Reviewed-by: Russ Cox <[email protected]>
  • Loading branch information
josharian committed May 18, 2015
1 parent 2b063bd commit ddc9339
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/cmd/6g/ggen.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func dodiv(op int, nl *gc.Node, nr *gc.Node, res *gc.Node) {
* known to be dead.
*/
func savex(dr int, x *gc.Node, oldx *gc.Node, res *gc.Node, t *gc.Type) {
r := int(reg[dr])
r := reg[dr]

// save current ax and dx if they are live
// and not the destination
Expand All @@ -318,15 +318,15 @@ func savex(dr int, x *gc.Node, oldx *gc.Node, res *gc.Node, t *gc.Type) {
x.Type = gc.Types[gc.TINT64]
gmove(x, oldx)
x.Type = t
oldx.Ostk = int32(r) // squirrel away old r value
oldx.Etype = r // squirrel away old r value
reg[dr] = 1
}
}

func restx(x *gc.Node, oldx *gc.Node) {
if oldx.Op != 0 {
x.Type = gc.Types[gc.TINT64]
reg[x.Reg] = uint8(oldx.Ostk)
reg[x.Reg] = oldx.Etype
gmove(oldx, x)
gc.Regfree(oldx)
}
Expand Down
3 changes: 1 addition & 2 deletions src/cmd/internal/gc/syntax.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Node struct {
Nointerface bool
Ullman uint8 // sethi/ullman number
Addable bool // addressable
Etype uint8 // op for OASOP, etype for OTYPE, exclam for export
Etype uint8 // op for OASOP, etype for OTYPE, exclam for export, 6g saved reg
Bounded bool // bounds check unnecessary
Class uint8 // PPARAM, PAUTO, PEXTERN, etc
Embedded uint8 // ODCLFIELD embedded type
Expand Down Expand Up @@ -97,7 +97,6 @@ type Node struct {
Lineno int32
Xoffset int64
Stkdelta int64 // offset added by stack frame compaction phase.
Ostk int32 // 6g only
Iota int32
Walkgen uint32
Esclevel Level
Expand Down

0 comments on commit ddc9339

Please sign in to comment.