This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/13949] New: illigal code
- From: "ysato at users dot sourceforge dot jp" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Jan 2004 15:30:38 -0000
- Subject: [Bug target/13949] New: illigal code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Code corresponding to "nr & 7" is not generate.
It is evaluated as 1UL << nr.
build options -mh -mint32 -O2
- test code -
static inline int test(int nr, void *addr)
{
return ((*((unsigned char *)addr + ((nr >> 3) ^ 3)) & (1UL << (nr & 7))) != 0);
}
int main(void)
{
unsigned long array[10];
int c;
for (c = 0; c < sizeof(array)*8; c++)
if (test(c,array))
break;
}
- output -
.file "test.c"
.h8300h
.section .text
.align 1
.global _main
_main:
mov.l er6,@-er7
mov.l er7,er6
add.l #-40,er7
sub.l er3,er3
mov.l er6,er0
add.l #-40,er0
.L7:
mov.l er3,er2
shar.l er2
shar.l er2
shar.l er2
xor #3,r2l
add.l er0,er2
btst r3l,@er2
bne .L3
adds #1,er3
cmp.l #319,er3
bls .L7
.L3:
add.l #40,er7
mov.l @er7+,er6
rts
.size _main, .-_main
.end
.ident "GCC: (GNU) 3.4.0 20040131 (prerelease)"
--
Summary: illigal code
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ysato at users dot sourceforge dot jp
CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: h8300-elf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13949