GCC 4.1.1 m68k-rtems generating invalid code for -m5307 proce ssor ?

Kirspel, Kevin kevin.kirspel at optimedical.com
Fri Jun 22 18:36:59 UTC 2007


The disassembly below is the m68k-rtems-objdump output ( m68k-rtems-objdump
-S hello.nxe > hello.S).

-----Original Message-----
From: Eric Norum [mailto:norume at aps.anl.gov] 
Sent: Friday, June 22, 2007 2:31 PM
To: Kirspel, Kevin
Cc: 'rtems-users at rtems.org'
Subject: Re: GCC 4.1.1 m68k-rtems generating invalid code for -m5307
processor ?

Can you check the memory contents *before* starting the program?
On Jun 22, 2007, at 1:23 PM, Kirspel, Kevin wrote:

> I have built the following environment for the m68k-rtems target:
>
>
> binutils-2.17       with patch binutils-2.17-rtems4.7-20061021.diff
>
> gcc-4.1.1           with patch gcc-core-4.1.1-rtems4.7-20070102.diff
>
> newlib-1.14.0     with patch newlib-1.15.0-rtems4.7-20070208.diff
>
>
> I have created an MCF5329EVB BSP in the RTEMS 4.7 branch.  Since  
> GCC 4.1.1 does not support the MCF5329 processor I had to use the - 
> m5307 option to generate V3 code ( I think this should work ).  The  
> RTEMS compilation was successfully.  Using GDB, I ran the hello.exe  
> sample test.  The hello.exe fails during the  
> _IO_Manager_initialization() function where is calls memset().   
> After single stepping through memset(), the programmed dies when  
> the PC reaches the instruction at 0x400149ea.  I disassembled hello  
> and got the following output for memset():
>
>
> 400149cc <memset>:
>
> 400149cc:         4e56 0000         linkw %fp,#0
>
> 400149d0:         2f03                  movel %d3,%sp at -
>
> 400149d2:         2f02                  movel %d2,%sp at -
>
> 400149d4:         262e 0008         movel %fp@(8),%d3
>
> 400149d8:         226e 0010         moveal %fp@(16),%a1
>
> 400149dc:         2203                 movel %d3,%d1
>
> 400149de:         4282                 clrl %d2
>
> 400149e0:         142e 000f          moveb %fp@(15),%d2
>
> 400149e4:         7003                 moveq #3,%d0
>
> 400149e6:         b089                 cmpl %a1,%d0
>
> 400149e8:         6406                 bccs 400149f0 <memset+0x24>
>
> 400149ea:         e8c3                 0164303
>
> 400149ec:         0782                 bclr %d3,%d2
>
> 400149ee:         6712                 beqs 40014a02 <memset+0x36>
>
> 400149f0:          4a89                 tstl %a1
>
> 400149f2:          6758                 beqs 40014a4c <memset+0x80>
>
> 400149f4:          1002                 moveb %d2,%d0
>
> 400149f6:          2041                 moveal %d1,%a0
>
> 400149f8:          d3c1                 addal %d1,%a1
>
> 400149fa:          10c0                 moveb %d0,%a0 at +
>
> 400149fc:          b3c8                 cmpal %a0,%a1
>
> 400149fe:          66fa                  bnes 400149fa <memset+0x2e>
>
> 40014a00:         604a                 bras 40014a4c <memset+0x80>
>
> 40014a02:         2043                 moveal %d3,%a0
>
> 40014a04:         2002                 movel %d2,%d0
>
>
> The instruction at 0x400149ea is bogus.  Are there any issues with  
> binutils/gcc and -m5307 option?  Is there some configuration option  
> in rtems that would cause this?
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users

-- 
Eric Norum <norume at aps.anl.gov>
Advanced Photon Source
Argonne National Laboratory
(630) 252-4793




More information about the users mailing list