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

Regression with newest Julia? #29253

Closed
PetrKryslUCSD opened this issue Sep 18, 2018 · 9 comments · Fixed by #33563
Closed

Regression with newest Julia? #29253

PetrKryslUCSD opened this issue Sep 18, 2018 · 9 comments · Fixed by #33563
Labels
bug Indicates an unexpected problem or unintended behavior compiler:optimizer Optimization passes (mostly in base/compiler/ssair/)

Comments

@PetrKryslUCSD
Copy link

One of the tests of my package fails with Julia Version 1.1.0-DEV.279, for Linux, Mac, and 32-bit Windows (64-bit Windows test passes okay):

 LoadError: type Nothing has no field m
  Stacktrace:
   [1] getproperty at .\sysimg.jl:18 [inlined]
   [2] size at C:\cygwin\home\Administrator\buildbot\worker\package_win32\build\usr\share\julia\stdlib\v1.1\SparseArrays\src\sparsematrix.jl:36 [inlined]
   [3] size at .\abstractarray.jl:38 [inlined]
@KristofferC
Copy link
Member

Which package? In what test?

@PetrKryslUCSD
Copy link
Author

Sorry: left that out by mistake. It is FinEtools. I put the failing test into test_test.jl. Example failure: https://travis-ci.org/PetrKryslUCSD/FinEtools.jl/jobs/430167610

@KristofferC
Copy link
Member

typeof(K) = SparseArrays.SparseMatrixCSC{Float64,Int64}
K = nothing

That's interesting

@KristofferC
Copy link
Member

KristofferC commented Sep 18, 2018

Here is an MWE

function test(K)
    if true
          try
              error()
          catch e
          end
      end
      size(K,1)
