xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/common/config/m32r/m32r-common.c (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
136ac495dSmrg /* Common hooks for Renesas M32R.
2*8feb0f0bSmrg    Copyright (C) 1996-2020 Free Software Foundation, Inc.
336ac495dSmrg 
436ac495dSmrg    This file is part of GCC.
536ac495dSmrg 
636ac495dSmrg    GCC is free software; you can redistribute it and/or modify it
736ac495dSmrg    under the terms of the GNU General Public License as published
836ac495dSmrg    by the Free Software Foundation; either version 3, or (at your
936ac495dSmrg    option) any later version.
1036ac495dSmrg 
1136ac495dSmrg    GCC is distributed in the hope that it will be useful, but WITHOUT
1236ac495dSmrg    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1336ac495dSmrg    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
1436ac495dSmrg    License for more details.
1536ac495dSmrg 
1636ac495dSmrg    You should have received a copy of the GNU General Public License
1736ac495dSmrg    along with GCC; see the file COPYING3.  If not see
1836ac495dSmrg    <http://www.gnu.org/licenses/>.  */
1936ac495dSmrg 
2036ac495dSmrg #include "config.h"
2136ac495dSmrg #include "system.h"
2236ac495dSmrg #include "coretypes.h"
2336ac495dSmrg #include "tm.h"
2436ac495dSmrg #include "common/common-target.h"
2536ac495dSmrg #include "common/common-target-def.h"
2636ac495dSmrg #include "opts.h"
2736ac495dSmrg #include "flags.h"
2836ac495dSmrg 
2936ac495dSmrg /* Implement TARGET_HANDLE_OPTION.  */
3036ac495dSmrg 
3136ac495dSmrg static bool
m32r_handle_option(struct gcc_options * opts,struct gcc_options * opts_set ATTRIBUTE_UNUSED,const struct cl_decoded_option * decoded,location_t loc ATTRIBUTE_UNUSED)3236ac495dSmrg m32r_handle_option (struct gcc_options *opts,
3336ac495dSmrg 		    struct gcc_options *opts_set ATTRIBUTE_UNUSED,
3436ac495dSmrg 		    const struct cl_decoded_option *decoded,
3536ac495dSmrg 		    location_t loc ATTRIBUTE_UNUSED)
3636ac495dSmrg {
3736ac495dSmrg   size_t code = decoded->opt_index;
3836ac495dSmrg   int value = decoded->value;
3936ac495dSmrg 
4036ac495dSmrg   switch (code)
4136ac495dSmrg     {
4236ac495dSmrg     case OPT_m32r:
4336ac495dSmrg       opts->x_target_flags &= ~(MASK_M32R2 | MASK_M32RX);
4436ac495dSmrg       return true;
4536ac495dSmrg 
4636ac495dSmrg     case OPT_mno_flush_func:
4736ac495dSmrg       opts->x_m32r_cache_flush_func = NULL;
4836ac495dSmrg       return true;
4936ac495dSmrg 
5036ac495dSmrg     case OPT_mflush_trap_:
5136ac495dSmrg       return value <= 15;
5236ac495dSmrg 
5336ac495dSmrg     default:
5436ac495dSmrg       return true;
5536ac495dSmrg     }
5636ac495dSmrg }
5736ac495dSmrg 
5836ac495dSmrg #undef  TARGET_DEFAULT_TARGET_FLAGS
5936ac495dSmrg #define TARGET_DEFAULT_TARGET_FLAGS TARGET_CPU_DEFAULT
6036ac495dSmrg #undef  TARGET_HANDLE_OPTION
6136ac495dSmrg #define TARGET_HANDLE_OPTION m32r_handle_option
6236ac495dSmrg 
6336ac495dSmrg #undef  TARGET_EXCEPT_UNWIND_INFO
6436ac495dSmrg #define TARGET_EXCEPT_UNWIND_INFO		sjlj_except_unwind_info
6536ac495dSmrg 
6636ac495dSmrg struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
67