<div dir="ltr"><div style="font-size:12.8px">Hello,</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I am facing an issue with a small test where there is a chance that sign-extension is not introduced as expected -</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>#include <stdio.h></div><div><br></div><div>void func( long x )</div><div>{</div><div>    printf(" %ld \n", x);</div><div>}</div><div><br></div><div>int main()</div><div>{</div><div>    char c = -1;</div><div>    func ( c );  // c is zero extended to x</div><div>    return 0;</div><div>}</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">generated IR - </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>define i32 @main() #0 {<br></div><div> ........</div><div>  store i8 -1, i8* %c, align 1</div><div>  %2 = load i8, i8* %c, align 1</div><div><b><i>  <u>%3 = zext i8 %2 to i64</u></i></b></div><div>  call void @func(i64 %3)</div><div>}</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">The value to the formal argument is zero-extended, different from x86_64. Is this a known issue ? Am I missing anything ?</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thanks,</div><div style="font-size:12.8px">Somenath</div><div style="font-size:12.8px"><br></div></div>