1 /* Common hooks for Renesas RX.
2 Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 GCC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
22 #include "coretypes.h"
23 #include "diagnostic-core.h"
25 #include "common/common-target.h"
26 #include "common/common-target-def.h"
30 /* Extra processing for target specific command line options. */
33 rx_handle_option (struct gcc_options *opts,
34 struct gcc_options *opts_set ATTRIBUTE_UNUSED,
35 const struct cl_decoded_option *decoded,
38 size_t code = decoded->opt_index;
39 int value = decoded->value;
43 case OPT_mint_register_:
44 /* Make sure that the -mint-register option is in range. Other
45 handling in rx_option_override. */
46 return value >= 0 && value <= 4;
49 case OPT_mmax_constant_size_:
50 /* Make sure that the -mmax-constant_size option is in range. */
51 return value >= 0 && value <= 4;
54 if ((enum rx_cpu_types) value == RX200)
55 opts->x_target_flags |= MASK_NO_USE_FPU;
59 if (opts->x_rx_cpu_type == RX200)
60 error_at (loc, "the RX200 cpu does not have FPU hardware");
70 /* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */
71 static const struct default_options rx_option_optimization_table[] =
73 { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
74 { OPT_LEVELS_NONE, 0, NULL, 0 }
77 #undef TARGET_HANDLE_OPTION
78 #define TARGET_HANDLE_OPTION rx_handle_option
80 #undef TARGET_OPTION_OPTIMIZATION_TABLE
81 #define TARGET_OPTION_OPTIMIZATION_TABLE rx_option_optimization_table
83 #undef TARGET_EXCEPT_UNWIND_INFO
84 #define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
86 struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;