This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/47286] New: Invalid code when using register ... asm
- From: "anton at samba dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 13 Jan 2011 23:48:24 +0000
- Subject: [Bug tree-optimization/47286] New: Invalid code when using register ... asm
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47286
Summary: Invalid code when using register ... asm
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: anton@samba.org
Target: powerpc64-unknown-linux-gnu
A gcc build from yesterday (4.6.0 20110113) fails when building a ppc64 Linux
kernel. A cut down testcase:
struct thread_info {
int preempt_count;
};
static inline struct thread_info *current_thread_info(void)
{
register struct thread_info *sp asm("r1");
return sp;
}
void testcase(void)
{
current_thread_info()->preempt_count += 1;
}
compiled with -O2:
# gcc -O2 -S testcase.s
has the add optimised away:
.L.testcase:
blr