Mercurial > hg > CbC > CbC_gcc
annotate gcc/config/i386/winnt.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
rev | line source |
---|---|
0 | 1 /* Subroutines for insn-output.c for Windows NT. |
2 Contributed by Douglas Rupp (drupp@cs.washington.edu) | |
131 | 3 Copyright (C) 1995-2018 Free Software Foundation, Inc. |
0 | 4 |
5 This file is part of GCC. | |
6 | |
7 GCC is free software; you can redistribute it and/or modify it under | |
8 the terms of the GNU General Public License as published by the Free | |
9 Software Foundation; either version 3, or (at your option) any later | |
10 version. | |
11 | |
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
18 along with GCC; see the file COPYING3. If not see | |
19 <http://www.gnu.org/licenses/>. */ | |
20 | |
131 | 21 #define IN_TARGET_CODE 1 |
22 | |
0 | 23 #include "config.h" |
24 #include "system.h" | |
25 #include "coretypes.h" | |
111 | 26 #include "target.h" |
27 #include "function.h" | |
28 #include "basic-block.h" | |
0 | 29 #include "rtl.h" |
30 #include "tree.h" | |
111 | 31 #include "gimple.h" |
32 #include "memmodel.h" | |
0 | 33 #include "tm_p.h" |
111 | 34 #include "stringpool.h" |
35 #include "attribs.h" | |
36 #include "emit-rtl.h" | |
37 #include "cgraph.h" | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
38 #include "lto-streamer.h" |
131 | 39 #include "except.h" |
111 | 40 #include "output.h" |
41 #include "varasm.h" | |
42 #include "lto-section-names.h" | |
0 | 43 |
44 /* i386/PE specific attribute support. | |
45 | |
46 i386/PE has two new attributes: | |
47 dllexport - for exporting a function/variable that will live in a dll | |
48 dllimport - for importing a function/variable from a dll | |
49 | |
50 Microsoft allows multiple declspecs in one __declspec, separating | |
51 them with spaces. We do NOT support this. Instead, use __declspec | |
52 multiple times. | |
53 */ | |
54 | |
55 /* Handle a "shared" attribute; | |
56 arguments as in struct attribute_spec.handler. */ | |
57 tree | |
111 | 58 ix86_handle_shared_attribute (tree *node, tree name, tree, int, |
59 bool *no_add_attrs) | |
0 | 60 { |
61 if (TREE_CODE (*node) != VAR_DECL) | |
62 { | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
63 warning (OPT_Wattributes, "%qE attribute only applies to variables", |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
64 name); |
0 | 65 *no_add_attrs = true; |
66 } | |
67 | |
68 return NULL_TREE; | |
69 } | |
70 | |
71 /* Handle a "selectany" attribute; | |
72 arguments as in struct attribute_spec.handler. */ | |
73 tree | |
111 | 74 ix86_handle_selectany_attribute (tree *node, tree name, tree, int, |
0 | 75 bool *no_add_attrs) |
76 { | |
111 | 77 tree decl = *node; |
0 | 78 /* The attribute applies only to objects that are initialized and have |
79 external linkage. However, we may not know about initialization | |
111 | 80 until the language frontend has processed the decl. Therefore |
81 we make sure that variable isn't initialized as common. */ | |
82 if (TREE_CODE (decl) != VAR_DECL || !TREE_PUBLIC (decl)) | |
83 error ("%qE attribute applies only to initialized variables" | |
84 " with external linkage", name); | |
85 else | |
86 { | |
87 make_decl_one_only (decl, DECL_ASSEMBLER_NAME (decl)); | |
88 /* A variable with attribute selectany never can be common. */ | |
89 DECL_COMMON (decl) = 0; | |
0 | 90 } |
91 | |
111 | 92 /* We don't need to keep attribute itself. */ |
93 *no_add_attrs = true; | |
0 | 94 return NULL_TREE; |
95 } | |
96 | |
97 | |
98 /* Return the type that we should use to determine if DECL is | |
99 imported or exported. */ | |
100 | |
101 static tree | |
102 associated_type (tree decl) | |
103 { | |
104 return (DECL_CONTEXT (decl) && TYPE_P (DECL_CONTEXT (decl)) | |
105 ? DECL_CONTEXT (decl) : NULL_TREE); | |
106 } | |
107 | |
108 /* Return true if DECL should be a dllexport'd object. */ | |
109 | |
110 static bool | |
111 i386_pe_determine_dllexport_p (tree decl) | |
112 { | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
113 if (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FUNCTION_DECL) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
114 return false; |
0 | 115 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
116 /* Don't export local clones of dllexports. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
117 if (!TREE_PUBLIC (decl)) |
0 | 118 return false; |
119 | |
111 | 120 if (TREE_CODE (decl) == FUNCTION_DECL |
121 && DECL_DECLARED_INLINE_P (decl) | |
122 && !flag_keep_inline_dllexport) | |
123 return false; | |
124 | |
0 | 125 if (lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl))) |
126 return true; | |
127 | |
128 return false; | |
129 } | |
130 | |
131 /* Return true if DECL should be a dllimport'd object. */ | |
132 | |
133 static bool | |
134 i386_pe_determine_dllimport_p (tree decl) | |
135 { | |
136 tree assoc; | |
137 | |
138 if (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FUNCTION_DECL) | |
139 return false; | |
140 | |
141 if (DECL_DLLIMPORT_P (decl)) | |
142 return true; | |
143 | |
144 /* The DECL_DLLIMPORT_P flag was set for decls in the class definition | |
145 by targetm.cxx.adjust_class_at_definition. Check again to emit | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
146 error message if the class attribute has been overridden by an |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
147 out-of-class definition of static data. */ |
0 | 148 assoc = associated_type (decl); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
149 if (assoc && lookup_attribute ("dllimport", TYPE_ATTRIBUTES (assoc)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
150 && TREE_CODE (decl) == VAR_DECL |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
151 && TREE_STATIC (decl) && TREE_PUBLIC (decl) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
152 && !DECL_EXTERNAL (decl) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
153 /* vtable's are linkonce constants, so defining a vtable is not |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
154 an error as long as we don't try to import it too. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
155 && !DECL_VIRTUAL_P (decl)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
156 error ("definition of static data member %q+D of " |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
157 "dllimport%'d class", decl); |
0 | 158 |
159 return false; | |
160 } | |
161 | |
162 /* Handle the -mno-fun-dllimport target switch. */ | |
163 | |
164 bool | |
165 i386_pe_valid_dllimport_attribute_p (const_tree decl) | |
166 { | |
167 if (TARGET_NOP_FUN_DLLIMPORT && TREE_CODE (decl) == FUNCTION_DECL) | |
168 return false; | |
169 return true; | |
170 } | |
171 | |
172 /* Return string which is the function name, identified by ID, modified | |
173 with a suffix consisting of an atsign (@) followed by the number of | |
174 bytes of arguments. If ID is NULL use the DECL_NAME as base. If | |
175 FASTCALL is true, also add the FASTCALL_PREFIX. | |
176 Return NULL if no change required. */ | |
177 | |
178 static tree | |
179 gen_stdcall_or_fastcall_suffix (tree decl, tree id, bool fastcall) | |
180 { | |
181 HOST_WIDE_INT total = 0; | |
182 const char *old_str = IDENTIFIER_POINTER (id != NULL_TREE ? id : DECL_NAME (decl)); | |
183 char *new_str, *p; | |
111 | 184 tree type = TREE_TYPE (DECL_ORIGIN (decl)); |
0 | 185 tree arg; |
186 function_args_iterator args_iter; | |
187 | |
188 gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); | |
189 | |
190 if (prototype_p (type)) | |
191 { | |
192 /* This attribute is ignored for variadic functions. */ | |
193 if (stdarg_p (type)) | |
194 return NULL_TREE; | |
195 | |
196 /* Quit if we hit an incomplete type. Error is reported | |
197 by convert_arguments in c-typeck.c or cp/typeck.c. */ | |
198 FOREACH_FUNCTION_ARGS(type, arg, args_iter) | |
199 { | |
200 HOST_WIDE_INT parm_size; | |
201 HOST_WIDE_INT parm_boundary_bytes = PARM_BOUNDARY / BITS_PER_UNIT; | |
202 | |
203 if (! COMPLETE_TYPE_P (arg)) | |
204 break; | |
205 | |
206 parm_size = int_size_in_bytes (arg); | |
207 if (parm_size < 0) | |
208 break; | |
209 | |
210 /* Must round up to include padding. This is done the same | |
211 way as in store_one_arg. */ | |
212 parm_size = ((parm_size + parm_boundary_bytes - 1) | |
213 / parm_boundary_bytes * parm_boundary_bytes); | |
214 total += parm_size; | |
215 } | |
111 | 216 } |
217 | |
0 | 218 /* Assume max of 8 base 10 digits in the suffix. */ |
219 p = new_str = XALLOCAVEC (char, 1 + strlen (old_str) + 1 + 8 + 1); | |
220 if (fastcall) | |
221 *p++ = FASTCALL_PREFIX; | |
222 sprintf (p, "%s@" HOST_WIDE_INT_PRINT_DEC, old_str, total); | |
223 | |
224 return get_identifier (new_str); | |
225 } | |
226 | |
227 /* Maybe decorate and get a new identifier for the DECL of a stdcall or | |
228 fastcall function. The original identifier is supplied in ID. */ | |
229 | |
230 static tree | |
231 i386_pe_maybe_mangle_decl_assembler_name (tree decl, tree id) | |
232 { | |
233 tree new_id = NULL_TREE; | |
234 | |
235 if (TREE_CODE (decl) == FUNCTION_DECL) | |
236 { | |
111 | 237 unsigned int ccvt = ix86_get_callcvt (TREE_TYPE (decl)); |
238 if ((ccvt & IX86_CALLCVT_STDCALL) != 0) | |
239 { | |
240 if (TARGET_RTD) | |
241 /* If we are using -mrtd emit undecorated symbol and let linker | |
242 do the proper resolving. */ | |
243 return NULL_TREE; | |
244 new_id = gen_stdcall_or_fastcall_suffix (decl, id, false); | |
245 } | |
246 else if ((ccvt & IX86_CALLCVT_FASTCALL) != 0) | |
0 | 247 new_id = gen_stdcall_or_fastcall_suffix (decl, id, true); |
248 } | |
249 | |
250 return new_id; | |
251 } | |
252 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
253 /* Emit an assembler directive to set symbol for DECL visibility to |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
254 the visibility type VIS, which must not be VISIBILITY_DEFAULT. |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
255 As for PE there is no hidden support in gas, we just warn for |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
256 user-specified visibility attributes. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
257 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
258 void |
111 | 259 i386_pe_assemble_visibility (tree decl, int) |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
260 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
261 if (!decl |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
262 || !lookup_attribute ("visibility", DECL_ATTRIBUTES (decl))) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
263 return; |
111 | 264 if (!DECL_ARTIFICIAL (decl)) |
265 warning (OPT_Wattributes, "visibility attribute not supported " | |
266 "in this configuration; ignored"); | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
267 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
268 |
0 | 269 /* This is used as a target hook to modify the DECL_ASSEMBLER_NAME |
270 in the language-independent default hook | |
271 langhooks,c:lhd_set_decl_assembler_name () | |
272 and in cp/mangle,c:mangle_decl (). */ | |
273 tree | |
274 i386_pe_mangle_decl_assembler_name (tree decl, tree id) | |
275 { | |
276 tree new_id = i386_pe_maybe_mangle_decl_assembler_name (decl, id); | |
277 | |
278 return (new_id ? new_id : id); | |
279 } | |
280 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
281 /* This hook behaves the same as varasm.c/assemble_name(), but |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
282 generates the name into memory rather than outputting it to |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
283 a file stream. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
284 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
285 tree |
111 | 286 i386_pe_mangle_assembler_name (const char *name) |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
287 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
288 const char *skipped = name + (*name == '*' ? 1 : 0); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
289 const char *stripped = targetm.strip_name_encoding (skipped); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
290 if (*name != '*' && *user_label_prefix && *stripped != FASTCALL_PREFIX) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
291 stripped = ACONCAT ((user_label_prefix, stripped, NULL)); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
292 return get_identifier (stripped); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
293 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
294 |
0 | 295 void |
296 i386_pe_encode_section_info (tree decl, rtx rtl, int first) | |
297 { | |
298 rtx symbol; | |
299 int flags; | |
300 | |
301 /* Do this last, due to our frobbing of DECL_DLLIMPORT_P above. */ | |
302 default_encode_section_info (decl, rtl, first); | |
303 | |
304 /* Careful not to prod global register variables. */ | |
305 if (!MEM_P (rtl)) | |
306 return; | |
307 | |
308 symbol = XEXP (rtl, 0); | |
309 gcc_assert (GET_CODE (symbol) == SYMBOL_REF); | |
310 | |
311 switch (TREE_CODE (decl)) | |
312 { | |
313 case FUNCTION_DECL: | |
314 case VAR_DECL: | |
315 break; | |
316 | |
317 default: | |
318 return; | |
319 } | |
320 | |
321 /* Mark the decl so we can tell from the rtl whether the object is | |
322 dllexport'd or dllimport'd. tree.c: merge_dllimport_decl_attributes | |
323 handles dllexport/dllimport override semantics. */ | |
324 flags = (SYMBOL_REF_FLAGS (symbol) & | |
325 ~(SYMBOL_FLAG_DLLIMPORT | SYMBOL_FLAG_DLLEXPORT)); | |
326 if (i386_pe_determine_dllexport_p (decl)) | |
327 flags |= SYMBOL_FLAG_DLLEXPORT; | |
328 else if (i386_pe_determine_dllimport_p (decl)) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
329 flags |= SYMBOL_FLAG_DLLIMPORT; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
330 |
0 | 331 SYMBOL_REF_FLAGS (symbol) = flags; |
332 } | |
333 | |
111 | 334 |
0 | 335 bool |
336 i386_pe_binds_local_p (const_tree exp) | |
337 { | |
338 if ((TREE_CODE (exp) == VAR_DECL || TREE_CODE (exp) == FUNCTION_DECL) | |
339 && DECL_DLLIMPORT_P (exp)) | |
340 return false; | |
341 | |
111 | 342 /* External public symbols, which aren't weakref-s, |
343 have local-binding for PE targets. */ | |
344 if (DECL_P (exp) | |
345 && !lookup_attribute ("weakref", DECL_ATTRIBUTES (exp)) | |
346 && TREE_PUBLIC (exp) | |
347 && DECL_EXTERNAL (exp)) | |
348 return true; | |
349 | |
350 #ifndef MAKE_DECL_ONE_ONLY | |
351 /* PR target/66655: If a function has been marked as DECL_ONE_ONLY | |
352 but we do not the means to make it so, then do not allow it to | |
353 bind locally. */ | |
354 if (DECL_P (exp) | |
355 && TREE_CODE (exp) == FUNCTION_DECL | |
356 && TREE_PUBLIC (exp) | |
357 && DECL_ONE_ONLY (exp) | |
358 && ! DECL_EXTERNAL (exp) | |
359 && DECL_DECLARED_INLINE_P (exp)) | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
360 return false; |
111 | 361 #endif |
362 | |
363 return default_binds_local_p_1 (exp, 0); | |
0 | 364 } |
365 | |
366 /* Also strip the fastcall prefix and stdcall suffix. */ | |
367 | |
368 const char * | |
369 i386_pe_strip_name_encoding_full (const char *str) | |
370 { | |
371 const char *p; | |
372 const char *name = default_strip_name_encoding (str); | |
373 | |
374 /* Strip leading '@' on fastcall symbols. */ | |
375 if (*name == '@') | |
376 name++; | |
377 | |
378 /* Strip trailing "@n". */ | |
379 p = strchr (name, '@'); | |
380 if (p) | |
381 return ggc_alloc_string (name, p - name); | |
382 | |
383 return name; | |
384 } | |
385 | |
386 void | |
387 i386_pe_unique_section (tree decl, int reloc) | |
388 { | |
389 int len; | |
390 const char *name, *prefix; | |
391 char *string; | |
392 | |
111 | 393 /* Ignore RELOC, if we are allowed to put relocated |
394 const data into read-only section. */ | |
395 if (!flag_writable_rel_rdata) | |
396 reloc = 0; | |
0 | 397 name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); |
398 name = i386_pe_strip_name_encoding_full (name); | |
399 | |
400 /* The object is put in, for example, section .text$foo. | |
401 The linker will then ultimately place them in .text | |
402 (everything from the $ on is stripped). Don't put | |
403 read-only data in .rdata section to avoid a PE linker | |
404 bug when .rdata$* grouped sections are used in code | |
405 without a .rdata section. */ | |
406 if (TREE_CODE (decl) == FUNCTION_DECL) | |
407 prefix = ".text$"; | |
408 else if (decl_readonly_section (decl, reloc)) | |
409 prefix = ".rdata$"; | |
410 else | |
411 prefix = ".data$"; | |
412 len = strlen (name) + strlen (prefix); | |
413 string = XALLOCAVEC (char, len + 1); | |
414 sprintf (string, "%s%s", prefix, name); | |
415 | |
111 | 416 set_decl_section_name (decl, string); |
417 } | |
418 | |
419 /* Local and global relocs can be placed always into readonly memory for | |
420 memory for PE-COFF targets. */ | |
421 int | |
422 i386_pe_reloc_rw_mask (void) | |
423 { | |
424 return 0; | |
0 | 425 } |
426 | |
427 /* Select a set of attributes for section NAME based on the properties | |
428 of DECL and whether or not RELOC indicates that DECL's initializer | |
429 might contain runtime relocations. | |
430 | |
431 We make the section read-only and executable for a function decl, | |
432 read-only for a const data decl, and writable for a non-const data decl. | |
433 | |
434 If the section has already been defined, to not allow it to have | |
435 different attributes, as (1) this is ambiguous since we're not seeing | |
436 all the declarations up front and (2) some assemblers (e.g. SVR4) | |
437 do not recognize section redefinitions. */ | |
438 /* ??? This differs from the "standard" PE implementation in that we | |
439 handle the SHARED variable attribute. Should this be done for all | |
440 PE targets? */ | |
441 | |
442 #define SECTION_PE_SHARED SECTION_MACH_DEP | |
443 | |
444 unsigned int | |
111 | 445 i386_pe_section_type_flags (tree decl, const char *, int reloc) |
0 | 446 { |
447 unsigned int flags; | |
448 | |
111 | 449 /* Ignore RELOC, if we are allowed to put relocated |
450 const data into read-only section. */ | |
451 if (!flag_writable_rel_rdata) | |
452 reloc = 0; | |
0 | 453 |
454 if (decl && TREE_CODE (decl) == FUNCTION_DECL) | |
455 flags = SECTION_CODE; | |
456 else if (decl && decl_readonly_section (decl, reloc)) | |
457 flags = 0; | |
458 else | |
459 { | |
460 flags = SECTION_WRITE; | |
461 | |
462 if (decl && TREE_CODE (decl) == VAR_DECL | |
463 && lookup_attribute ("shared", DECL_ATTRIBUTES (decl))) | |
464 flags |= SECTION_PE_SHARED; | |
465 } | |
466 | |
111 | 467 if (decl && DECL_P (decl) && DECL_ONE_ONLY (decl)) |
0 | 468 flags |= SECTION_LINKONCE; |
469 | |
470 return flags; | |
471 } | |
472 | |
473 void | |
474 i386_pe_asm_named_section (const char *name, unsigned int flags, | |
475 tree decl) | |
476 { | |
477 char flagchars[8], *f = flagchars; | |
478 | |
111 | 479 #if defined (HAVE_GAS_SECTION_EXCLUDE) && HAVE_GAS_SECTION_EXCLUDE == 1 |
480 if ((flags & SECTION_EXCLUDE) != 0) | |
481 *f++ = 'e'; | |
482 #endif | |
483 | |
0 | 484 if ((flags & (SECTION_CODE | SECTION_WRITE)) == 0) |
485 /* readonly data */ | |
486 { | |
487 *f++ ='d'; /* This is necessary for older versions of gas. */ | |
488 *f++ ='r'; | |
489 } | |
490 else | |
491 { | |
492 if (flags & SECTION_CODE) | |
493 *f++ = 'x'; | |
494 if (flags & SECTION_WRITE) | |
495 *f++ = 'w'; | |
496 if (flags & SECTION_PE_SHARED) | |
497 *f++ = 's'; | |
111 | 498 #if !defined (HAVE_GAS_SECTION_EXCLUDE) || HAVE_GAS_SECTION_EXCLUDE == 0 |
499 /* If attribute "e" isn't supported we mark this section as | |
500 never-load. */ | |
501 if ((flags & SECTION_EXCLUDE) != 0) | |
502 *f++ = 'n'; | |
503 #endif | |
0 | 504 } |
505 | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
506 /* LTO sections need 1-byte alignment to avoid confusing the |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
507 zlib decompression algorithm with trailing zero pad bytes. */ |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
508 if (strncmp (name, LTO_SECTION_NAME_PREFIX, |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
509 strlen (LTO_SECTION_NAME_PREFIX)) == 0) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
510 *f++ = '0'; |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
511 |
0 | 512 *f = '\0'; |
513 | |
514 fprintf (asm_out_file, "\t.section\t%s,\"%s\"\n", name, flagchars); | |
515 | |
516 if (flags & SECTION_LINKONCE) | |
517 { | |
518 /* Functions may have been compiled at various levels of | |
519 optimization so we can't use `same_size' here. | |
520 Instead, have the linker pick one, without warning. | |
521 If 'selectany' attribute has been specified, MS compiler | |
522 sets 'discard' characteristic, rather than telling linker | |
523 to warn of size or content mismatch, so do the same. */ | |
524 bool discard = (flags & SECTION_CODE) | |
111 | 525 || (TREE_CODE (decl) != IDENTIFIER_NODE |
526 && lookup_attribute ("selectany", | |
527 DECL_ATTRIBUTES (decl))); | |
0 | 528 fprintf (asm_out_file, "\t.linkonce %s\n", |
529 (discard ? "discard" : "same_size")); | |
530 } | |
531 } | |
532 | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
533 /* Beware, DECL may be NULL if compile_file() is emitting the LTO marker. */ |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
534 |
0 | 535 void |
536 i386_pe_asm_output_aligned_decl_common (FILE *stream, tree decl, | |
537 const char *name, HOST_WIDE_INT size, | |
111 | 538 HOST_WIDE_INT align) |
0 | 539 { |
540 HOST_WIDE_INT rounded; | |
541 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
542 /* Compute as in assemble_noswitch_variable, since we don't have |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
543 support for aligned common on older binutils. We must also |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
544 avoid emitting a common symbol of size zero, as this is the |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
545 overloaded representation that indicates an undefined external |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
546 symbol in the PE object file format. */ |
0 | 547 rounded = size ? size : 1; |
548 rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; | |
549 rounded = (rounded / (BIGGEST_ALIGNMENT / BITS_PER_UNIT) | |
550 * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); | |
551 | |
552 i386_pe_maybe_record_exported_symbol (decl, name, 1); | |
553 | |
554 fprintf (stream, "\t.comm\t"); | |
555 assemble_name (stream, name); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
556 if (use_pe_aligned_common) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
557 fprintf (stream, ", " HOST_WIDE_INT_PRINT_DEC ", %d\n", |
111 | 558 size ? size : HOST_WIDE_INT_1, |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
559 exact_log2 (align) - exact_log2 (CHAR_BIT)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
560 else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
561 fprintf (stream, ", " HOST_WIDE_INT_PRINT_DEC "\t" ASM_COMMENT_START |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
562 " " HOST_WIDE_INT_PRINT_DEC "\n", rounded, size); |
0 | 563 } |
564 | |
565 /* The Microsoft linker requires that every function be marked as | |
566 DT_FCN. When using gas on cygwin, we must emit appropriate .type | |
567 directives. */ | |
568 | |
569 #include "gsyms.h" | |
570 | |
571 /* Mark a function appropriately. This should only be called for | |
572 functions for which we are not emitting COFF debugging information. | |
573 FILE is the assembler output file, NAME is the name of the | |
574 function, and PUB is nonzero if the function is globally | |
575 visible. */ | |
576 | |
577 void | |
578 i386_pe_declare_function_type (FILE *file, const char *name, int pub) | |
579 { | |
580 fprintf (file, "\t.def\t"); | |
581 assemble_name (file, name); | |
582 fprintf (file, ";\t.scl\t%d;\t.type\t%d;\t.endef\n", | |
583 pub ? (int) C_EXT : (int) C_STAT, | |
584 (int) DT_FCN << N_BTSHFT); | |
585 } | |
586 | |
587 /* Keep a list of external functions. */ | |
588 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
589 struct GTY(()) extern_list |
0 | 590 { |
591 struct extern_list *next; | |
592 tree decl; | |
593 const char *name; | |
594 }; | |
595 | |
596 static GTY(()) struct extern_list *extern_head; | |
597 | |
598 /* Assemble an external function reference. We need to keep a list of | |
599 these, so that we can output the function types at the end of the | |
600 assembly. We can't output the types now, because we might see a | |
601 definition of the function later on and emit debugging information | |
602 for it then. */ | |
603 | |
604 void | |
605 i386_pe_record_external_function (tree decl, const char *name) | |
606 { | |
607 struct extern_list *p; | |
608 | |
111 | 609 p = ggc_alloc<extern_list> (); |
0 | 610 p->next = extern_head; |
611 p->decl = decl; | |
612 p->name = name; | |
613 extern_head = p; | |
614 } | |
615 | |
616 /* Keep a list of exported symbols. */ | |
617 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
618 struct GTY(()) export_list |
0 | 619 { |
620 struct export_list *next; | |
621 const char *name; | |
622 int is_data; /* used to type tag exported symbols. */ | |
623 }; | |
624 | |
111 | 625 /* Keep a list of stub symbols. */ |
626 | |
627 struct GTY(()) stub_list | |
628 { | |
629 struct stub_list *next; | |
630 const char *name; | |
631 }; | |
632 | |
0 | 633 static GTY(()) struct export_list *export_head; |
634 | |
111 | 635 static GTY(()) struct stub_list *stub_head; |
636 | |
0 | 637 /* Assemble an export symbol entry. We need to keep a list of |
638 these, so that we can output the export list at the end of the | |
639 assembly. We used to output these export symbols in each function, | |
640 but that causes problems with GNU ld when the sections are | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
641 linkonce. Beware, DECL may be NULL if compile_file() is emitting |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
642 the LTO marker. */ |
0 | 643 |
644 void | |
645 i386_pe_maybe_record_exported_symbol (tree decl, const char *name, int is_data) | |
646 { | |
647 rtx symbol; | |
648 struct export_list *p; | |
649 | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
650 if (!decl) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
651 return; |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
652 |
0 | 653 symbol = XEXP (DECL_RTL (decl), 0); |
654 gcc_assert (GET_CODE (symbol) == SYMBOL_REF); | |
655 if (!SYMBOL_REF_DLLEXPORT_P (symbol)) | |
656 return; | |
657 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
658 gcc_assert (TREE_PUBLIC (decl)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
659 |
111 | 660 p = ggc_alloc<export_list> (); |
0 | 661 p->next = export_head; |
662 p->name = name; | |
663 p->is_data = is_data; | |
664 export_head = p; | |
665 } | |
666 | |
111 | 667 void |
668 i386_pe_record_stub (const char *name) | |
669 { | |
670 struct stub_list *p; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
671 |
111 | 672 if (!name || *name == 0) |
673 return; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
674 |
111 | 675 p = stub_head; |
676 while (p != NULL) | |
677 { | |
678 if (p->name[0] == *name | |
679 && !strcmp (p->name, name)) | |
680 return; | |
681 p = p->next; | |
682 } | |
683 | |
684 p = ggc_alloc<stub_list> (); | |
685 p->next = stub_head; | |
686 p->name = name; | |
687 stub_head = p; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
688 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
689 |
111 | 690 |
691 #ifdef CXX_WRAP_SPEC_LIST | |
692 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
693 /* Search for a function named TARGET in the list of library wrappers |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
694 we are using, returning a pointer to it if found or NULL if not. |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
695 This function might be called on quite a few symbols, and we only |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
696 have the list of names of wrapped functions available to us as a |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
697 spec string, so first time round we lazily initialise a hash table |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
698 to make things quicker. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
699 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
700 static const char * |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
701 i386_find_on_wrapper_list (const char *target) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
702 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
703 static char first_time = 1; |
111 | 704 static hash_table<nofree_string_hash> *wrappers; |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
705 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
706 if (first_time) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
707 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
708 /* Beware that this is not a complicated parser, it assumes |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
709 that any sequence of non-whitespace beginning with an |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
710 underscore is one of the wrapped symbols. For now that's |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
711 adequate to distinguish symbols from spec substitutions |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
712 and command-line options. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
713 static char wrapper_list_buffer[] = CXX_WRAP_SPEC_LIST; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
714 char *bufptr; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
715 /* Breaks up the char array into separated strings |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
716 strings and enter them into the hash table. */ |
111 | 717 wrappers = new hash_table<nofree_string_hash> (8); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
718 for (bufptr = wrapper_list_buffer; *bufptr; ++bufptr) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
719 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
720 char *found = NULL; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
721 if (ISSPACE (*bufptr)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
722 continue; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
723 if (*bufptr == '_') |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
724 found = bufptr; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
725 while (*bufptr && !ISSPACE (*bufptr)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
726 ++bufptr; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
727 if (*bufptr) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
728 *bufptr = 0; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
729 if (found) |
111 | 730 *wrappers->find_slot (found, INSERT) = found; |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
731 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
732 first_time = 0; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
733 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
734 |
111 | 735 return wrappers->find (target); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
736 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
737 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
738 #endif /* CXX_WRAP_SPEC_LIST */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
739 |
0 | 740 /* This is called at the end of assembly. For each external function |
741 which has not been defined, we output a declaration now. We also | |
742 output the .drectve section. */ | |
743 | |
744 void | |
745 i386_pe_file_end (void) | |
746 { | |
747 struct extern_list *p; | |
748 | |
749 for (p = extern_head; p != NULL; p = p->next) | |
750 { | |
751 tree decl; | |
752 | |
753 decl = p->decl; | |
754 | |
755 /* Positively ensure only one declaration for any given symbol. */ | |
756 if (! TREE_ASM_WRITTEN (decl) | |
757 && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) | |
758 { | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
759 #ifdef CXX_WRAP_SPEC_LIST |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
760 /* To ensure the DLL that provides the corresponding real |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
761 functions is still loaded at runtime, we must reference |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
762 the real function so that an (unused) import is created. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
763 const char *realsym = i386_find_on_wrapper_list (p->name); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
764 if (realsym) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
765 i386_pe_declare_function_type (asm_out_file, |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
766 concat ("__real_", realsym, NULL), TREE_PUBLIC (decl)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
767 #endif /* CXX_WRAP_SPEC_LIST */ |
0 | 768 TREE_ASM_WRITTEN (decl) = 1; |
769 i386_pe_declare_function_type (asm_out_file, p->name, | |
770 TREE_PUBLIC (decl)); | |
771 } | |
772 } | |
773 | |
774 if (export_head) | |
775 { | |
776 struct export_list *q; | |
777 drectve_section (); | |
778 for (q = export_head; q != NULL; q = q->next) | |
779 { | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
780 fprintf (asm_out_file, "\t.ascii \" -export:\\\"%s\\\"%s\"\n", |
0 | 781 default_strip_name_encoding (q->name), |
782 (q->is_data ? ",data" : "")); | |
783 } | |
784 } | |
111 | 785 |
786 if (stub_head) | |
787 { | |
788 struct stub_list *q; | |
789 | |
790 for (q = stub_head; q != NULL; q = q->next) | |
791 { | |
792 const char *name = q->name; | |
793 const char *oname; | |
794 | |
795 if (name[0] == '*') | |
796 ++name; | |
797 oname = name; | |
798 if (name[0] == '.') | |
799 ++name; | |
800 if (strncmp (name, "refptr.", 7) != 0) | |
801 continue; | |
802 name += 7; | |
803 fprintf (asm_out_file, "\t.section\t.rdata$%s, \"dr\"\n" | |
804 "\t.globl\t%s\n" | |
805 "\t.linkonce\tdiscard\n", oname, oname); | |
806 fprintf (asm_out_file, "%s:\n\t.quad\t%s\n", oname, name); | |
807 } | |
808 } | |
0 | 809 } |
810 | |
131 | 811 /* Kludge because of missing PE-COFF support for early LTO debug. */ |
812 | |
813 static enum debug_info_levels saved_debug_info_level; | |
814 | |
815 void | |
816 i386_pe_asm_lto_start (void) | |
817 { | |
818 saved_debug_info_level = debug_info_level; | |
819 debug_info_level = DINFO_LEVEL_NONE; | |
820 } | |
821 | |
822 void | |
823 i386_pe_asm_lto_end (void) | |
824 { | |
825 debug_info_level = saved_debug_info_level; | |
826 } | |
827 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
828 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
829 /* x64 Structured Exception Handling unwind info. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
830 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
831 struct seh_frame_state |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
832 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
833 /* SEH records saves relative to the "current" stack pointer, whether |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
834 or not there's a frame pointer in place. This tracks the current |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
835 stack pointer offset from the CFA. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
836 HOST_WIDE_INT sp_offset; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
837 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
838 /* The CFA is located at CFA_REG + CFA_OFFSET. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
839 HOST_WIDE_INT cfa_offset; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
840 rtx cfa_reg; |
131 | 841 |
842 /* The offset wrt the CFA where register N has been saved. */ | |
843 HOST_WIDE_INT reg_offset[FIRST_PSEUDO_REGISTER]; | |
844 | |
845 /* True if we are past the end of the epilogue. */ | |
846 bool after_prologue; | |
847 | |
848 /* True if we are in the cold section. */ | |
849 bool in_cold_section; | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
850 }; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
851 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
852 /* Set up data structures beginning output for SEH. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
853 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
854 void |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
855 i386_pe_seh_init (FILE *f) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
856 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
857 struct seh_frame_state *seh; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
858 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
859 if (!TARGET_SEH) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
860 return; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
861 if (cfun->is_thunk) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
862 return; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
863 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
864 /* We cannot support DRAP with SEH. We turned off support for it by |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
865 re-defining MAX_STACK_ALIGNMENT when SEH is enabled. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
866 gcc_assert (!stack_realign_drap); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
867 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
868 seh = XCNEW (struct seh_frame_state); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
869 cfun->machine->seh = seh; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
870 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
871 seh->sp_offset = INCOMING_FRAME_SP_OFFSET; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
872 seh->cfa_offset = INCOMING_FRAME_SP_OFFSET; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
873 seh->cfa_reg = stack_pointer_rtx; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
874 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
875 fputs ("\t.seh_proc\t", f); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
876 assemble_name (f, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (cfun->decl))); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
877 fputc ('\n', f); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
878 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
879 |
131 | 880 /* Emit an assembler directive for the end of the prologue. */ |
881 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
882 void |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
883 i386_pe_seh_end_prologue (FILE *f) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
884 { |
131 | 885 if (!TARGET_SEH) |
886 return; | |
887 if (cfun->is_thunk) | |
888 return; | |
889 cfun->machine->seh->after_prologue = true; | |
890 fputs ("\t.seh_endprologue\n", f); | |
891 } | |
892 | |
893 /* Emit assembler directives to reconstruct the SEH state. */ | |
894 | |
895 void | |
896 i386_pe_seh_cold_init (FILE *f, const char *name) | |
897 { | |
898 struct seh_frame_state *seh; | |
899 HOST_WIDE_INT alloc_offset, offset; | |
900 | |
901 if (!TARGET_SEH) | |
902 return; | |
903 if (cfun->is_thunk) | |
904 return; | |
905 seh = cfun->machine->seh; | |
906 | |
907 fputs ("\t.seh_proc\t", f); | |
908 assemble_name (f, name); | |
909 fputc ('\n', f); | |
910 | |
911 /* In the normal case, the frame pointer is near the bottom of the frame | |
912 so we can do the full stack allocation and set it afterwards. There | |
913 is an exception when the function accesses prior frames so, in this | |
914 case, we need to pre-allocate a small chunk before setting it. */ | |
915 if (crtl->accesses_prior_frames) | |
916 alloc_offset = seh->cfa_offset; | |
917 else | |
918 alloc_offset = seh->sp_offset; | |
919 | |
920 offset = alloc_offset - INCOMING_FRAME_SP_OFFSET; | |
921 if (offset > 0 && offset < SEH_MAX_FRAME_SIZE) | |
922 fprintf (f, "\t.seh_stackalloc\t" HOST_WIDE_INT_PRINT_DEC "\n", offset); | |
923 | |
924 for (int regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) | |
925 if (seh->reg_offset[regno] > 0 && seh->reg_offset[regno] <= alloc_offset) | |
926 { | |
927 if (SSE_REGNO_P (regno)) | |
928 fputs ("\t.seh_savexmm\t", f); | |
929 else if (GENERAL_REGNO_P (regno)) | |
930 fputs ("\t.seh_savereg\t", f); | |
931 else | |
932 gcc_unreachable (); | |
933 print_reg (gen_rtx_REG (DImode, regno), 0, f); | |
934 fprintf (f, ", " HOST_WIDE_INT_PRINT_DEC "\n", | |
935 alloc_offset - seh->reg_offset[regno]); | |
936 } | |
937 | |
938 if (seh->cfa_reg != stack_pointer_rtx) | |
939 { | |
940 offset = alloc_offset - seh->cfa_offset; | |
941 | |
942 gcc_assert ((offset & 15) == 0); | |
943 gcc_assert (IN_RANGE (offset, 0, 240)); | |
944 | |
945 fputs ("\t.seh_setframe\t", f); | |
946 print_reg (seh->cfa_reg, 0, f); | |
947 fprintf (f, ", " HOST_WIDE_INT_PRINT_DEC "\n", offset); | |
948 } | |
949 | |
950 if (crtl->accesses_prior_frames) | |
951 { | |
952 offset = seh->sp_offset - alloc_offset; | |
953 if (offset > 0 && offset < SEH_MAX_FRAME_SIZE) | |
954 fprintf (f, "\t.seh_stackalloc\t" HOST_WIDE_INT_PRINT_DEC "\n", offset); | |
955 | |
956 for (int regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) | |
957 if (seh->reg_offset[regno] > alloc_offset) | |
958 { | |
959 if (SSE_REGNO_P (regno)) | |
960 fputs ("\t.seh_savexmm\t", f); | |
961 else if (GENERAL_REGNO_P (regno)) | |
962 fputs ("\t.seh_savereg\t", f); | |
963 else | |
964 gcc_unreachable (); | |
965 print_reg (gen_rtx_REG (DImode, regno), 0, f); | |
966 fprintf (f, ", " HOST_WIDE_INT_PRINT_DEC "\n", | |
967 seh->sp_offset - seh->reg_offset[regno]); | |
968 } | |
969 } | |
970 | |
971 fputs ("\t.seh_endprologue\n", f); | |
972 } | |
973 | |
974 /* Emit an assembler directive for the end of the function. */ | |
975 | |
976 static void | |
977 i386_pe_seh_fini (FILE *f, bool cold) | |
978 { | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
979 struct seh_frame_state *seh; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
980 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
981 if (!TARGET_SEH) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
982 return; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
983 if (cfun->is_thunk) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
984 return; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
985 seh = cfun->machine->seh; |
131 | 986 if (cold != seh->in_cold_section) |
987 return; | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
988 XDELETE (seh); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
989 cfun->machine->seh = NULL; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
990 fputs ("\t.seh_endproc\n", f); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
991 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
992 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
993 /* Emit an assembler directive to save REG via a PUSH. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
994 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
995 static void |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
996 seh_emit_push (FILE *f, struct seh_frame_state *seh, rtx reg) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
997 { |
131 | 998 const unsigned int regno = REGNO (reg); |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
999 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1000 gcc_checking_assert (GENERAL_REGNO_P (regno)); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1001 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1002 seh->sp_offset += UNITS_PER_WORD; |
131 | 1003 seh->reg_offset[regno] = seh->sp_offset; |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1004 if (seh->cfa_reg == stack_pointer_rtx) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1005 seh->cfa_offset += UNITS_PER_WORD; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1006 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1007 fputs ("\t.seh_pushreg\t", f); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1008 print_reg (reg, 0, f); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1009 fputc ('\n', f); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1010 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1011 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1012 /* Emit an assembler directive to save REG at CFA - CFA_OFFSET. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1013 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1014 static void |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1015 seh_emit_save (FILE *f, struct seh_frame_state *seh, |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1016 rtx reg, HOST_WIDE_INT cfa_offset) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1017 { |
131 | 1018 const unsigned int regno = REGNO (reg); |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1019 HOST_WIDE_INT offset; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1020 |
131 | 1021 seh->reg_offset[regno] = cfa_offset; |
1022 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1023 /* Negative save offsets are of course not supported, since that |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1024 would be a store below the stack pointer and thus clobberable. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1025 gcc_assert (seh->sp_offset >= cfa_offset); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1026 offset = seh->sp_offset - cfa_offset; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1027 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1028 fputs ((SSE_REGNO_P (regno) ? "\t.seh_savexmm\t" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1029 : GENERAL_REGNO_P (regno) ? "\t.seh_savereg\t" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1030 : (gcc_unreachable (), "")), f); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1031 print_reg (reg, 0, f); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1032 fprintf (f, ", " HOST_WIDE_INT_PRINT_DEC "\n", offset); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1033 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1034 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1035 /* Emit an assembler directive to adjust RSP by OFFSET. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1036 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1037 static void |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1038 seh_emit_stackalloc (FILE *f, struct seh_frame_state *seh, |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1039 HOST_WIDE_INT offset) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1040 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1041 /* We're only concerned with prologue stack allocations, which all |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1042 are subtractions from the stack pointer. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1043 gcc_assert (offset < 0); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1044 offset = -offset; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1045 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1046 if (seh->cfa_reg == stack_pointer_rtx) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1047 seh->cfa_offset += offset; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1048 seh->sp_offset += offset; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1049 |
111 | 1050 /* Do not output the stackalloc in that case (it won't work as there is no |
1051 encoding for very large frame size). */ | |
1052 if (offset < SEH_MAX_FRAME_SIZE) | |
1053 fprintf (f, "\t.seh_stackalloc\t" HOST_WIDE_INT_PRINT_DEC "\n", offset); | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1054 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1055 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1056 /* Process REG_CFA_ADJUST_CFA for SEH. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1057 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1058 static void |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1059 seh_cfa_adjust_cfa (FILE *f, struct seh_frame_state *seh, rtx pat) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1060 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1061 rtx dest, src; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1062 HOST_WIDE_INT reg_offset = 0; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1063 unsigned int dest_regno; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1064 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1065 dest = SET_DEST (pat); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1066 src = SET_SRC (pat); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1067 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1068 if (GET_CODE (src) == PLUS) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1069 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1070 reg_offset = INTVAL (XEXP (src, 1)); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1071 src = XEXP (src, 0); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1072 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1073 else if (GET_CODE (src) == MINUS) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1074 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1075 reg_offset = -INTVAL (XEXP (src, 1)); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1076 src = XEXP (src, 0); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1077 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1078 gcc_assert (src == stack_pointer_rtx); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1079 gcc_assert (seh->cfa_reg == stack_pointer_rtx); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1080 dest_regno = REGNO (dest); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1081 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1082 if (dest_regno == STACK_POINTER_REGNUM) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1083 seh_emit_stackalloc (f, seh, reg_offset); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1084 else if (dest_regno == HARD_FRAME_POINTER_REGNUM) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1085 { |
111 | 1086 HOST_WIDE_INT offset; |
1087 | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1088 seh->cfa_reg = dest; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1089 seh->cfa_offset -= reg_offset; |
111 | 1090 |
1091 offset = seh->sp_offset - seh->cfa_offset; | |
1092 | |
1093 gcc_assert ((offset & 15) == 0); | |
1094 gcc_assert (IN_RANGE (offset, 0, 240)); | |
1095 | |
1096 fputs ("\t.seh_setframe\t", f); | |
1097 print_reg (seh->cfa_reg, 0, f); | |
1098 fprintf (f, ", " HOST_WIDE_INT_PRINT_DEC "\n", offset); | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1099 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1100 else |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1101 gcc_unreachable (); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1102 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1103 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1104 /* Process REG_CFA_OFFSET for SEH. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1105 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1106 static void |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1107 seh_cfa_offset (FILE *f, struct seh_frame_state *seh, rtx pat) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1108 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1109 rtx dest, src; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1110 HOST_WIDE_INT reg_offset; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1111 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1112 dest = SET_DEST (pat); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1113 src = SET_SRC (pat); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1114 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1115 gcc_assert (MEM_P (dest)); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1116 dest = XEXP (dest, 0); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1117 if (REG_P (dest)) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1118 reg_offset = 0; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1119 else |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1120 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1121 gcc_assert (GET_CODE (dest) == PLUS); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1122 reg_offset = INTVAL (XEXP (dest, 1)); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1123 dest = XEXP (dest, 0); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1124 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1125 gcc_assert (dest == seh->cfa_reg); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1126 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1127 seh_emit_save (f, seh, src, seh->cfa_offset - reg_offset); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1128 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1129 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1130 /* Process a FRAME_RELATED_EXPR for SEH. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1131 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1132 static void |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1133 seh_frame_related_expr (FILE *f, struct seh_frame_state *seh, rtx pat) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1134 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1135 rtx dest, src; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1136 HOST_WIDE_INT addend; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1137 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1138 /* See the full loop in dwarf2out_frame_debug_expr. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1139 if (GET_CODE (pat) == PARALLEL || GET_CODE (pat) == SEQUENCE) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1140 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1141 int i, n = XVECLEN (pat, 0), pass, npass; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1142 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1143 npass = (GET_CODE (pat) == PARALLEL ? 2 : 1); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1144 for (pass = 0; pass < npass; ++pass) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1145 for (i = 0; i < n; ++i) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1146 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1147 rtx ele = XVECEXP (pat, 0, i); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1148 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1149 if (GET_CODE (ele) != SET) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1150 continue; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1151 dest = SET_DEST (ele); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1152 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1153 /* Process each member of the PARALLEL independently. The first |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1154 member is always processed; others only if they are marked. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1155 if (i == 0 || RTX_FRAME_RELATED_P (ele)) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1156 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1157 /* Evaluate all register saves in the first pass and all |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1158 register updates in the second pass. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1159 if ((MEM_P (dest) ^ pass) || npass == 1) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1160 seh_frame_related_expr (f, seh, ele); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1161 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1162 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1163 return; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1164 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1165 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1166 dest = SET_DEST (pat); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1167 src = SET_SRC (pat); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1168 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1169 switch (GET_CODE (dest)) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1170 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1171 case REG: |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1172 switch (GET_CODE (src)) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1173 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1174 case REG: |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1175 /* REG = REG: This should be establishing a frame pointer. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1176 gcc_assert (src == stack_pointer_rtx); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1177 gcc_assert (dest == hard_frame_pointer_rtx); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1178 seh_cfa_adjust_cfa (f, seh, pat); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1179 break; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1180 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1181 case PLUS: |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1182 addend = INTVAL (XEXP (src, 1)); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1183 src = XEXP (src, 0); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1184 if (dest == hard_frame_pointer_rtx) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1185 seh_cfa_adjust_cfa (f, seh, pat); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1186 else if (dest == stack_pointer_rtx) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1187 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1188 gcc_assert (src == stack_pointer_rtx); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1189 seh_emit_stackalloc (f, seh, addend); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1190 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1191 else |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1192 gcc_unreachable (); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1193 break; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1194 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1195 default: |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1196 gcc_unreachable (); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1197 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1198 break; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1199 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1200 case MEM: |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1201 /* A save of some kind. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1202 dest = XEXP (dest, 0); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1203 if (GET_CODE (dest) == PRE_DEC) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1204 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1205 gcc_checking_assert (GET_MODE (src) == Pmode); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1206 gcc_checking_assert (REG_P (src)); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1207 seh_emit_push (f, seh, src); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1208 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1209 else |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1210 seh_cfa_offset (f, seh, pat); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1211 break; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1212 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1213 default: |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1214 gcc_unreachable (); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1215 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1216 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1217 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1218 /* This function looks at a single insn and emits any SEH directives |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1219 required for unwind of this insn. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1220 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1221 void |
111 | 1222 i386_pe_seh_unwind_emit (FILE *asm_out_file, rtx_insn *insn) |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1223 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1224 rtx note, pat; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1225 bool handled_one = false; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1226 struct seh_frame_state *seh; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1227 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1228 if (!TARGET_SEH) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1229 return; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1230 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1231 seh = cfun->machine->seh; |
131 | 1232 if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_SWITCH_TEXT_SECTIONS) |
1233 { | |
1234 fputs ("\t.seh_endproc\n", asm_out_file); | |
1235 seh->in_cold_section = true; | |
1236 return; | |
1237 } | |
1238 | |
1239 if (NOTE_P (insn) || !RTX_FRAME_RELATED_P (insn)) | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1240 return; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1241 |
131 | 1242 /* Skip RTX_FRAME_RELATED_P insns that are associated with the epilogue. */ |
1243 if (seh->after_prologue) | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1244 return; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1245 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1246 for (note = REG_NOTES (insn); note ; note = XEXP (note, 1)) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1247 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1248 switch (REG_NOTE_KIND (note)) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1249 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1250 case REG_FRAME_RELATED_EXPR: |
111 | 1251 pat = XEXP (note, 0); |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1252 goto found; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1253 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1254 case REG_CFA_DEF_CFA: |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1255 case REG_CFA_EXPRESSION: |
111 | 1256 /* Only emitted with DRAP and aligned memory access using a |
1257 realigned SP, both of which we disable. */ | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1258 gcc_unreachable (); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1259 break; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1260 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1261 case REG_CFA_REGISTER: |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1262 /* Only emitted in epilogues, which we skip. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1263 gcc_unreachable (); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1264 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1265 case REG_CFA_ADJUST_CFA: |
111 | 1266 pat = XEXP (note, 0); |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1267 if (pat == NULL) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1268 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1269 pat = PATTERN (insn); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1270 if (GET_CODE (pat) == PARALLEL) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1271 pat = XVECEXP (pat, 0, 0); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1272 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1273 seh_cfa_adjust_cfa (asm_out_file, seh, pat); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1274 handled_one = true; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1275 break; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1276 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1277 case REG_CFA_OFFSET: |
111 | 1278 pat = XEXP (note, 0); |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1279 if (pat == NULL) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1280 pat = single_set (insn); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1281 seh_cfa_offset (asm_out_file, seh, pat); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1282 handled_one = true; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1283 break; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1284 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1285 default: |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1286 break; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1287 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1288 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1289 if (handled_one) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1290 return; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1291 pat = PATTERN (insn); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1292 found: |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1293 seh_frame_related_expr (asm_out_file, seh, pat); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1294 } |
111 | 1295 |
1296 void | |
1297 i386_pe_seh_emit_except_personality (rtx personality) | |
1298 { | |
1299 int flags = 0; | |
1300 | |
1301 if (!TARGET_SEH) | |
1302 return; | |
1303 | |
1304 fputs ("\t.seh_handler\t", asm_out_file); | |
1305 output_addr_const (asm_out_file, personality); | |
1306 | |
1307 #if 0 | |
1308 /* ??? The current implementation of _GCC_specific_handler requires | |
1309 both except and unwind handling, regardless of which sorts the | |
1310 user-level function requires. */ | |
1311 eh_region r; | |
1312 FOR_ALL_EH_REGION(r) | |
1313 { | |
1314 if (r->type == ERT_CLEANUP) | |
1315 flags |= 1; | |
1316 else | |
1317 flags |= 2; | |
1318 } | |
1319 #else | |
1320 flags = 3; | |
1321 #endif | |
1322 | |
1323 if (flags & 1) | |
1324 fputs (", @unwind", asm_out_file); | |
1325 if (flags & 2) | |
1326 fputs (", @except", asm_out_file); | |
1327 fputc ('\n', asm_out_file); | |
1328 } | |
1329 | |
1330 void | |
1331 i386_pe_seh_init_sections (void) | |
1332 { | |
1333 if (TARGET_SEH) | |
1334 exception_section = get_unnamed_section (0, output_section_asm_op, | |
1335 "\t.seh_handlerdata"); | |
1336 } | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1337 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1338 void |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1339 i386_pe_start_function (FILE *f, const char *name, tree decl) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1340 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1341 i386_pe_maybe_record_exported_symbol (decl, name, 0); |
131 | 1342 i386_pe_declare_function_type (f, name, TREE_PUBLIC (decl)); |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1343 /* In case section was altered by debugging output. */ |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1344 if (decl != NULL_TREE) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1345 switch_to_section (function_section (decl)); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1346 ASM_OUTPUT_FUNCTION_LABEL (f, name, decl); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1347 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1348 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1349 void |
111 | 1350 i386_pe_end_function (FILE *f, const char *, tree) |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1351 { |
131 | 1352 i386_pe_seh_fini (f, false); |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1353 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1354 |
131 | 1355 void |
1356 i386_pe_end_cold_function (FILE *f, const char *, tree) | |
1357 { | |
1358 i386_pe_seh_fini (f, true); | |
1359 } | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
1360 |
0 | 1361 #include "gt-winnt.h" |