-
Notifications
You must be signed in to change notification settings - Fork 37
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
swiftc IF issue #62
Comments
I can't replicate this issue, which Swift release/architecture/distribution are you using? My prebuilt 5.1.1? I'm asking because swiftc should produce a |
Yes. Your pre-built. pi@RPi4B:~ $ swiftc -v I'm running on a RPi 4B 4GB with 32 bit Raspbain Buster. |
I'm building the 5.12 release from source. I had to move the llvm-project contents down to the base directory for build.sh to run. Since I'm running on a RPi 4B with 4GB, I passed on the swap file section of instructions. I'll let you know how it turns out. (still building) |
The 5.12 build corrected the IF compare issue. Would you like a link to the swift-5.1.2_armv7.tgz file on my server? |
Replies in reverse order ;)
Weird, just to keep this logged somewhere, if you still have the 5.1.1
Starting from scratch works too, good to know that a manual copy works too, thanks.
This was the same configuration I tried it on, very strange issue. |
Your request was too late. I no longer have 5.1.1 installed or the bad 1mil that was generated. |
Oh ok, no problem. |
There seems to be a problem with an IF compare with swiftc. The swift interpreter works fine.
// Swift - 1mil.swift
var accum = 0
var milvar = 1000000
for _ in 1...1000000 {
accum += 1
milvar -= 1
if accum == milvar {
print("Middle")
}
}
print("Plus: ", accum)
print("Minus: ", milvar)
Interpretive
$ /usr/bin/time swift 1mil.swift
Middle
Plus: 1000000
Minus: 0
0.80user 0.05system 0:00.86elapsed 99%CPU (0avgtext+0avgdata 78392maxresident)k
240inputs+0outputs (2major+4179minor)pagefaults 0swaps
Compiled
$ swiftc 1mil.swift
$ ls -l 1mil
-rwxr-xr-x 1 pi pi 14524 Nov 25 17:08 1mil
$ /usr/bin/time ./1mil
Plus: 1000000
Minus: 0
0.24user 0.01system 0:00.25elapsed 99%CPU (0avgtext+0avgdata 6428maxresident)k
0inputs+0outputs (0major+268minor)pagefaults 0swaps
The text was updated successfully, but these errors were encountered: