-
Notifications
You must be signed in to change notification settings - Fork 13.5k
LLVM miscompiles a function from Wine #8933
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
Comments
Hi Charles. I'd like to investigate this, but the testcase is invalid. $ llc mmap.ll -o - after fixing that: $ llc mmap.ll -o - |
LLVM IR of entire source file from Wine |
The problem is still present in trunk, by the way. |
LLVM IR of miscompiled function from Wine Here's one without any debug info, and only the stuff needed to compile @reserve_area. That should be a little more manageable. I ran this through llc as well just to make sure it wasn't malformed. |
Still present in trunk. I compiled Wine with Clang at -O1 just now (with Clang trunk), and it runs just fine (i.e. no stack overflow, no segfault). The problem must be one of the optimization passes that gets enabled at -O2. |
Reduced LLVM IR of miscompiled reserve_area() |
Seems to work at: and wine-1.4-rc3-23-gd548af4. There's a crash on first start of wine, that's bug 9844. After that though, at least basic stuff works. Charles, please confirm. |
Yeah, it works. Resolving old bug that turns out not to be a bug in LLVM at all. (Sorry it took so long to get back on this...) |
Extended Description
Now that #8790 is fixed (thanks, Chris!), I took a stab at building Wine with Clang at -O2. It builds successfully, but unfortunately, the resulting Wine segfaults on start-up. This happens before Wine installs its own signal handlers, so the OS picks it up and produces a backtrace. The backtrace pointed to the "reserve_area" function.
I've isolated this function and compiled it to LLVM IR. I don't know where or why this is happening, but this is preventing Wine from being usable when compiled at -O2.
From looking at the source, this function is a recursive function, so that could have something to do with it.
The text was updated successfully, but these errors were encountered: