]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* config/pa/pa-hpux.opt (flag_pa_unix): New Variable entry.
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Mar 2011 22:42:51 +0000 (22:42 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Mar 2011 22:42:51 +0000 (22:42 +0000)
(munix=93): Use Var.
* config/pa/pa-hpux1010.opt (munix=95): Use Var.
* config/pa/pa-hpux1111.opt (munix=98): Use Var.
* config/pa/pa-opts.h: New.
* config/pa/pa.c (pa_cpu, flag_pa_unix): Remove.
(pa_handle_option): Don't assert that global structures are in
use.  Access target_flags via opts pointer.  Don't handle
OPT_mschedule_, OPT_mfixed_range_, OPT_munix_93, OPT_munix_95 or
OPT_munix_98 here.
(pa_option_override): Handle deferred OPT_mfixed_range_.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171324 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/pa/pa-hpux.opt
gcc/config/pa/pa-hpux1010.opt
gcc/config/pa/pa-hpux1111.opt
gcc/config/pa/pa-opts.h [new file with mode: 0644]
gcc/config/pa/pa.c
gcc/config/pa/pa.h
gcc/config/pa/pa.opt

index 0e9d61dd2f68cdf1d6e5e33bdcd9312c72eb518c..ea5a89d17b2d6d199652130f24c99ae1733450d0 100644 (file)
@@ -1,3 +1,17 @@
+2011-03-22  Joseph Myers  <joseph@codesourcery.com>
+
+       * config/pa/pa-hpux.opt (flag_pa_unix): New Variable entry.
+       (munix=93): Use Var.
+       * config/pa/pa-hpux1010.opt (munix=95): Use Var.
+       * config/pa/pa-hpux1111.opt (munix=98): Use Var.
+       * config/pa/pa-opts.h: New.
+       * config/pa/pa.c (pa_cpu, flag_pa_unix): Remove.
+       (pa_handle_option): Don't assert that global structures are in
+       use.  Access target_flags via opts pointer.  Don't handle
+       OPT_mschedule_, OPT_mfixed_range_, OPT_munix_93, OPT_munix_95 or
+       OPT_munix_98 here.
+       (pa_option_override): Handle deferred OPT_mfixed_range_.
+
 2011-03-22  Joseph Myers  <joseph@codesourcery.com>
 
        * config/mn10300/mn10300-opts.h: New.
index eaed8be2d97e7a62bbd92dedd0e2757b99632120..ddbb68f03eb7e6c05ec6cbfe3e3c024a2700dccc 100644 (file)
 ; along with GCC; see the file COPYING3.  If not see
 ; <http://www.gnu.org/licenses/>.
 
+; The UNIX standard to use for predefines and linking.
+Variable
+int flag_pa_unix = TARGET_HPUX_11_11 ? 1998 : TARGET_HPUX_10_10 ? 1995 : 1993
+
 msio
 Target RejectNegative Mask(SIO) MaskExists
 Generate cpp defines for server IO
 
 munix=93
-Target RejectNegative
+Target RejectNegative Var(flag_pa_unix, 1993)
 Specify UNIX standard for predefines and linking
 
 mwsio
index f409e8404aa2770a3b016fb029b68220d5824ca9..372f1e3dd959a88b283a88745c9aeec118d4abeb 100644 (file)
@@ -1,6 +1,6 @@
 ; Options for the HP PA-RISC port of the compiler.
 
-; Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+; Copyright (C) 2005, 2007, 2011 Free Software Foundation, Inc.
 ;
 ; This file is part of GCC.
 ;
@@ -19,5 +19,5 @@
 ; <http://www.gnu.org/licenses/>.
 
 munix=95
-Target RejectNegative
+Target RejectNegative Var(flag_pa_unix, 1995)
 Specify UNIX standard for predefines and linking
index b59f64a1555b7f19b647923ba1c3d5bd3fe0f860..fa5f6f113f21d74cd0027ec722dbeb3fe01f86d2 100644 (file)
@@ -1,6 +1,6 @@
 ; Options for the HP PA-RISC port of the compiler.
 
-; Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+; Copyright (C) 2005, 2007, 2011 Free Software Foundation, Inc.
 ;
 ; This file is part of GCC.
 ;
@@ -19,5 +19,5 @@
 ; <http://www.gnu.org/licenses/>.
 
 munix=98
-Target RejectNegative
+Target RejectNegative Var(flag_pa_unix, 1998)
 Specify UNIX standard for predefines and linking
diff --git a/gcc/config/pa/pa-opts.h b/gcc/config/pa/pa-opts.h
new file mode 100644 (file)
index 0000000..b0828fc
--- /dev/null
@@ -0,0 +1,37 @@
+/* Definitions for option handling for HP PA.
+   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef PA_OPTS_H
+#define PA_OPTS_H
+
+/* Which processor to schedule for.  */
+
+enum processor_type
+{
+  PROCESSOR_700,
+  PROCESSOR_7100,
+  PROCESSOR_7100LC,
+  PROCESSOR_7200,
+  PROCESSOR_7300,
+  PROCESSOR_8000
+};
+
+#endif
index c5cd8712c669796d98ed007482bd15700ea71565..c1bf358eae68f924d344269a328d718eacfaa086 100644 (file)
@@ -193,12 +193,6 @@ static GTY(()) section *som_readonly_data_section;
 static GTY(()) section *som_one_only_readonly_data_section;
 static GTY(()) section *som_one_only_data_section;
 
-/* Which cpu we are scheduling for.  */
-enum processor_type pa_cpu = TARGET_SCHED_DEFAULT;
-
-/* The UNIX standard to use for predefines and linking.  */
-int flag_pa_unix = TARGET_HPUX_11_11 ? 1998 : TARGET_HPUX_10_10 ? 1995 : 1993;
-
 /* Counts for the number of callee-saved general and floating point
    registers which were saved by the current function's prologue.  */
 static int gr_saved, fr_saved;
@@ -480,74 +474,32 @@ fix_range (const char *const_str)
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-pa_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
+pa_handle_option (struct gcc_options *opts,
+                 struct gcc_options *opts_set ATTRIBUTE_UNUSED,
                  const struct cl_decoded_option *decoded,
                  location_t loc ATTRIBUTE_UNUSED)
 {
   size_t code = decoded->opt_index;
-  const char *arg = decoded->arg;
-
-  gcc_assert (opts == &global_options);
-  gcc_assert (opts_set == &global_options_set);
 
   switch (code)
     {
     case OPT_mnosnake:
     case OPT_mpa_risc_1_0:
     case OPT_march_1_0:
-      target_flags &= ~(MASK_PA_11 | MASK_PA_20);
+      opts->x_target_flags &= ~(MASK_PA_11 | MASK_PA_20);
       return true;
 
     case OPT_msnake:
     case OPT_mpa_risc_1_1:
     case OPT_march_1_1:
-      target_flags &= ~MASK_PA_20;
-      target_flags |= MASK_PA_11;
+      opts->x_target_flags &= ~MASK_PA_20;
+      opts->x_target_flags |= MASK_PA_11;
       return true;
 
     case OPT_mpa_risc_2_0:
     case OPT_march_2_0:
-      target_flags |= MASK_PA_11 | MASK_PA_20;
-      return true;
-
-    case OPT_mschedule_:
-      if (strcmp (arg, "8000") == 0)
-       pa_cpu = PROCESSOR_8000;
-      else if (strcmp (arg, "7100") == 0)
-       pa_cpu = PROCESSOR_7100;
-      else if (strcmp (arg, "700") == 0)
-       pa_cpu = PROCESSOR_700;
-      else if (strcmp (arg, "7100LC") == 0)
-       pa_cpu = PROCESSOR_7100LC;
-      else if (strcmp (arg, "7200") == 0)
-       pa_cpu = PROCESSOR_7200;
-      else if (strcmp (arg, "7300") == 0)
-       pa_cpu = PROCESSOR_7300;
-      else
-       return false;
-      return true;
-
-    case OPT_mfixed_range_:
-      fix_range (arg);
-      return true;
-
-#if TARGET_HPUX
-    case OPT_munix_93:
-      flag_pa_unix = 1993;
-      return true;
-#endif
-
-#if TARGET_HPUX_10_10
-    case OPT_munix_95:
-      flag_pa_unix = 1995;
-      return true;
-#endif
-
-#if TARGET_HPUX_11_11
-    case OPT_munix_98:
-      flag_pa_unix = 1998;
+      opts->x_target_flags |= MASK_PA_11 | MASK_PA_20;
       return true;
-#endif
 
     default:
       return true;
@@ -559,6 +511,24 @@ pa_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
 static void
 pa_option_override (void)
 {
+  unsigned int i;
+  cl_deferred_option *opt;
+  VEC(cl_deferred_option,heap) *vec
+    = (VEC(cl_deferred_option,heap) *) pa_deferred_options;
+
+  FOR_EACH_VEC_ELT (cl_deferred_option, vec, i, opt)
+    {
+      switch (opt->opt_index)
+       {
+       case OPT_mfixed_range_:
+         fix_range (opt->arg);
+         break;
+
+       default:
+         gcc_unreachable ();
+       }
+    }
+
   /* Unconditional branches in the delay slot are not compatible with dwarf2
      call frame information.  There is no benefit in using this optimization
      on PA8000 and later processors.  */
index 41af1f12f6edff21c8d116c4342e2fcfc54356d1..1cb236bcab1b256eb0c87171a42e006cf9899884 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GNU compiler, for the HP Spectrum.
    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@cygnus.com) of Cygnus Support
    and Tim Moore (moore@defmacro.cs.utah.edu) of the Center for
@@ -25,24 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 /* For long call handling.  */
 extern unsigned long total_code_bytes;
 
-/* Which processor to schedule for.  */
-
-enum processor_type
-{
-  PROCESSOR_700,
-  PROCESSOR_7100,
-  PROCESSOR_7100LC,
-  PROCESSOR_7200,
-  PROCESSOR_7300,
-  PROCESSOR_8000
-};
-
-/* For -mschedule= option.  */
-extern enum processor_type pa_cpu;
-
-/* For -munix= option.  */
-extern int flag_pa_unix;
-
 #define pa_cpu_attr ((enum attr_cpu)pa_cpu)
 
 /* Print subsidiary information on the compiler version in use.  */
index 6d10544b7543386e2441f79431ccf6c6009e9897..ccb4febd501233e22c26726d6079e33c14278cd2 100644 (file)
@@ -1,6 +1,6 @@
 ; Options for the HP PA-RISC port of the compiler.
 
-; Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+; Copyright (C) 2005, 2007, 2011 Free Software Foundation, Inc.
 ;
 ; This file is part of GCC.
 ;
 ; along with GCC; see the file COPYING3.  If not see
 ; <http://www.gnu.org/licenses/>.
 
+HeaderInclude
+config/pa/pa-opts.h
+
+; Which cpu we are scheduling for.
+Variable
+enum processor_type pa_cpu = TARGET_SCHED_DEFAULT
+
 march=1.0
 Target RejectNegative
 Generate PA1.0 code
@@ -47,7 +54,7 @@ Target Report Mask(FAST_INDIRECT_CALLS)
 Generate fast indirect calls
 
 mfixed-range=
-Target RejectNegative Joined
+Target RejectNegative Joined Var(pa_deferred_options) Defer
 Specify range of registers to make fixed
 
 mgas
@@ -96,9 +103,30 @@ Target Report Mask(PORTABLE_RUNTIME)
 Use portable calling conventions
 
 mschedule=
-Target RejectNegative Joined
+Target RejectNegative Joined Enum(pa_schedule) Var(pa_cpu)
 Specify CPU for scheduling purposes.  Valid arguments are 700, 7100, 7100LC, 7200, 7300, and 8000
 
+Enum
+Name(pa_schedule) Type(enum processor_type)
+
+EnumValue
+Enum(pa_schedule) String(8000) Value(PROCESSOR_8000)
+
+EnumValue
+Enum(pa_schedule) String(7100) Value(PROCESSOR_7100)
+
+EnumValue
+Enum(pa_schedule) String(700) Value(PROCESSOR_700)
+
+EnumValue
+Enum(pa_schedule) String(7100LC) Value(PROCESSOR_7100LC)
+
+EnumValue
+Enum(pa_schedule) String(7200) Value(PROCESSOR_7200)
+
+EnumValue
+Enum(pa_schedule) String(7300) Value(PROCESSOR_7300)
+
 msoft-float
 Target Report Mask(SOFT_FLOAT)
 Use software floating point