-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
-indvars miscompilation of Qt #1387
Comments
assigned to @lattner |
Devang, can you take a look at this when you get a chance? Thx, -Chris |
Devang, any news on this one? |
Reduced testcase: static const char foo[] = "\0abc"; int test(int J) { void main() { $ llvm-gcc t.c -S -o - -O0 -emit-llvm | llvm-as | opt -mem2reg -instcombine -indvars -adce | lli |
Fixed. Testcase here: Transforms/IndVarsSimplify/2007-01-06-TripCount.ll Patch here: -Chris |
Improve TODO messages: - `genLocation()` was used instead of `getCurrentLocation` in many places that intended to print the current location. Rename it to `genUnknownLocation()` to avoid confusion in the futur. - Thread/Compute the location when possible instead of using TODO_NOLOC. - Ensure the location is set when entering not yet implemented constructs (toLocation() might return an empty location in case the construct is the first of an anonymous program)
Extended Description
Consider the input file qappl.ll. Look into bb101 and next BBs. This code
corresponds to the following code in cpp (this is extract from Qt):
qappl.out.ll is output from opt -indvars. We have:
cond_next109: ; preds = %bb101
%exitcond = setne uint %indvar, 0 ; [#uses=1]
br bool %exitcond, label %bb98, label %bb114
%tmp103 corresponds to mouseTbl[i], %tmp106 - to msg.message. %indvar
corresponds to i/3.
Let us assume, that they equals, when i!=0. We have:
%tmp107 = true => branch to cond_next109 => %exitcond = true => branch to bb98
And we have infinite loop here :(
The text was updated successfully, but these errors were encountered: