comparison gcc/lto-opts.c @ 132:d34655255c78

update gcc-8.2
author mir3636
date Thu, 25 Oct 2018 10:21:07 +0900
parents 84e7813d76e9
children 1830386684a0
comparison
equal deleted inserted replaced
130:e108057fa461 132:d34655255c78
1 /* LTO IL options. 1 /* LTO IL options.
2 2
3 Copyright (C) 2009-2017 Free Software Foundation, Inc. 3 Copyright (C) 2009-2018 Free Software Foundation, Inc.
4 Contributed by Simon Baldwin <simonb@google.com> 4 Contributed by Simon Baldwin <simonb@google.com>
5 5
6 This file is part of GCC. 6 This file is part of GCC.
7 7
8 GCC is free software; you can redistribute it and/or modify it under 8 GCC is free software; you can redistribute it and/or modify it under
68 section_name = lto_get_section_name (LTO_section_opts, NULL, NULL); 68 section_name = lto_get_section_name (LTO_section_opts, NULL, NULL);
69 lto_begin_section (section_name, false); 69 lto_begin_section (section_name, false);
70 70
71 obstack_init (&temporary_obstack); 71 obstack_init (&temporary_obstack);
72 72
73 /* Output options that affect GIMPLE IL semantics and are implicitly
74 enabled by the frontend.
75 This for now includes an explicit set of options that we also handle
76 explicitly in lto-wrapper.c. In the end the effects on GIMPLE IL
77 semantics should be explicitely encoded in the IL or saved per
78 function rather than per compilation unit. */
79 /* -fexceptions causes the EH machinery to be initialized, enabling
80 generation of unwind data so that explicit throw() calls work. */
81 if (!global_options_set.x_flag_exceptions
82 && global_options.x_flag_exceptions)
83 append_to_collect_gcc_options (&temporary_obstack, &first_p,
84 "-fexceptions");
85 /* -fnon-call-exceptions changes the generation of exception
86 regions. It is enabled implicitly by the Go frontend. */
87 if (!global_options_set.x_flag_non_call_exceptions
88 && global_options.x_flag_non_call_exceptions)
89 append_to_collect_gcc_options (&temporary_obstack, &first_p,
90 "-fnon-call-exceptions");
91 /* The default -ffp-contract changes depending on the language
92 standard. Pass thru conservative standard settings. */
93 if (!global_options_set.x_flag_fp_contract_mode)
94 switch (global_options.x_flag_fp_contract_mode)
95 {
96 case FP_CONTRACT_OFF:
97 append_to_collect_gcc_options (&temporary_obstack, &first_p,
98 "-ffp-contract=off");
99 break;
100 case FP_CONTRACT_ON:
101 append_to_collect_gcc_options (&temporary_obstack, &first_p,
102 "-ffp-contract=on");
103 break;
104 case FP_CONTRACT_FAST:
105 /* Nothing. That merges conservatively and is the default for LTO. */
106 break;
107 default:
108 gcc_unreachable ();
109 }
110 /* The default -fmath-errno, -fsigned-zeros and -ftrapping-math change
111 depending on the language (they can be disabled by the Ada front-end).
112 Pass thru conservative standard settings. */
113 if (!global_options_set.x_flag_errno_math)
114 append_to_collect_gcc_options (&temporary_obstack, &first_p,
115 global_options.x_flag_errno_math
116 ? "-fmath-errno"
117 : "-fno-math-errno");
118 if (!global_options_set.x_flag_signed_zeros)
119 append_to_collect_gcc_options (&temporary_obstack, &first_p,
120 global_options.x_flag_signed_zeros
121 ? "-fsigned-zeros"
122 : "-fno-signed-zeros");
123 if (!global_options_set.x_flag_trapping_math)
124 append_to_collect_gcc_options (&temporary_obstack, &first_p,
125 global_options.x_flag_trapping_math
126 ? "-ftrapping-math"
127 : "-fno-trapping-math");
128 /* We need to merge -f[no-]strict-overflow, -f[no-]wrapv and -f[no-]trapv
129 conservatively, so stream out their defaults. */
130 if (!global_options_set.x_flag_wrapv
131 && global_options.x_flag_wrapv)
132 append_to_collect_gcc_options (&temporary_obstack, &first_p, "-fwrapv");
133 if (!global_options_set.x_flag_trapv
134 && !global_options.x_flag_trapv)
135 append_to_collect_gcc_options (&temporary_obstack, &first_p, "-fno-trapv");
136
137 if (!global_options_set.x_flag_openmp 73 if (!global_options_set.x_flag_openmp
138 && !global_options.x_flag_openmp) 74 && !global_options.x_flag_openmp)
139 append_to_collect_gcc_options (&temporary_obstack, &first_p, "-fno-openmp"); 75 append_to_collect_gcc_options (&temporary_obstack, &first_p,
76 "-fno-openmp");
140 if (!global_options_set.x_flag_openacc 77 if (!global_options_set.x_flag_openacc
141 && !global_options.x_flag_openacc) 78 && !global_options.x_flag_openacc)
142 append_to_collect_gcc_options (&temporary_obstack, &first_p, 79 append_to_collect_gcc_options (&temporary_obstack, &first_p,
143 "-fno-openacc"); 80 "-fno-openacc");
81 /* Append PIC/PIE mode because its default depends on target and it is
82 subject of merging in lto-wrapper. */
83 if (!global_options_set.x_flag_pic && !global_options_set.x_flag_pie)
84 {
85 append_to_collect_gcc_options (&temporary_obstack, &first_p,
86 global_options.x_flag_pic == 2
87 ? "-fPIC"
88 : global_options.x_flag_pic == 1
89 ? "-fpic"
90 : global_options.x_flag_pie == 2
91 ? "-fPIE"
92 : global_options.x_flag_pie == 1
93 ? "-fpie"
94 : "-fno-pie");
95 }
144 96
145 /* Append options from target hook and store them to offload_lto section. */ 97 /* Append options from target hook and store them to offload_lto section. */
146 if (lto_stream_offload_p) 98 if (lto_stream_offload_p)
147 { 99 {
148 char *offload_opts = targetm.offload_options (); 100 char *offload_opts = targetm.offload_options ();
168 switch (option->opt_index) 120 switch (option->opt_index)
169 { 121 {
170 case OPT_dumpbase: 122 case OPT_dumpbase:
171 case OPT_SPECIAL_unknown: 123 case OPT_SPECIAL_unknown:
172 case OPT_SPECIAL_ignore: 124 case OPT_SPECIAL_ignore:
125 case OPT_SPECIAL_deprecated:
173 case OPT_SPECIAL_program_name: 126 case OPT_SPECIAL_program_name:
174 case OPT_SPECIAL_input_file: 127 case OPT_SPECIAL_input_file:
128 case OPT_dumpdir:
129 case OPT_fresolution_:
175 continue; 130 continue;
176 131
177 default: 132 default:
178 break; 133 break;
179 } 134 }