GCC 4.1.1 m68k-rtems generating invalid code for -m5307 processor ?

Ian Caddy ianc at goanna.iinet.net.au
Mon Jun 25 10:19:34 UTC 2007


Hi Kevin,

We also use the 5307 for our system, and are currently using gcc 4.1.1 
and we don't see your problem.

Below is the disassembly for the start of memset similar to yours:


080bd600 <memset>:
  80bd600:	4e56 0000      	linkw %fp,#0
  80bd604:	2f03           	movel %d3,%sp at -
  80bd606:	2f02           	movel %d2,%sp at -
  80bd608:	262e 0008      	movel %fp@(8),%d3
  80bd60c:	226e 0010      	moveal %fp@(16),%a1
  80bd610:	2203           	movel %d3,%d1
  80bd612:	4282           	clrl %d2
  80bd614:	142e 000f      	moveb %fp@(15),%d2
  80bd618:	7003           	moveq #3,%d0
  80bd61a:	b089           	cmpl %a1,%d0
  80bd61c:	6404           	bccs 80bd622 <memset+0x22>
  80bd61e:	c083           	andl %d3,%d0
  80bd620:	6712           	beqs 80bd634 <memset+0x34>
  80bd622:	4a89           	tstl %a1
  80bd624:	6758           	beqs 80bd67e <memset+0x7e>
  80bd626:	1002           	moveb %d2,%d0
  80bd628:	2041           	moveal %d1,%a0
  80bd62a:	d3c1           	addal %d1,%a1

Note that ours seems to be producing valid code just after the first bcc.

You indicated that you built your tools.  Have you tried the standard 
toolsets from the RTEMS website?

regards,

Ian Caddy




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
> 
-- 
Ian Caddy
Goanna Technologies Pty Ltd
+61 8 9221 1860




More information about the users mailing list