http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50705
Bug #: 50705
Summary: Wrong assembly generated in ppc 476
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: blocker
Priority: P3
Component: c
AssignedTo: [email protected]
ReportedBy: [email protected]
I built a GCC Little-Endian 32-bit Cross compiler for powerpc 476 with the
below components.
1. GCC 4.6.1
2. GLIBC 2.13
3. BINUTILS 2.21.53
4. Linux kernel headers 2.6.39
I used the same to build Linux kernel 2.6.39.4 in Little-Endian 32-bit.
The kernel while coming up in start_kernel does calls as shown below
start_kernel --> pidhash_init --> alloc_large_system_hash.
kernel/pid.c
1) When pidinit_hash with HASH_EARLY & HASH_SMALL args call
alloc_large_system_hash here at pid.c, line::5362
the if condition fails.
Condition::
HASH_EARLY 0x1
HASH_SMALL 0x2
flags value is 0x3
therefore the below if is expected to pass, but it fails.
if(flags & HASH_EARLY)
reason: it generates "rlwinm r0,r7,1,31,31" with r7 = 3 this instruction
results in 0 and jumps to 0x70305bf4 as shown in
without_print/objdump_without_print file at line:: 980046.
After i added a prink before "if" the condition passed as the assembly
generated is different as as shown in
with_print/objdump_print file at line:: 980044.
I have encountered another bitwise and failing in
arch/powerpc/mm/mmu_context_nohash.c at
"mmu_has_feature(MMU_FTR_47x)"