tccgen: 32bits: fix PTR +/- long long
commited15cddacd145c74e4600af50f6616ba59ca0d8d
authorgrischka <grischka>
Thu, 13 Oct 2016 17:21:43 +0000 (13 19:21 +0200)
committergrischka <grischka>
Thu, 13 Oct 2016 17:21:43 +0000 (13 19:21 +0200)
treefd1a7a73ace9aadd3ad9f0a6b60ccb084c090813
parent8986bc8af473080bed0efa01cb569f3e25f179a9
tccgen: 32bits: fix PTR +/- long long

Previously in order to perform a ll+ll operation tcc
was trying to 'lexpand' PTR in gen_opl which did
not work well.  The case:

    int printf(const char *, ...);
    char t[] = "012345678";

    int main(void)
    {
        char *data = t;
        unsigned long long r = 4;
        unsigned a = 5;
        unsigned long long b = 12;

        *(unsigned*)(data + r) += a - b;

        printf("data %s\n", data);
        return 0;
    }
tccgen.c
tests/tests2/87_ptr_longlong_arith32.c [new file with mode: 0644]
tests/tests2/87_ptr_longlong_arith32.expect [new file with mode: 0644]