-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
reg 1.31 : variable used in GEP cause other constant to be threaded as if equal to 0 #4362
Comments
Better test case: void main()
{
int[2][1] arr;
assert(&(arr[0][0]) !is &(arr[0][1]));
ubyte RR = 0;
assert(&(arr[RR][0]) !is &(arr[RR][1])); // fails
} can that be caused by the switch to untyped pointers ? |
Link to godbolt with AST and LLVM IR output: https://godbolt.org/z/aajE5nKK3 The ASTs are different: // LDC 1.30
assert(&arr[cast(ulong)RR][0] !is &arr[cast(ulong)RR][1]);
// LDC 1.31
assert(&arr[cast(ulong)RR] + 0LU !is &arr[cast(ulong)RR] + 4LU); The new offset addition ; LDC 1.30
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %18, i32 0, i64 1
; LDC 1.31
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0
%15 = bitcast [2 x i32]* %14 to i32* |
Does this issue still happen when opaque pointers are enabled? |
We're hitting Lines 27 to 28 in 0d4d711
The problem is that the pointer is |
Yeah, the AST is invalid, but that's hard to fix now? |
Note sure about the title however see https://godbolt.org/z/ePxshnvvc.
In the second case, the same pointer is displayed twice, unless you add the
const
storage class toRR
.The text was updated successfully, but these errors were encountered: