[Bug c/48623] New: gcc 4.6.0 generates no code for a function with __attribute__((always_inline))
richard at nod dot at
gcc-bugzilla@gcc.gnu.org
Fri Apr 15 14:23:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48623
Summary: gcc 4.6.0 generates no code for a function with
__attribute__((always_inline))
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: richard@nod.at
gcc 4.6.0 builds a non-functional User Mode Linux kernel.
It seems to optimize away the function sub_preempt_count() used in
kernel/softirq.c:__local_bh_enable().
Thus, the preempt counter gets out of balance and the kernel crashes.
A standalone test case is attached.
Just compile it with:
gcc testcase.c -Os -g -c -o testcase.o
Using objdump you can see that no code was generated for sub_preempt_count().
gcc 4.3, 4.4 and 4.5 generate code.
Without __attribute__((always_inline)) 4.6.0 produces code...
Thanks,
//richard
More information about the Gcc-bugs
mailing list