Comments (8)
Also the current issue is very similar to this one #53062
from julia.
# @code_lowered TestStruct(10)
CodeInfo(
1 ─ #9 = %new(Main.:(var"#9#10"))
│ %2 = #9
│ %3 = 1:size
│ Main.foreach(%2, %3)
│ %5 = Main.TestStruct(size, Main.nothing)
└── return %5
)
# @code_llvm TestStruct(10)
; @ In[24]:1 within `TestStruct`
define void @julia_TestStruct_4659({ i64, {}* }* noalias nocapture noundef nonnull sret({ i64, {}* }) align 8 dereferenceable(16) %0, [1 x {}*]* noalias nocapture noundef nonnull align 8 dereferenceable(8) %1, i64 signext %2) #0 {
top:
; @ In[24]:5 within `TestStruct`
%3 = getelementptr inbounds [1 x {}*], [1 x {}*]* %1, i64 0, i64 0
store {}* inttoptr (i64 4368531464 to {}*), {}** %3, align 8
%.repack = getelementptr inbounds { i64, {}* }, { i64, {}* }* %0, i64 0, i32 0
store i64 %2, i64* %.repack, align 8
%.repack1 = getelementptr inbounds { i64, {}* }, { i64, {}* }* %0, i64 0, i32 1
store {}* inttoptr (i64 4368531464 to {}*), {}** %.repack1, align 8
ret void
}
# @code_native TestStruct(10)
.section __TEXT,__text,regular,pure_instructions
.build_version macos, 14, 0
.globl _julia_TestStruct_4907 ; -- Begin function julia_TestStruct_4907
.p2align 2
_julia_TestStruct_4907: ; @julia_TestStruct_4907
; ┌ @ In[24]:1 within `TestStruct`
; %bb.0: ; %top
mov x9, #32776
movk x9, #1122, lsl #16
movk x9, #1, lsl #32
; │ @ In[24]:5 within `TestStruct`
str x9, [x0]
stp x1, x9, [x8]
ret
; └
; -- End function
.subsections_via_symbols
from julia.
Reduced to the following
function foo(size)
foreach(1:size) do
println(i)
end
end
function foo()
foreach(1:10) do
println(i)
end
end
foo(10) # returns without errors
foo() # errors
from julia.
I think this is wrong
# @code_llvm foo(10)
; @ In[75]:1 within `foo`
define void @julia_foo_5731(i64 signext %0) #0 {
top:
ret void
}
In addition
Base.infer_effects(foo, (Int,))
(+c,+e,+n,+t,+s,+m,+i)
Base.infer_effects(foo, ())
(+c,+e,!n,+t,+s,+m,+i)
from julia.
This seems fixed on v1.11 / master, but I am not sure which of the effect-fix PRs would have fixed it and needs to be backported
from julia.
The fix is bisected to #50805 (first time I used automatic bisect run 'script'
, but the PR makes sense to me)
With this script
bisectscript.jl
function foo(size)
try
foreach(1:size) do
println(i)
end
catch e
return 1
end
return 0
end
if foo(10) === 0
exit(0)
else
exit(1)
end
from julia.
This will be fixed on v1.10.1. In particular, #53076 fixed this issue.
from julia.
Thanks for your report and bisect, @bvdmitri !
from julia.
Related Issues (20)
- Possible bug in 1.9 heuristics branch HOT 2
- Feature: a way for macros to determine when they're in the top scope HOT 1
- Strange parser error message for `"x".3` HOT 4
- Deeply recursive types highlight performance issue in sysimg creation, type_in_worklist is inefficient. HOT 8
- Regression in performance of copying small vectors w/for loop HOT 6
- Unnecessary Box of Multi-Method Local Function
- download ca cert error on Linux on Julia 1.10.1 HOT 15
- REPL: unterminated single quote test failing on Windows CI
- Dead link in documentation HOT 3
- `@doc` changes behaviour during testing HOT 3
- frequent segfault in threads tests in GC
- Rename @scriptdir to @script, and look for environments in parent directories
- interpolate variables within markdown admonitions HOT 4
- Broken backward compatibility with Juliacall HOT 4
- REPL history navigation should not mutate history by default HOT 3
- nightly: Cannot load Pkg and REPL in module on LOAD_PATH if REPLExt is in no environment HOT 1
- Unreachable reached at 0x... HOT 2
- Don't box captured variables that are not assigned after closure declaration HOT 6
- Add a function to get indices from a RegexMatch HOT 4
- slow subtyping of complex Union HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from julia.