Here is a simple test case that shows the bug:

#include <stdio.h>

int
main()
{
        int     i = 16;
        __int64 j = 16;
        unsigned __int64        n;

        // Use %p to show all bits

        n = 0x7fffffffffff;
        printf("Init:  n=%p, sizeof(n) = %d\n", n, sizeof(n)); // == 8 Ok!

        n = 0x7fffffffffff;
        n = n / i; // i is an int
        printf("Wrong: n=%p\n", n);

        n = 0x7fffffffffff;
        n = n / j; // j is an __int64
        printf("Wrong: n=%p\n", n);

        n = 0x7fffffffffff;
        n = n / 16;
        printf("Good:  n=%p\n", n);

}






_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to