]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/common/config/alpha/alpha-common.c
re PR debug/51650 (LTO ICE in dwarf2out_finish, at dwarf2out.c:22501 while building...
[thirdparty/gcc.git] / gcc / common / config / alpha / alpha-common.c
CommitLineData
677f3fa8
JM
1/* Common hooks for DEC Alpha.
2 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
3 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
4 Free Software Foundation, Inc.
5
6This file is part of GCC.
7
8GCC is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 3, or (at your option)
11any later version.
12
13GCC is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with GCC; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. */
21
22#include "config.h"
23#include "system.h"
24#include "coretypes.h"
25#include "diagnostic-core.h"
26#include "tm.h"
27#include "common/common-target.h"
28#include "common/common-target-def.h"
29#include "opts.h"
30#include "flags.h"
31
32/* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */
33static const struct default_options alpha_option_optimization_table[] =
34 {
35 { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
36 { OPT_LEVELS_NONE, 0, NULL, 0 }
37 };
38
f7a57cdc
TG
39/* Implement TARGET_OPTION_INIT_STRUCT. */
40
41static void
42alpha_option_init_struct (struct gcc_options *opts ATTRIBUTE_UNUSED)
43{
44#if TARGET_ABI_OPEN_VMS
45 /* Enable section anchors by default. */
46 opts->x_flag_section_anchors = 1;
47#endif
48}
49
677f3fa8
JM
50/* Implement TARGET_HANDLE_OPTION. */
51
52static bool
53alpha_handle_option (struct gcc_options *opts,
54 struct gcc_options *opts_set ATTRIBUTE_UNUSED,
55 const struct cl_decoded_option *decoded,
56 location_t loc)
57{
58 size_t code = decoded->opt_index;
59 const char *arg = decoded->arg;
60 int value = decoded->value;
61
62 switch (code)
63 {
64 case OPT_mfp_regs:
65 if (value == 0)
66 opts->x_target_flags |= MASK_SOFT_FP;
67 break;
68
69 case OPT_mieee:
70 case OPT_mieee_with_inexact:
71 opts->x_target_flags |= MASK_IEEE_CONFORMANT;
72 break;
73
74 case OPT_mtls_size_:
75 if (value != 16 && value != 32 && value != 64)
76 error_at (loc, "bad value %qs for -mtls-size switch", arg);
77 break;
78 }
79
80 return true;
81}
82
83#undef TARGET_DEFAULT_TARGET_FLAGS
84#define TARGET_DEFAULT_TARGET_FLAGS \
85 (TARGET_DEFAULT | TARGET_CPU_DEFAULT | TARGET_DEFAULT_EXPLICIT_RELOCS)
86#undef TARGET_HANDLE_OPTION
87#define TARGET_HANDLE_OPTION alpha_handle_option
88
f7a57cdc
TG
89#undef TARGET_OPTION_INIT_STRUCT
90#define TARGET_OPTION_INIT_STRUCT alpha_option_init_struct
91
677f3fa8
JM
92#undef TARGET_OPTION_OPTIMIZATION_TABLE
93#define TARGET_OPTION_OPTIMIZATION_TABLE alpha_option_optimization_table
94
95struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;