diff options
Diffstat (limited to 'gcc/common/config/pa/pa-common.c')
-rw-r--r-- | gcc/common/config/pa/pa-common.c | 56 |
1 files changed, 54 insertions, 2 deletions
diff --git a/gcc/common/config/pa/pa-common.c b/gcc/common/config/pa/pa-common.c index a14e9b124c7..faa54ac042f 100644 --- a/gcc/common/config/pa/pa-common.c +++ b/gcc/common/config/pa/pa-common.c @@ -1,5 +1,6 @@ /* HPPA common hooks. - Copyright (C) 2011 + 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. @@ -21,8 +22,59 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #include "system.h" #include "coretypes.h" +#include "tm.h" #include "common/common-target.h" #include "common/common-target-def.h" -#include "tm.h" +#include "opts.h" +#include "flags.h" + +/* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */ +static const struct default_options pa_option_optimization_table[] = + { + { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 }, + { OPT_LEVELS_NONE, 0, NULL, 0 } + }; + +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +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; + + switch (code) + { + case OPT_mnosnake: + case OPT_mpa_risc_1_0: + case OPT_march_1_0: + 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: + 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: + opts->x_target_flags |= MASK_PA_11 | MASK_PA_20; + return true; + + default: + return true; + } +} + +#undef TARGET_OPTION_OPTIMIZATION_TABLE +#define TARGET_OPTION_OPTIMIZATION_TABLE pa_option_optimization_table +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | TARGET_CPU_DEFAULT) +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION pa_handle_option struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER; |