http://llvm.org/bugs/show_bug.cgi?id=6176
Summary: clang generates wrong code for load from bitfield in
packed struct
Product: clang
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: LLVM Codegen
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
+++ This bug was initially created as a clone of Bug #2394 +++
struct __attribute((packed)) x {int a : 24;};
int a(struct x* g) {return g->a;}
Code generated with llvm-gcc:
a:
movl 4(%esp), %eax
movl (%eax), %eax
shll $8, %eax
sarl $8, %eax
ret
This is broken because the last byte might not be legal to load.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs