[LLVMdev] bug or expected behaviour?

Carl Norum carl at lytro.com
Tue Jun 4 17:28:23 PDT 2013


On Jun 4, 2013, at 5:20 PM, Tyler Hardin <tghardin1 at catamount.wcu.edu> wrote:

> I tried the "extern" specifier, which (I guess) you should use if the definition isn't in the file; and it worked with -O3.

That 'extern' doesn't do anything - it's implicit.  Did you try without it and get different results?  In my test here with the Mac OS X dev tools version of clang, I got the expected results, both for x86 and for ARM.  I guess it's possible it's ARM related.  What version of clang/llvm did you use for your test?

-- Carl



> Input code:
> extern void external(void);
> void test(char *x)
> {
>     x--;
>     if (!x)
>     {
>         external();
>     }
> }
> 
> Command:
> clang -S -o volatile-test.s -O3 test.c
> 
> Output attached.
> 
> The only line of interest is probably:
>     jmp    external                # TAILCALL
> <extern-test.s>





More information about the llvm-dev mailing list