Hi All,<br>Since few days I observe weird change.<br>Consider the following C code<br><br>char array[] = "0123456789";<br>extern int test(char arr[], int size);<br><br>int main(void) {<br> return test(array-1, sizeof(array)-1);<br>
}<br><br>using clang frontend i get this:<br><br>%call = call i32 @test(i8* getelementptr inbounds ([11 x i8]* @array, i32 0, i32 -1), i32 10) ; <i32> [#uses=1]<br><br>and using LLVM-GCC this:<br>%1 = call i32 @test(i8* getelementptr ([11 x i8]* @array, i32 1561806289, i32 4), i32 10) nounwind ; <i32> [#uses=1]<br>
<br>Should the second getelementptr look like this? Is it correct or a bug?<br>Since that change there's a problem in MSIL backend - it simply triggers pointer overflow assertion.<br><br>Artur<br>