1/* Common hooks for Tensilica's Xtensa architecture.
2   Copyright (C) 2001-2020 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3.  If not see
18<http://www.gnu.org/licenses/>.  */
19
20#include "config.h"
21#include "system.h"
22#include "coretypes.h"
23#include "tm.h"
24#include "common/common-target.h"
25#include "common/common-target-def.h"
26
27/* Implement TARGET_OPTION_OPTIMIZATION_TABLE.  */
28
29static const struct default_options xtensa_option_optimization_table[] =
30  {
31    /* Reordering blocks for Xtensa is not a good idea unless the
32       compiler understands the range of conditional branches.
33       Currently all branch relaxation for Xtensa is handled in the
34       assembler, so GCC cannot do a good job of reordering blocks.
35       Do not enable reordering unless it is explicitly requested.  */
36    { OPT_LEVELS_ALL, OPT_freorder_blocks, NULL, 0 },
37    { OPT_LEVELS_NONE, 0, NULL, 0 }
38  };
39
40#undef TARGET_DEFAULT_TARGET_FLAGS
41#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT)
42#undef TARGET_OPTION_OPTIMIZATION_TABLE
43#define TARGET_OPTION_OPTIMIZATION_TABLE xtensa_option_optimization_table
44
45struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
46