[Bug target/28229] New: maybe bug output for sh4a

tyokota at k2 dot dion dot ne dot jp gcc-bugzilla@gcc.gnu.org
Mon Jul 3 02:38:00 GMT 2006


test.c
----------------------
int
main () {
  char ba[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
  short a[4] = { 0x04, 0x05, 0x06, 0x07};

  int c = *((int *)(&a[1]));
  int d = *((int *)(&ba[1]));

  printf("%08x\n", c );
  printf("%08x\n", d );
  return 0;
}
-----
sh-elf-linux -m4a -O2 -S test.c

this code maybe cause data address error exception.
movua.l instruction might not have to be output for sh4a. 

        ...
        mov.l   .L3,r1
        add     #-16,r15
        mov.l   .L4,r2
        mov     r15,r14
        movua.l @r1+,r0
        mov     r14,r3
        add     #8,r3
        mov.l   .L5,r9
        mov.l   r0,@r3
        movua.l @r2+,r0 
        mov     r0,r6
        mov.l   @r1,r0
        mov.l   r6,@r14
        mov     r14,r1
        mov.l   @r2,r6    <--- maybe wrong eliminate movua.l 
        add     #2,r1
        mov.l   .L6,r8
        mov.l   r0,@(4,r3)
        mov.l   r6,@(4,r14)
        mov.l   @r1,r5
        jsr     @r9
        mov     r8,r4
        mov     r14,r1
        add     #9,r1
        mov.l   @r1,r5    <--- maybe cause data address error.
        jsr     @r9
        mov     r8,r4
        add     #16,r14
................


-- 
           Summary: maybe bug output for sh4a
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tyokota at k2 dot dion dot ne dot jp
GCC target triplet: sh-elf-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28229



More information about the Gcc-bugs mailing list