@@ -4492,30 +4492,8 @@ func (s *state) intrinsicCall(n *ir.CallExpr) *ssa.Value {
4492
4492
4493
4493
// intrinsicArgs extracts args from n, evaluates them to SSA values, and returns them.
4494
4494
func (s * state ) intrinsicArgs (n * ir.CallExpr ) []* ssa.Value {
4495
- // Construct map of temps; see comments in s.call about the structure of n.
4496
- temps := map [ir.Node ]* ssa.Value {}
4497
- for _ , a := range n .Args {
4498
- if a .Op () != ir .OAS {
4499
- s .Fatalf ("non-assignment as a temp function argument %v" , a .Op ())
4500
- }
4501
- a := a .(* ir.AssignStmt )
4502
- l , r := a .X , a .Y
4503
- if l .Op () != ir .ONAME {
4504
- s .Fatalf ("non-ONAME temp function argument %v" , a .Op ())
4505
- }
4506
- // Evaluate and store to "temporary".
4507
- // Walk ensures these temporaries are dead outside of n.
4508
- temps [l ] = s .expr (r )
4509
- }
4510
- args := make ([]* ssa.Value , len (n .Rargs ))
4511
- for i , n := range n .Rargs {
4512
- // Store a value to an argument slot.
4513
- if x , ok := temps [n ]; ok {
4514
- // This is a previously computed temporary.
4515
- args [i ] = x
4516
- continue
4517
- }
4518
- // This is an explicit value; evaluate it.
4495
+ args := make ([]* ssa.Value , len (n .Args ))
4496
+ for i , n := range n .Args {
4519
4497
args [i ] = s .expr (n )
4520
4498
}
4521
4499
return args
@@ -4528,13 +4506,6 @@ func (s *state) intrinsicArgs(n *ir.CallExpr) []*ssa.Value {
4528
4506
// (as well as the deferBits variable), and this will enable us to run the proper
4529
4507
// defer calls during panics.
4530
4508
func (s * state ) openDeferRecord (n * ir.CallExpr ) {
4531
- // Do any needed expression evaluation for the args (including the
4532
- // receiver, if any). This may be evaluating something like 'autotmp_3 =
4533
- // once.mutex'. Such a statement will create a mapping in s.vars[] from
4534
- // the autotmp name to the evaluated SSA arg value, but won't do any
4535
- // stores to the stack.
4536
- s .stmtList (n .Args )
4537
-
4538
4509
var args []* ssa.Value
4539
4510
var argNodes []* ir.Name
4540
4511
@@ -4567,7 +4538,7 @@ func (s *state) openDeferRecord(n *ir.CallExpr) {
4567
4538
opendefer .closureNode = opendefer .closure .Aux .(* ir.Name )
4568
4539
opendefer .rcvrNode = opendefer .rcvr .Aux .(* ir.Name )
4569
4540
}
4570
- for _ , argn := range n .Rargs {
4541
+ for _ , argn := range n .Args {
4571
4542
var v * ssa.Value
4572
4543
if TypeOK (argn .Type ()) {
4573
4544
v = s .openDeferSave (nil , argn .Type (), s .expr (argn ))
@@ -4853,11 +4824,6 @@ func (s *state) call(n *ir.CallExpr, k callKind, returnResultAddr bool) *ssa.Val
4853
4824
types .CalcSize (fn .Type ())
4854
4825
stksize := fn .Type ().ArgWidth () // includes receiver, args, and results
4855
4826
4856
- // Run all assignments of temps.
4857
- // The temps are introduced to avoid overwriting argument
4858
- // slots when arguments themselves require function calls.
4859
- s .stmtList (n .Args )
4860
-
4861
4827
var call * ssa.Value
4862
4828
if k == callDeferStack {
4863
4829
testLateExpansion = ssa .LateCallExpansionEnabledWithin (s .f )
@@ -4891,7 +4857,7 @@ func (s *state) call(n *ir.CallExpr, k callKind, returnResultAddr bool) *ssa.Val
4891
4857
// Then, store all the arguments of the defer call.
4892
4858
ft := fn .Type ()
4893
4859
off := t .FieldOff (12 )
4894
- args := n .Rargs
4860
+ args := n .Args
4895
4861
4896
4862
// Set receiver (for interface calls). Always a pointer.
4897
4863
if rcvr != nil {
@@ -4966,7 +4932,7 @@ func (s *state) call(n *ir.CallExpr, k callKind, returnResultAddr bool) *ssa.Val
4966
4932
4967
4933
// Write args.
4968
4934
t := n .X .Type ()
4969
- args := n .Rargs
4935
+ args := n .Args
4970
4936
if n .Op () == ir .OCALLMETH {
4971
4937
base .Fatalf ("OCALLMETH missed by walkCall" )
4972
4938
}
0 commit comments