I also wonder if you have something like LTO enabled.

No, he doesn't enable LLVM LTO.  Even if it did, LTO wouldn't touch
the 'CC1000SendReceiveP*' definitions because they are not static
(unless he explicitly built with an export map).

Interesting.

I haven't analyzed what is going on in this example though.  The
code is probably using some undefined behavior and getting zapped.

This access is being eliminated:

 _cil_inline_tmp_23 =
   ((unsigned int)
    *((uint8_t const *) ((void const *) ((unsigned char *) 0U)) +
     1) << 8) | (unsigned int) *((uint8_t const *) ((void const *)        

GCC generates

        movzbl  1, %eax
        movzbl  0, %edx
        sall    $8, %eax
        orl     %edx, %eax
        ret

so probably LLVM is eliminating NULL pointer accesses, or something like that. This is the undefined behavior.

Thanks for following up.

Paolo

Reply via email to