File tree 2 files changed +32
-1
lines changed
src/cmd/compile/internal/gc
2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -1006,7 +1006,7 @@ func calcHasCall(n *Node) bool {
1006
1006
1007
1007
// When using soft-float, these ops might be rewritten to function calls
1008
1008
// so we ensure they are evaluated first.
1009
- case OADD , OSUB , OMINUS :
1009
+ case OADD , OSUB , OMINUS , OMUL :
1010
1010
if thearch .SoftFloat && (isFloat [n .Type .Etype ] || isComplex [n .Type .Etype ]) {
1011
1011
return true
1012
1012
}
Original file line number Diff line number Diff line change
1
+ // run -gcflags=-d=softfloat
2
+
3
+ // Copyright 2018 The Go Authors. All rights reserved.
4
+ // Use of this source code is governed by a BSD-style
5
+ // license that can be found in the LICENSE file.
6
+
7
+ package main
8
+
9
+ import (
10
+ "fmt"
11
+ )
12
+
13
+ // When using soft-float, OMUL might be rewritten to function
14
+ // call so we should ensure it was evaluated first. Stack frame
15
+ // setup for "test" function call should happen after call to runtime.fmul32
16
+
17
+ var x int32 = 1
18
+
19
+ func main () {
20
+ var y float32 = 1.0
21
+ test (x , y * y )
22
+ }
23
+
24
+ //go:noinline
25
+ func test (id int32 , a float32 ) {
26
+
27
+ if id != x {
28
+ fmt .Printf ("got: %d, want: %d\n " , id , x )
29
+ panic ("FAIL" )
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments