gcc 3.4.2 cpu32 patch

Ralf Corsepius ralf_corsepius at rtems.org
Thu Nov 18 06:31:15 UTC 2004


On Thu, 2004-11-18 at 16:19 +1100, Chris Johns wrote:
> Peter Barada wrote:
> > 
> > ColdFire code gerneration doesn't key off of either MASK_68020 or
> > MASK_BITFIELD so this change shouldn't change and ColdFire code generation.
> > 
> > However, TARGET_CPU_CPP_BUILTINS, does define __m68k__ and m68000 for
> > ColdFire which I think *should* be disabled since the m68k supports
> > instructions/addressing modes that are illegal for ColdFire.
> > 
> 
> Ouch.
> 
> > Unfortunately I have no idea how much code is out there that uses
> > these generic 68k preprocessor defines to select code that runs on
> > *both* generic 68k cores as well as ColdFire cores.
> 
> Sure.
> 
> > As a result I'd say that we leave well enough alone :(
> 
> I agree we should keep the defines as they were. So taking a look at gcc 
> 3.3.1 we get:
> 
>   $ m68k-rtems-gcc -mcpu32 -dM -E - </dev/null | grep 68020
>   $ m68k-rtems-gcc -m5200 -dM -E - </dev/null | grep 68020
>   $ m68k-rtems-gcc -m68000 -dM -E - </dev/null | grep 68020
>   $
With rtems.org's gcc-3.2.3 (Joel's rpms):

$ m68k-rtems-gcc -mcpu32 -dM -E - </dev/null | grep -Ei 'cold|cpu32'
#define __mcpu32 1
#define __mcpu32__ 1
#define mcpu32 1
$ m68k-rtems-gcc -m5200 -dM -E - </dev/null | grep -Ei 'cold|cpu32'
$ m68k-rtems-gcc -m68000 -dM -E - </dev/null | grep -Ei 'cold|cpu32'
$ m68k-rtems-gcc -m68302 -dM -E - </dev/null | grep -Ei 'cold|cpu32'
$ m68k-rtems-gcc -m68332 -dM -E - </dev/null | grep -Ei 'cold|cpu32'
#define __mcpu32 1
#define __mcpu32__ 1
#define mcpu32 1

> while with 3.4.3:
> 
>   $ m68k-rtems-gcc -mcpu32 -dM -E - </dev/null | grep 68020
>   #define __mc68020__ 1
>   #define __mc68020 1
>   #define mc68020 1
>   $ m68k-rtems-gcc -m5200 -dM -E - </dev/null | grep 68020
>   $ m68k-rtems-gcc -m68000 -dM -E - </dev/null | grep 68020
>   $ m68k-rtems-gcc -m68302 -dM -E - </dev/null | grep 68020
>   $ m68k-rtems-gcc -m68332 -dM -E - </dev/null | grep 68020
>   #define __mc68020__ 1
>   #define __mc68020 1
>   #define mc68020 1
>   $

$ m68k-rtems4.7-gcc -mcpu32 -dM -E - </dev/null | grep -Ei 'cold|cpu32'
#define __mcpu32__ 1
#define mcpu32 1
#define __mcpu32 1
$ m68k-rtems4.7-gcc -m5200 -dM -E - </dev/null | grep -Ei 'cold|cpu32'
#define __mcoldfire__ 1
$ m68k-rtems4.7-gcc -m68000 -dM -E - </dev/null | grep -Ei 'cold|cpu32'
$ m68k-rtems4.7-gcc -m68302 -dM -E - </dev/null | grep -Ei 'cold|cpu32'
$ m68k-rtems4.7-gcc -m68332 -dM -E - </dev/null | grep -Ei 'cold|cpu32'
#define __mcpu32__ 1
#define mcpu32 1
#define __mcpu32 1

> This looks like the defines are not the same and so RTEMS appears 
> broken. I am suspect other code will break as a result.

Correct me if I am wrong, but AFAIS, it would be sufficient to extend
RTEMS m68k score to using __mcoldfire__ and __mcpu32__.

Ralf





More information about the users mailing list