Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spurious type instability warning in code_warntype #15714

Closed
yuyichao opened this issue Mar 31, 2016 · 0 comments
Closed

Spurious type instability warning in code_warntype #15714

yuyichao opened this issue Mar 31, 2016 · 0 comments

Comments

@yuyichao
Copy link
Contributor

Probably caused by #15609

See below, notice the ::Any after the assignment to _3 and _4. They looks harmless but annoy...

julia> f3(a) = for i in eachindex(a)
           a[i] += 0
       end
f3 (generic function with 1 method)

julia> @code_warntype f3(Float32[])
Variables:
  #self#::#f3
  a::Array{Float32,1}
  #temp#::Int64
  i::Int64

Body:
  begin  # none, line 1: # abstractarray.jl, line 404: # abstractarray.jl, line 414:
      GenSym(3) = (Base.arraylen)(_2::Array{Float32,1})::Int64 # range.jl, line 83:
      GenSym(4) = (Base.select_value)((Base.sle_int)(1,GenSym(3))::Bool,GenSym(3),(Base.box)(Int64,(Base.sub_int)(1,1)))::Int64
      _3::Any = 1
      8: 
      unless (Base.box)(Base.Bool,(Base.not_int)((_3::Int64 === (Base.box)(Int64,(Base.add_int)(GenSym(4),1)))::Bool)) goto 23
      GenSym(5) = _3::Int64
      GenSym(6) = (Base.box)(Int64,(Base.add_int)(_3::Int64,1))
      _4::Any = GenSym(5)
      _3::Any = GenSym(6) # none, line 2: # promotion.jl, line 172: # promotion.jl, line 135:
      Float32
      Float32
      GenSym(2) = (Base.box)(Base.Float32,(Base.add_float)((Base.arrayref)(_2::Array{Float32,1},_4::Int64)::Float32,(Base.box)(Float32,(Base.sitofp)(Float32,0))))
      (Base.arrayset)(_2::Array{Float32,1},GenSym(2),_4::Int64)::Array{Float32,1}
      21: 
      goto 8
      23: 
      24: 
      return
  end::Void
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant