Andreas Schwab wrote:
> Gunther Nikl <gn...@users.sourceforge.net> writes:
> 
>> While working with GCC 4.7, I noticed that the -m68020-40 and -m68020-60
>> options are broken.
> 
> Broken in which way?

These compound options are supposed to cause m68k.c/m68k_option_override
to set m68k_cpu_entry and m68k_tune_entry. However that code does only
trigger if cpu/tune fields in global_options_set are nonzero which only
happens if -mcpu=/-mtune= are used. My patch for m68k_handle_option
simply sets cpu and tune fields in the provided opts_set function
argument.

The bug is more visible with a compiler configured for a plain 68000
because such a compiler will generate normal 68000 code despite
requesting 68020 code with -m68020-40 or -m68020-60. The bug can also
be seen with a compiler defaulting to 68020 code because the expected
mc680x0 macros are not present. eg.

  m68k-elf-gcc -m68020-40 -x c /dev/null -E -dM -o - | grep mc68

will only show __mc68020__, but __mc680[34]0__ should be defined
as well, see m68k.h/TARGET_CPU_CPP_BUILTINS.

The patch should be installed on trunk and on the 4.7 branch.


Regards,
Gunther

Reply via email to