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

Inlining(?) bug on 0.5 #18015

Closed
swt30 opened this issue Aug 13, 2016 · 6 comments · Fixed by #18017
Closed

Inlining(?) bug on 0.5 #18015

swt30 opened this issue Aug 13, 2016 · 6 comments · Fixed by #18017
Labels
bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version
Milestone

Comments

@swt30
Copy link
Contributor

swt30 commented Aug 13, 2016

The following code works on julia 0.4 but fails on 0.5-rc2. It does, however, work when run through Gallium or when setabc2! is annotated with @noinline.

using Base.Test
import Base: ==

type Triple
  a::Int
  b::Int
  c::Int
end

a(tri) = tri.a
b(tri) = tri.b
c(tri) = tri.c
setabc!(tri, a, b, c) = (tri.a = a; tri.b = b; tri.c = c)
setabc2!(tri, a, b, c) = (tri.a = a; tri.b = b; tri.c = c; nothing)
==(tri1::Triple, tri2::Triple) = ((tri1.a, tri1.b, tri1.c) == (tri2.a, tri2.b, tri2.c))

function main()
  tri = Triple(1, 2, 3)
  tri2 = Triple(1, 2, 3)
  setabc!(tri, b(tri), c(tri), a(tri))
  setabc2!(tri2, b(tri2), c(tri2), a(tri2))
  @test tri == tri2
end

main()

@swt30
Copy link
Contributor Author

swt30 commented Aug 13, 2016

Julia Version 0.5.0-rc2+0
Commit 0350e57 (2016-08-12 11:25 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, broadwell)

@swt30 swt30 changed the title Inlining regression on 0.5 Inlining(?) bug on 0.5 Aug 13, 2016
@vtjnash
Copy link
Member

vtjnash commented Aug 13, 2016

It looks like Jeff deleted the handling of this case in 0547ab4 (https://github.com/JuliaLang/julia/pull/15609/files#diff-c0d983631c937ee5acfd0137cd7332deL2332), but the default fall-through was wrong (returning true instead of false when it couldn't analyze the expression)

@vtjnash vtjnash added bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version labels Aug 13, 2016
@vtjnash vtjnash added this to the 0.5.x milestone Aug 13, 2016
vtjnash added a commit that referenced this issue Aug 13, 2016
@ViralBShah
Copy link
Member

Should this not be 0.5?

@vtjnash
Copy link
Member

vtjnash commented Aug 13, 2016

I thought the v0.5 milestone is closed? Doesn't really matter either way since there's a PR to fix it.

@StefanKarpinski
Copy link
Member

Bugs (which this is) are fair game for the next RC.

@tkelman
Copy link
Contributor

tkelman commented Aug 16, 2016

label is already on the pr, not needed here.

tkelman pushed a commit that referenced this issue Aug 20, 2016
mfasi pushed a commit to mfasi/julia that referenced this issue Sep 5, 2016
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 regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants