Christian Jullien wrote:
Many thanks, I tested your fix but I still have a broken case:

int
main()
{
        unsigned int x = 0xffffffff;
        unsigned int y = 1;

        printf("fixed %08x\n", x >> y);
        printf("fixed %08x\n", (~(unsigned int)0) >> (unsigned int)1);
        printf("fails %08x\n", (~0) >> 1);
}

Christian

But for me results are the same with gcc and tcc

$ gcc test.c -o test && ./test
fixed 7fffffff
fixed 7fffffff
fails ffffffff
$ ./tcc -run test.c
fixed 7fffffff
fixed 7fffffff
fails ffffffff

Maybe gcc is not correct but then I need an exact explanation why ;)



_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to