Skip to content

Commit e288329

Browse files
committed
Don't optimize the runtime library.
1 parent 6301d41 commit e288329

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/rtlib.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ function build_runtime(@nospecialize(job::CompilerJob); ctx)
131131
emit_function!(mod, job, def, method)
132132
end
133133

134-
optimize!(job, mod)
134+
# we cannot optimize the runtime library, because the code would then be optimized again
135+
# during main compilation (and optimizing twice isn't safe). for example, optimization
136+
# removes Julia address spaces, which would then lead to type mismatches when using
137+
# functions from the runtime library from IR that has not been stripped of AS info.
135138

136139
mod
137140
end

0 commit comments

Comments
 (0)