qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

mem3.ssa (1046B)


      1 # Ember Sawady reported this bug
      2 # in stack-slot coalescing
      3 
      4 type :type.3 = align 8 { l 1, l 1 }
      5 type :tags.2 = { { :type.3 1 } }
      6 type :type.1 = align 8 { w 1, :tags.2 1 }
      7 type :tags.9 = { { w 1 } }
      8 type :type.8 = align 4 { w 1, :tags.9 1 }
      9 
     10 function :type.1 $func() {
     11 @start.0
     12 	%object.5 =l alloc8 24
     13 	%object.7 =l alloc4 8
     14 	%binding.21 =l alloc8 16
     15 	%object.23 =l alloc8 24
     16 @body.4
     17 	%.10 =l add %object.7, 4
     18 	jnz 1, @matches.13, @next.14
     19 @matches.13
     20 	# binding.21 gets fused with object.23
     21 	storel 1, %binding.21
     22 	%value.22 =l add %binding.21, 8
     23 	storel 2, %value.22
     24 	%.24 =l add %object.23, 8
     25 	# but the blit direction is not set correctly
     26 	blit %binding.21, %.24, 16
     27 	ret %object.23
     28 @next.14
     29 	storew 2543892678, %object.5
     30 	ret %object.5
     31 }
     32 
     33 export function w $main() {
     34 @start.27
     35 	%object.43 =l alloc8 24
     36 	%object.49 =l alloc8 24
     37 @body.28
     38 	%returns.34 =:type.1 call $func()
     39 	%value.47 =l add %returns.34, 16
     40 	%load.48 =l loadl %value.47
     41 	%.33 =w ceql %load.48, 2
     42 	jnz %.33, @passed.32, @failed.31
     43 @failed.31
     44 	call $abort()
     45 @passed.32
     46 	ret 0
     47 }
     48