end
K = rand(2,2)
test(K)
typeof(K) = Array{Float64,2}
K = nothing
julia> @code_typed optimize = false test(K)
CodeInfo(
2 1 ─      goto #6 if not true                                                                 │
3 2 ─      $(Expr(:enter, #4))                                                                 │
4 3 ─      (Main.error)()::Union{}                                                             │
  │        Const(:($(Expr(:leave, 1))), false)::Union{}                                        │
  └──      Const(:(goto %8), false)::Union{}                                                   │
  4 ┄      $(Expr(:leave, 1))                                                                  │
  5 ─      (e = $(Expr(:the_exception)))::Any                                                  │
8 6 ─ %8 = (Main.size)(K, 1)::Int64                                                            │
  └──      return %8                                                                           │
) => Int64

julia> @code_typed test(K)
CodeInfo(
  1 ─      nothing::Nothing                                                              │
3 2 ─      $(Expr(:enter, #4))                                                           │
4 3 ─      invoke Main.error()::Union{}                                                  │
  └──      $(Expr(:unreachable))::Union{}                                                │
  4 ┄      $(Expr(:leave, 1))                                                            │
  5 ─      nothing::Nothing                                                              │
8 │   %7 = (Base.arraysize)(nothing, 1)::Int64        <-----                                   │╻ size
  └──      return %7                                                                     │
) => Int64

cc @Keno

@mbauman mbauman added bug Indicates an unexpected problem or unintended behavior compiler:optimizer Optimization passes (mostly in base/compiler/ssair/) labels Sep 18, 2018
@KristofferC
Copy link
Member

Bisected to fda953b.

@PetrKryslUCSD
Copy link
Author

PetrKryslUCSD commented Sep 18, 2018

EDIT: After I posted the below: Oops, I just realized I ran it with 1.0! Which I guess explains why it runs fine.

Interestingly the MWE Kristoffer posted above works just fine on Windows 10.

julia> @code_typed optimize = false test(K)
CodeInfo(
2 1 ─      goto #6 if not true                                                                                                                                                                                     │
3 2 ─      $(Expr(:enter, #4))                                                                                                                                                                                     │
4 3 ─      (Main.error)()::Union{}                                                                                                                                                                                 │
  │        Const(:($(Expr(:leave, 1))), false)::Union{}                                                                                                                                                            │
  └──      Const(:(goto %8), false)::Union{}                                                                                                                                                                       │
  4 ┄      $(Expr(:leave, 1))                                                                                                                                                                                      │
  5 ─      (e = $(Expr(:the_exception)))::Any                                                                                                                                                                      │
8 6 ─ %8 = (Main.size)(K, 1)::Int64                                                                                                                                                                                │
  └──      return %8                                                                                                                                                                                               │
) => Int64

julia> @code_typed test(K)
CodeInfo(
2 1 ─       goto #6 if not true                                                                                │
3 2 ─       $(Expr(:enter, #4))                                                                                │
  3 ─ %3  = ϒ (K)::Array{Float64,2}                                                                            │
4 │         invoke Main.error()::Union{}                                                                       │
  └──       $(Expr(:unreachable))::Union{}                                                                     │
  4 ┄ %6  = φᶜ (%3)::Array{Float64,2}                                                                          │
  └──       $(Expr(:leave, 1))                                                                                 │
  5 ─       nothing::Nothing                                                                                   │
8 6 ─ %9  = φ (#5 => %6, #1 => _2)::Array{Float64,2}                                                           │
  │   %10 = (Base.arraysize)(%9, 1)::Int64                                                                     │╻ size
  └──       return %10                                                                                         │
  7 ─       goto #4                                                                                            │
) => Int64

@Keno
Copy link
Member

Keno commented Sep 19, 2018

I presume this is the same underlying problem as #29107, so should be temporarily worked around by #29265

@Nosferican
Copy link
Contributor

Should this be closed?

@KristofferC
Copy link
Member

Would be good to have a test for this first.

yhls added a commit to yhls/julia that referenced this issue Dec 14, 2019
… counted

this led to stuff being erroneously removed by `simple_dce!`
this fixes JuliaLang#29253
yhls added a commit to yhls/julia that referenced this issue Dec 15, 2019
…ot counted

This fixes JuliaLang#29253, which was caused by `simple_dce!` erroneously erasing SSA
values that did not appear to be used, because these uses were only discovered
in `just_fixup!` at the end of iterating over an `IncrementalCompact`.
yhls added a commit to yhls/julia that referenced this issue Dec 17, 2019
…ot counted

This fixes JuliaLang#29253, which was caused by `simple_dce!` erroneously erasing SSA
values that did not appear to be used, because these uses were only discovered
in `just_fixup!` at the end of iterating over an `IncrementalCompact`.
yhls added a commit to yhls/julia that referenced this issue Dec 17, 2019
…ot counted

This fixes JuliaLang#29253, which was caused by `simple_dce!` erroneously erasing SSA
values that did not appear to be used, because these uses were only discovered
in `just_fixup!` at the end of iterating over an `IncrementalCompact`.
yhls added a commit to yhls/julia that referenced this issue Mar 11, 2020
…ot counted

This fixes JuliaLang#29253, which was caused by `simple_dce!` erroneously erasing SSA
values that did not appear to be used, because these uses were only discovered
in `just_fixup!` at the end of iterating over an `IncrementalCompact`.
yhls added a commit to yhls/julia that referenced this issue Mar 11, 2020
…ot counted

This fixes JuliaLang#29253, which was caused by `simple_dce!` erroneously erasing SSA
values that did not appear to be used, because these uses were only discovered
in `just_fixup!` at the end of iterating over an `IncrementalCompact`.
yhls added a commit to yhls/julia that referenced this issue Apr 1, 2020
…ot counted

This fixes JuliaLang#29253, which was caused by `simple_dce!` erroneously erasing SSA
values that did not appear to be used, because these uses were only discovered
in `just_fixup!` at the end of iterating over an `IncrementalCompact`.
yhls added a commit to yhls/julia that referenced this issue Aug 3, 2020
…ot counted

This fixes JuliaLang#29253, which was caused by `simple_dce!` erroneously erasing SSA
values that did not appear to be used, because these uses were only discovered
in `just_fixup!` at the end of iterating over an `IncrementalCompact`.
yhls added a commit to yhls/julia that referenced this issue Aug 3, 2020
…ot counted

This fixes JuliaLang#29253, which was caused by `simple_dce!` erroneously erasing SSA
values that did not appear to be used, because these uses were only discovered
in `just_fixup!` at the end of iterating over an `IncrementalCompact`.
vchuravy pushed a commit that referenced this issue Aug 21, 2020
…ot counted

This fixes #29253, which was caused by `simple_dce!` erroneously erasing SSA
values that did not appear to be used, because these uses were only discovered
in `just_fixup!` at the end of iterating over an `IncrementalCompact`.
vchuravy pushed a commit that referenced this issue Aug 21, 2020
…ot counted

This fixes #29253, which was caused by `simple_dce!` erroneously erasing SSA
values that did not appear to be used, because these uses were only discovered
in `just_fixup!` at the end of iterating over an `IncrementalCompact`.
simeonschaub pushed a commit to simeonschaub/julia that referenced this issue Aug 29, 2020
…ot counted

This fixes JuliaLang#29253, which was caused by `simple_dce!` erroneously erasing SSA
values that did not appear to be used, because these uses were only discovered
in `just_fixup!` at the end of iterating over an `IncrementalCompact`.
vchuravy pushed a commit that referenced this issue Oct 5, 2020
…ot counted

This fixes #29253, which was caused by `simple_dce!` erroneously erasing SSA
values that did not appear to be used, because these uses were only discovered
in `just_fixup!` at the end of iterating over an `IncrementalCompact`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior compiler:optimizer Optimization passes (mostly in base/compiler/ssair/)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants