Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

[address of label] llvm-gcc generates bad assembly: invalid sections for operation on ... #8767

Open Quuxplusone opened 13 years ago

Quuxplusone commented 13 years ago
Bugzilla Link PR8407
Status REOPENED
Importance P normal
Reported by Markus F.X.J. Oberhumer (markus@oberhumer.com)
Reported on 2010-10-18 09:20:21 -0700
Last modified on 2011-04-12 11:22:21 -0700
Version trunk
Hardware PC Linux
CC anton@korobeynikov.info, baldrick@free.fr, bob.wilson@apple.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments llvm_gcc_bad_assembly.c (1428 bytes, text/plain)
Blocks
Blocked by
See also
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;
}
Quuxplusone commented 13 years ago

Attached llvm_gcc_bad_assembly.c (1428 bytes, text/plain): Small C source code to demonstrate the problem.

Quuxplusone commented 13 years ago

Works fine with clang, llvm-gcc is no longer supported.

Quuxplusone commented 13 years ago

This is still an issue with dragonegg.