aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/pa
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2011-03-22 22:42:51 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2011-03-22 22:42:51 +0000
commit1bb721dcde610f30cd72d019060122bdf6d2c348 (patch)
tree49d63a6f66695967bb4c29a86117bad9b47d2486 /gcc/config/pa
parentcd8d8754d58202ee4a9e909baa3a15cbe1d0c79c (diff)
downloadgcc-1bb721dcde610f30cd72d019060122bdf6d2c348.zip
gcc-1bb721dcde610f30cd72d019060122bdf6d2c348.tar.gz
gcc-1bb721dcde610f30cd72d019060122bdf6d2c348.tar.bz2
pa-hpux.opt (flag_pa_unix): New Variable entry.
* 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_. From-SVN: r171324
Diffstat (limited to 'gcc/config/pa')
-rw-r--r--gcc/config/pa/pa-hpux.opt6
-rw-r--r--gcc/config/pa/pa-hpux1010.opt4
-rw-r--r--gcc/config/pa/pa-hpux1111.opt4
-rw-r--r--gcc/config/pa/pa-opts.h37
-rw-r--r--gcc/config/pa/pa.c78
-rw-r--r--gcc/config/pa/pa.h20
-rw-r--r--gcc/config/pa/pa.opt34
7 files changed, 102 insertions, 81 deletions
diff --git a/gcc/config/pa/pa-hpux.opt b/gcc/config/pa/pa-hpux.opt
index eaed8be..ddbb68f 100644
--- a/gcc/config/pa/pa-hpux.opt
+++ b/gcc/config/pa/pa-hpux.opt
@@ -18,12 +18,16 @@
; 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
diff --git a/gcc/config/pa/pa-hpux1010.opt b/gcc/config/pa/pa-hpux1010.opt
index f409e84..372f1e3 100644
--- a/gcc/config/pa/pa-hpux1010.opt
+++ b/gcc/config/pa/pa-hpux1010.opt
@@ -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
diff --git a/gcc/config/pa/pa-hpux1111.opt b/gcc/config/pa/pa-hpux1111.opt
index b59f64a..fa5f6f1 100644
--- a/gcc/config/pa/pa-hpux1111.opt
+++ b/gcc/config/pa/pa-hpux1111.opt
@@ -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
index 0000000..b0828fc
--- /dev/null
+++ b/gcc/config/pa/pa-opts.h
@@ -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
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index c5cd871..c1bf358 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -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. */
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 41af1f1..1cb236b 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -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. */
diff --git a/gcc/config/pa/pa.opt b/gcc/config/pa/pa.opt
index 6d10544..ccb4feb 100644
--- a/gcc/config/pa/pa.opt
+++ b/gcc/config/pa/pa.opt
@@ -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.
;
@@ -18,6 +18,13 @@
; 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