comparison gcc/config/s390/s390-c.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* Language specific subroutines used for code generation on IBM S/390 1 /* Language specific subroutines used for code generation on IBM S/390
2 and zSeries 2 and zSeries
3 Copyright (C) 2015-2017 Free Software Foundation, Inc. 3 Copyright (C) 2015-2018 Free Software Foundation, Inc.
4 4
5 Contributed by Andreas Krebbel (Andreas.Krebbel@de.ibm.com). 5 Contributed by Andreas Krebbel (Andreas.Krebbel@de.ibm.com).
6 6
7 This file is part of GCC. 7 This file is part of GCC.
8 8
24 24
25 In GCC terms this file belongs to the frontend. It will be 25 In GCC terms this file belongs to the frontend. It will be
26 compiled with -DIN_GCC_FRONTEND. With that rtl.h cannot be 26 compiled with -DIN_GCC_FRONTEND. With that rtl.h cannot be
27 included anymore - a mechanism supposed to avoid adding frontend - 27 included anymore - a mechanism supposed to avoid adding frontend -
28 backend dependencies. */ 28 backend dependencies. */
29
30 #define IN_TARGET_CODE 1
29 31
30 #include "config.h" 32 #include "config.h"
31 #include "system.h" 33 #include "system.h"
32 #include "coretypes.h" 34 #include "coretypes.h"
33 #include "target.h" 35 #include "target.h"
229 if (ident == C_CPP_HASHNODE (__vector_keyword)) 231 if (ident == C_CPP_HASHNODE (__vector_keyword))
230 return expand_this; 232 return expand_this;
231 233
232 rid_code = (enum rid)(ident->rid_code); 234 rid_code = (enum rid)(ident->rid_code);
233 235
234 if (ident->type == NT_MACRO) 236 if (cpp_macro_p (ident))
235 { 237 {
236 /* Now actually fetch the tokens we "peeked" before and do a 238 /* Now actually fetch the tokens we "peeked" before and do a
237 lookahead for the next. */ 239 lookahead for the next. */
238 do 240 do
239 (void) cpp_get_token (pfile); 241 (void) cpp_get_token (pfile);
331 s390_def_or_undef_macro (pfile, MASK_ZVECTOR, old_opts, opts, 333 s390_def_or_undef_macro (pfile, MASK_ZVECTOR, old_opts, opts,
332 "__bool=__attribute__((s390_vector_bool)) unsigned", 334 "__bool=__attribute__((s390_vector_bool)) unsigned",
333 "__bool"); 335 "__bool");
334 { 336 {
335 char macro_def[64]; 337 char macro_def[64];
336 int arch_level;
337 gcc_assert (s390_arch != PROCESSOR_NATIVE); 338 gcc_assert (s390_arch != PROCESSOR_NATIVE);
338 arch_level = (int)s390_arch + 3; 339 sprintf (macro_def, "__ARCH__=%d", processor_table[s390_arch].arch_level);
339 if (s390_arch >= PROCESSOR_2094_Z9_EC)
340 /* Z9_EC has the same level as Z9_109. */
341 arch_level--;
342 /* Review when a new arch is added and increase the value. */
343 char dummy[(PROCESSOR_max > 12) ? -1 : 1] __attribute__((unused));
344 sprintf (macro_def, "__ARCH__=%d", arch_level);
345 cpp_undef (pfile, "__ARCH__"); 340 cpp_undef (pfile, "__ARCH__");
346 cpp_define (pfile, macro_def); 341 cpp_define (pfile, macro_def);
347 } 342 }
348 343
349 if (!flag_iso) 344 if (!flag_iso)