mem3.ssa 1.0 KB

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