From 1bb721dcde610f30cd72d019060122bdf6d2c348 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 22 Mar 2011 22:42:51 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 14 +++++++ gcc/config/pa/pa-hpux.opt | 6 ++- gcc/config/pa/pa-hpux1010.opt | 4 +- gcc/config/pa/pa-hpux1111.opt | 4 +- gcc/config/pa/pa-opts.h | 37 +++++++++++++++++ gcc/config/pa/pa.c | 78 +++++++++++------------------------ gcc/config/pa/pa.h | 20 +-------- gcc/config/pa/pa.opt | 34 +++++++++++++-- 8 files changed, 116 insertions(+), 81 deletions(-) create mode 100644 gcc/config/pa/pa-opts.h diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0e9d61dd2f6..ea5a89d17b2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2011-03-22 Joseph Myers + + * 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 * config/mn10300/mn10300-opts.h: New. diff --git a/gcc/config/pa/pa-hpux.opt b/gcc/config/pa/pa-hpux.opt index eaed8be2d97..ddbb68f03eb 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 ; . +; 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 f409e8404aa..372f1e3dd95 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 @@ ; . 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 b59f64a1555..fa5f6f113f2 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 @@ ; . 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 00000000000..b0828fcf30a --- /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 +. */ + +#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 c5cd8712c66..c1bf358eae6 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 41af1f12f6e..1cb236bcab1 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 6d10544b754..ccb4febd501 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 ; . +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 -- 2.30.2