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

if @generated functions missing source file and line number information #57572

Open
nsajko opened this issue Feb 28, 2025 · 0 comments
Open

if @generated functions missing source file and line number information #57572

nsajko opened this issue Feb 28, 2025 · 0 comments
Labels
bug Indicates an unexpected problem or unintended behavior observability metrics, timing, understandability, reflection, logging, ...

Comments

@nsajko
Copy link
Contributor

nsajko commented Feb 28, 2025

The file and line of source code are recorded as none:0:

julia> methods(Base.Math.var"#s706#1")
# 1 method for generic function "#s706#1" from Base.Math:
 [1] var"#s706#1"(::Any, x, p)
     @ none:0

julia> methods(Base.Math.var"#s706#2")
# 1 method for generic function "#s706#2" from Base.Math:
 [1] var"#s706#2"(::Any, z, p)
     @ none:0

julia> versioninfo()
Julia Version 1.13.0-DEV.139
Commit f5ce2497208 (2025-02-28 07:25 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × AMD Ryzen 3 5300U with Radeon Graphics
  WORD_SIZE: 64
  LLVM: libLLVM-19.1.7 (ORCJIT, znver2)
  GC: Built with stock GC
Threads: 1 default, 1 interactive, 1 GC (on 8 virtual cores)
Environment:
  JULIA_NUM_PRECOMPILE_TASKS = 4
  JULIA_PKG_PRECOMPILE_AUTO = 0

The functions seem to be originate here:

julia/base/math.jl

Lines 95 to 101 in b0323ab

if @generated
N = length(p.parameters::Core.SimpleVector)
ex = :(p[end])
for i in N-1:-1:1
ex = :(muladd(x, $ex, p[$i]))
end
ex

julia/base/math.jl

Lines 120 to 139 in b0323ab

if @generated
N = length(p.parameters)
a = :(p[end])
b = :(p[end-1])
as = []
for i in N-2:-1:1
ai = Symbol("a", i)
push!(as, :($ai = $a))
a = :(muladd(r, $ai, $b))
b = :(muladd(-s, $ai, p[$i]))
end
ai = :a0
push!(as, :($ai = $a))
C = Expr(:block,
:(x = real(z)),
:(y = imag(z)),
:(r = x + x),
:(s = muladd(x, x, y*y)),
as...,
:(muladd($ai, z, $b)))

@nsajko nsajko added bug Indicates an unexpected problem or unintended behavior observability metrics, timing, understandability, reflection, logging, ... labels Feb 28, 2025
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 observability metrics, timing, understandability, reflection, logging, ...
Projects
None yet
Development

No branches or pull requests

1 participant