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

unhappy codegen handling of invalid tuples #41157

Closed
vtjnash opened this issue Jun 9, 2021 · 0 comments · Fixed by #41483
Closed

unhappy codegen handling of invalid tuples #41157

vtjnash opened this issue Jun 9, 2021 · 0 comments · Fixed by #41483
Labels
bug Indicates an unexpected problem or unintended behavior compiler:codegen Generation of LLVM IR and native code regression Regression in behavior compared to a previous version
Milestone

Comments

@vtjnash
Copy link
Member

vtjnash commented Jun 9, 2021

MWE for a codegen bug observed "in the wild"

julia> f(a, b) = a[1] = b[1]
f (generic function with 1 method)

julia> @code_llvm optimize=false raw=true f(Tuple{Int}[], Tuple{Union{}}[])
julia: /data/vtjnash/julia/src/intrinsics.cpp:287: llvm::Value* emit_unboxed_coercion(jl_codectx_t&, llvm::Type*, llvm::Value*): Assertion `to->isIntOrPtrTy() || to->isFloatingPointTy()' failed.

signal (6): Aborted
in expression starting at REPL[3]:1
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7fc43c965728)
__assert_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
emit_unboxed_coercion at /data/vtjnash/julia/src/intrinsics.cpp:287
emit_unbox at /data/vtjnash/julia/src/intrinsics.cpp:353
typed_store at /data/vtjnash/julia/src/cgutils.cpp:1485
emit_builtin_call at /data/vtjnash/julia/src/codegen.cpp:2984
emit_call at /data/vtjnash/julia/src/codegen.cpp:3692
emit_expr at /data/vtjnash/julia/src/codegen.cpp:4509
emit_ssaval_assign at /data/vtjnash/julia/src/codegen.cpp:4160
emit_stmtpos at /data/vtjnash/julia/src/codegen.cpp:4402 [inlined]
emit_function at /data/vtjnash/julia/src/codegen.cpp:7191
jl_emit_code at /data/vtjnash/julia/src/codegen.cpp:7564

https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_date/2021-06/03/SplittablesBase.1.7.0-DEV-9f32653992.log

split from #40065 (comment)

(prior to f313b08, we didn't have an assert here and would just return Undef)

@vtjnash vtjnash added bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version compiler:codegen Generation of LLVM IR and native code backport 1.7 labels Jun 9, 2021
@JeffBezanson JeffBezanson added this to the 1.7 milestone Jun 9, 2021
KristofferC pushed a commit that referenced this issue Jul 7, 2021
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:codegen Generation of LLVM IR and native code regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants