Patchwork MicroBlaze port

login
register
mail settings
Submitter Michael Eager
Date Sept. 29, 2010, 4:46 p.m.
Message ID <4CA36D58.3020400@eagerm.com>
Download mbox | patch
Permalink /patch/66078/
State New
Headers show

Comments

Michael Eager - Sept. 29, 2010, 4:46 p.m.
Thanks for noticing these issues.

Joseph S. Myers wrote:
> On Tue, 28 Sep 2010, Michael Eager wrote:
> 
>> +extern char call_used_regs[];
> 
> Does this actually work now that call_used_regs is a macro in 
> hard-reg-set.h?

The macro silently rewrites references to call_used_regs.
I've removed the extern.

> 
>> +extern int target_flags;
> 
> This will break when my patch 
> <http://gcc.gnu.org/ml/gcc-patches/2010-09/msg02171.html> is in.  Don't 
> explicitly declare any variables from .opt files.

Removed extern.

>> +/* This table translates options whose names would interfere
>> +   with normal driver options and adds a 'Z' so that they can get to
>> +   specs processing without interference.
>> +
>> +   The -xl-* options are deprecated and should be replace with their
>> +   corresponding equivalent:
>> +      -xl-mode-executable ==> -mxl-mode-executable
>> +      -xl-mode-xmdstub    ==> -mxl-mode-xmdstub
>> +      -xl-mode-bootstrap  ==> -mxl-mode-bootstrap
>> +      -xl-mode-novectors  ==> -mxl-mode-novectors
>> +*/
>> +
>> +#define TARGET_OPTION_TRANSLATE_TABLE \
>> +  { "-xl-mode-executable", "-Zxl-mode-executable" }, \
>> +  { "-xl-mode-xmdstub", "-Zxl-mode-xmdstub" },  \
>> +  { "-xl-mode-bootstrap", "-Zxl-mode-bootstrap" }, \
>> +  { "-xl-mode-novectors", "-Zxl-mode-novectors" }
> 
> Is it possible for you to use the .opt alias facility instead of 
> TARGET_OPTION_TRANSLATE_TABLE?  If you make something an alias then you 
> don't need to handle it in specs - you could alias these options directly 
> to the -m versions, I'd have thought.  I'd like to get rid of 
> TARGET_OPTION_TRANSLATE_TABLE.

This is for deprecated options; I've removed it.

>> +#undef SWITCH_TAKES_ARG
>> +#define SWITCH_TAKES_ARG(CHAR)						\
>> +  (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
> 
> You're missing two other pieces of -G support: handling it in the 
> handle_option hook, and use of g.opt in config.gcc.  See 
> <http://gcc.gnu.org/ml/gcc-patches/2010-07/msg02340.html> and 
> <http://gcc.gnu.org/ml/gcc-patches/2010-08/msg00066.html>.

Fixed:

Patch

--- config.gcc-orig     2010-09-29 09:27:56.000000000 -0700
+++ config.gcc  2010-09-29 09:28:22.000000000 -0700
@@ -341,6 +341,7 @@  m68k-*-*)
         ;;
  microblaze*-*-*)
          cpu_type=microblaze
+       extra_options="${extra_options} g.opt"
          ;;
  mips*-*-*)
         cpu_type=mips

--- orig/microblaze.c   2010-09-29 08:39:06.000000000 -0700
+++ microblaze.c        2010-09-29 09:27:39.000000000 -0700
@@ -1279,6 +1279,11 @@  microblaze_handle_option (size_t code,
  {
    switch (code)
      {
+    case OPT_G:
+      g_switch_value = value;
+      g_switch_set = true;
+      return true;
+
      case OPT_mno_clearbss:
        flag_zero_initialized_in_bss = 0;
        warning (0, "-mno-clearbss is deprecated; use -fno-zero-initialized-in-bss");