Created attachment 5629
Small C source code to demonstrate the problem.
llvm-gcc seems to generate bad assembly for jump-table offsets.
This could be related to bug2023.
Snippet from the attached source file:
#define LABEL_DIFF(t,a,b) ((t) ((const char*)&&a - (const char*)&&b))
int *test_short(int i)
{
static const short t[] = { 0, LABEL_DIFF(short,l1,l0) };
goto * (const void *) ((const char *)&&l0 + t[i]);
l0: return &a;
l1: return &b;
}
llvm_gcc_bad_assembly.c
(1428 bytes, text/plain)