Work around for the issue TCC doesn't handle -2147483648 properly.

TCC produces code which is incompatible with GCC for the following code:

    printf("%lld\n", (long long)-2147483648);
    printf("%lld\n", (long long)-2147483649);

For now, just avoid using the corner value.
This commit is contained in:
Shinichiro Hamaji
2009-04-18 15:08:01 +02:00
committed by grischka
parent 83fd36333a
commit 51a7f163ad
+1 -1
View File
@@ -685,7 +685,7 @@ static void relocate_section(TCCState *s1, Section *s)
}
}
long diff = val - addr;
if (diff < -2147483648 || diff > 2147483647) {
if (diff <= -2147483647 || diff > 2147483647) {
/* XXX: naive support for over 32bit jump */
if (s1->output_type == TCC_OUTPUT_MEMORY) {
val = add_jmp_table(s1, val);