1 # Copyright (C) 2003-2023 Free Software Foundation, Inc.
2 # Contributed by Kelley Cook, June 2004.
3 # Original code from Neil Booth, May 2003.
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the
7 # Free Software Foundation; either version 3, or (at your option) any
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; see the file COPYING3. If not see
17 # <http://www.gnu.org/licenses/>.
19 # This Awk script reads in the option records generated from
20 # opt-gather.awk, combines the flags of duplicate options and generates a
24 # This program uses functions from opt-functions.awk and code from
27 # Usage: awk -f opt-functions.awk -f opt-read.awk -f optc-save-gen.awk \
28 # [-v header_name=header.h] < inputfile > options-save.cc
30 # Dump that array of options into a C file.
32 print "/* This file is auto-generated by optc-save-gen.awk. */"
34 n_headers =
split(header_name
, headers
, " ")
35 for (i =
1; i
<= n_headers
; i
++)
36 print "#include " quote headers
[i
] quote
37 print "#include " quote
"opts.h" quote
38 print "#include " quote
"intl.h" quote
40 print "#include " quote
"flags.h" quote
41 print "#include " quote
"target.h" quote
42 print "#include " quote
"inchash.h" quote
43 print "#include " quote
"hash-set.h" quote
44 print "#include " quote
"vec.h" quote
45 print "#include " quote
"input.h" quote
46 print "#include " quote
"alias.h" quote
47 print "#include " quote
"symtab.h" quote
48 print "#include " quote
"inchash.h" quote
49 print "#include " quote
"tree.h" quote
50 print "#include " quote
"fold-const.h" quote
51 print "#include " quote
"tree-ssa-alias.h" quote
52 print "#include " quote
"is-a.h" quote
53 print "#include " quote
"predict.h" quote
54 print "#include " quote
"function.h" quote
55 print "#include " quote
"basic-block.h" quote
56 print "#include " quote
"gimple-expr.h" quote
57 print "#include " quote
"gimple.h" quote
58 print "#include " quote
"data-streamer.h" quote
59 print "#include " quote
"ipa-ref.h" quote
60 print "#include " quote
"cgraph.h" quote
63 if (n_extra_c_includes
> 0) {
64 for (i =
0; i
< n_extra_c_includes
; i
++) {
65 print "#include " quote extra_c_includes
[i
] quote
71 if (n_extra_target_vars
)
74 for (i =
0; i
< n_opts
; i
++) {
75 if (flag_set_p
("Save", flags
[i
]))
79 print "/* Save optimization variables into a structure. */"
81 print "cl_optimization_save (struct cl_optimization *ptr, struct gcc_options *opts,";
82 print " struct gcc_options *opts_set)";
91 var_opt_char
[0] =
"optimize";
92 var_opt_char
[1] =
"optimize_size";
93 var_opt_char
[2] =
"optimize_debug";
94 var_opt_char
[3] =
"optimize_fast";
95 var_opt_range
["optimize"] =
"0, 255";
96 var_opt_range
["optimize_size"] =
"0, 2";
97 var_opt_range
["optimize_debug"] =
"0, 1";
98 var_opt_range
["optimize_fast"] =
"0, 1";
100 # Sort by size to mimic how the structure is laid out to be friendlier to the
103 for (i =
0; i
< n_opts
; i
++) {
104 if (flag_set_p
("(Optimization|PerFunction)", flags
[i
])) {
105 name = var_name
(flags
[i
])
109 if(name in var_opt_seen
)
112 var_opt_seen
[name
]++;
113 otype = var_type_struct
(flags
[i
]);
114 if (otype ~
"^((un)?signed +)?int *$")
115 var_opt_int
[n_opt_int
++] = name
;
117 else if (otype ~
"^((un)?signed +)?short *$")
118 var_opt_short
[n_opt_short
++] = name
;
120 else if (otype ~
("^enum +[_" alnum
"]+ *")) {
121 var_opt_enum_type
[n_opt_enum
] = otype
;
122 var_opt_enum
[n_opt_enum
++] = name
;
124 else if (otype ~
"^((un)?signed +)?char *$") {
125 var_opt_char
[n_opt_char
++] = name
;
126 if (otype ~
"^unsigned +char *$")
127 var_opt_range
[name
] =
"0, 255"
128 else if (otype ~
"^signed +char *$")
129 var_opt_range
[name
] =
"-128, 127"
131 else if (otype ~
"^const char \\**$") {
132 var_opt_string
[n_opt_string
++] = name
;
133 string_options_names
[name
]++
136 var_opt_other
[n_opt_other
++] = name
;
140 for (i =
0; i
< n_opt_char
; i
++) {
141 name = var_opt_char
[i
];
142 if (var_opt_range
[name
] != "")
143 print " gcc_assert (IN_RANGE (opts->x_" name
", " var_opt_range
[name
] "));";
147 for (i =
0; i
< n_opt_other
; i
++) {
148 print " ptr->x_" var_opt_other
[i
] " = opts->x_" var_opt_other
[i
] ";";
151 for (i =
0; i
< n_opt_int
; i
++) {
152 print " ptr->x_" var_opt_int
[i
] " = opts->x_" var_opt_int
[i
] ";";
155 for (i =
0; i
< n_opt_enum
; i
++) {
156 print " ptr->x_" var_opt_enum
[i
] " = opts->x_" var_opt_enum
[i
] ";";
159 for (i =
0; i
< n_opt_short
; i
++) {
160 print " ptr->x_" var_opt_short
[i
] " = opts->x_" var_opt_short
[i
] ";";
163 for (i =
0; i
< n_opt_char
; i
++) {
164 print " ptr->x_" var_opt_char
[i
] " = opts->x_" var_opt_char
[i
] ";";
167 for (i =
0; i
< n_opt_string
; i
++) {
168 print " ptr->x_" var_opt_string
[i
] " = opts->x_" var_opt_string
[i
] ";";
172 print " unsigned HOST_WIDE_INT mask = 0;";
176 for (i =
0; i
< n_opt_other
; i
++) {
177 print " if (opts_set->x_" var_opt_other
[i
] ") mask |= HOST_WIDE_INT_1U << " j
";";
180 print " ptr->explicit_mask[" k
"] = mask;";
187 for (i =
0; i
< n_opt_int
; i
++) {
188 print " if (opts_set->x_" var_opt_int
[i
] ") mask |= HOST_WIDE_INT_1U << " j
";";
191 print " ptr->explicit_mask[" k
"] = mask;";
198 for (i =
0; i
< n_opt_enum
; i
++) {
199 print " if (opts_set->x_" var_opt_enum
[i
] ") mask |= HOST_WIDE_INT_1U << " j
";";
202 print " ptr->explicit_mask[" k
"] = mask;";
209 for (i =
0; i
< n_opt_short
; i
++) {
210 print " if (opts_set->x_" var_opt_short
[i
] ") mask |= HOST_WIDE_INT_1U << " j
";";
213 print " ptr->explicit_mask[" k
"] = mask;";
220 for (i =
0; i
< n_opt_char
; i
++) {
221 print " if (opts_set->x_" var_opt_char
[i
] ") mask |= HOST_WIDE_INT_1U << " j
";";
224 print " ptr->explicit_mask[" k
"] = mask;";
231 for (i =
0; i
< n_opt_string
; i
++) {
232 print " if (opts_set->x_" var_opt_string
[i
] ") mask |= HOST_WIDE_INT_1U << " j
";";
235 print " ptr->explicit_mask[" k
"] = mask;";
243 print " ptr->explicit_mask[" k
"] = mask;";
249 print "/* Restore optimization options from a structure. */";
251 print "cl_optimization_restore (struct gcc_options *opts, struct gcc_options *opts_set,";
252 print " struct cl_optimization *ptr)";
255 for (i =
0; i
< n_opt_other
; i
++) {
256 print " opts->x_" var_opt_other
[i
] " = ptr->x_" var_opt_other
[i
] ";";
259 for (i =
0; i
< n_opt_int
; i
++) {
260 print " opts->x_" var_opt_int
[i
] " = ptr->x_" var_opt_int
[i
] ";";
263 for (i =
0; i
< n_opt_enum
; i
++) {
264 print " opts->x_" var_opt_enum
[i
] " = ptr->x_" var_opt_enum
[i
] ";";
267 for (i =
0; i
< n_opt_short
; i
++) {
268 print " opts->x_" var_opt_short
[i
] " = ptr->x_" var_opt_short
[i
] ";";
271 for (i =
0; i
< n_opt_char
; i
++) {
272 print " opts->x_" var_opt_char
[i
] " = ptr->x_" var_opt_char
[i
] ";";
275 for (i =
0; i
< n_opt_string
; i
++) {
276 print " opts->x_" var_opt_string
[i
] " = ptr->x_" var_opt_string
[i
] ";";
280 print " unsigned HOST_WIDE_INT mask;";
284 for (i =
0; i
< n_opt_other
; i
++) {
286 print " mask = ptr->explicit_mask[" k
"];";
290 print " opts_set->x_" var_opt_other
[i
] " = (mask & 1) != 0;";
295 for (i =
0; i
< n_opt_int
; i
++) {
297 print " mask = ptr->explicit_mask[" k
"];";
301 print " opts_set->x_" var_opt_int
[i
] " = (mask & 1) != 0;";
306 for (i =
0; i
< n_opt_enum
; i
++) {
308 print " mask = ptr->explicit_mask[" k
"];";
312 print " opts_set->x_" var_opt_enum
[i
] " = static_cast<" var_opt_enum_type
[i
] ">((mask & 1) != 0);";
317 for (i =
0; i
< n_opt_short
; i
++) {
319 print " mask = ptr->explicit_mask[" k
"];";
323 print " opts_set->x_" var_opt_short
[i
] " = (mask & 1) != 0;";
328 for (i =
0; i
< n_opt_char
; i
++) {
330 print " mask = ptr->explicit_mask[" k
"];";
334 print " opts_set->x_" var_opt_char
[i
] " = (mask & 1) != 0;";
339 for (i =
0; i
< n_opt_string
; i
++) {
341 print " mask = ptr->explicit_mask[" k
"];";
345 print " opts_set->x_" var_opt_string
[i
] " = (mask & 1) ? \"\" : nullptr;";
350 print " targetm.override_options_after_change ();";
354 print "/* Print optimization options from a structure. */";
356 print "cl_optimization_print (FILE *file,";
357 print " int indent_to,";
358 print " struct cl_optimization *ptr)";
361 print " fputs (\"\\n\", file);";
362 for (i =
0; i
< n_opt_other
; i
++) {
363 print " if (ptr->x_" var_opt_other
[i
] ")";
364 print " fprintf (file, \"%*s%s (%#lx)\\n\",";
365 print " indent_to, \"\",";
366 print " \"" var_opt_other
[i
] "\",";
367 print " (unsigned long)ptr->x_" var_opt_other
[i
] ");";
371 for (i =
0; i
< n_opt_int
; i
++) {
372 print " if (ptr->x_" var_opt_int
[i
] ")";
373 print " fprintf (file, \"%*s%s (%#x)\\n\",";
374 print " indent_to, \"\",";
375 print " \"" var_opt_int
[i
] "\",";
376 print " ptr->x_" var_opt_int
[i
] ");";
380 for (i =
0; i
< n_opt_enum
; i
++) {
381 print " fprintf (file, \"%*s%s (%#x)\\n\",";
382 print " indent_to, \"\",";
383 print " \"" var_opt_enum
[i
] "\",";
384 print " (int) ptr->x_" var_opt_enum
[i
] ");";
388 for (i =
0; i
< n_opt_short
; i
++) {
389 print " if (ptr->x_" var_opt_short
[i
] ")";
390 print " fprintf (file, \"%*s%s (%#x)\\n\",";
391 print " indent_to, \"\",";
392 print " \"" var_opt_short
[i
] "\",";
393 print " ptr->x_" var_opt_short
[i
] ");";
397 for (i =
0; i
< n_opt_char
; i
++) {
398 print " if (ptr->x_" var_opt_char
[i
] ")";
399 print " fprintf (file, \"%*s%s (%#x)\\n\",";
400 print " indent_to, \"\",";
401 print " \"" var_opt_char
[i
] "\",";
402 print " ptr->x_" var_opt_char
[i
] ");";
406 for (i =
0; i
< n_opt_string
; i
++) {
407 print " if (ptr->x_" var_opt_string
[i
] ")";
408 print " fprintf (file, \"%*s%s (%s)\\n\",";
409 print " indent_to, \"\",";
410 print " \"" var_opt_string
[i
] "\",";
411 print " ptr->x_" var_opt_string
[i
] ");";
418 print "/* Print different optimization variables from structures provided as arguments. */";
420 print "cl_optimization_print_diff (FILE *file,";
421 print " int indent_to,";
422 print " struct cl_optimization *ptr1,";
423 print " struct cl_optimization *ptr2)";
426 print " fputs (\"\\n\", file);";
427 for (i =
0; i
< n_opt_other
; i
++) {
428 print " if (ptr1->x_" var_opt_other
[i
] " != ptr2->x_" var_opt_other
[i
] ")";
429 print " fprintf (file, \"%*s%s (%#lx/%#lx)\\n\",";
430 print " indent_to, \"\",";
431 print " \"" var_opt_other
[i
] "\",";
432 print " (unsigned long)ptr1->x_" var_opt_other
[i
] ",";
433 print " (unsigned long)ptr2->x_" var_opt_other
[i
] ");";
437 for (i =
0; i
< n_opt_int
; i
++) {
438 print " if (ptr1->x_" var_opt_int
[i
] " != ptr2->x_" var_opt_int
[i
] ")";
439 print " fprintf (file, \"%*s%s (%#x/%#x)\\n\",";
440 print " indent_to, \"\",";
441 print " \"" var_opt_int
[i
] "\",";
442 print " ptr1->x_" var_opt_int
[i
] ",";
443 print " ptr2->x_" var_opt_int
[i
] ");";
447 for (i =
0; i
< n_opt_enum
; i
++) {
448 print " if (ptr1->x_" var_opt_enum
[i
] " != ptr2->x_" var_opt_enum
[i
] ")";
449 print " fprintf (file, \"%*s%s (%#x/%#x)\\n\",";
450 print " indent_to, \"\",";
451 print " \"" var_opt_enum
[i
] "\",";
452 print " (int) ptr1->x_" var_opt_enum
[i
] ",";
453 print " (int) ptr2->x_" var_opt_enum
[i
] ");";
457 for (i =
0; i
< n_opt_short
; i
++) {
458 print " if (ptr1->x_" var_opt_short
[i
] " != ptr2->x_" var_opt_short
[i
] ")";
459 print " fprintf (file, \"%*s%s (%#x/%#x)\\n\",";
460 print " indent_to, \"\",";
461 print " \"" var_opt_short
[i
] "\",";
462 print " ptr1->x_" var_opt_short
[i
] ",";
463 print " ptr2->x_" var_opt_short
[i
] ");";
467 for (i =
0; i
< n_opt_char
; i
++) {
468 print " if (ptr1->x_" var_opt_char
[i
] " != ptr2->x_" var_opt_char
[i
] ")";
469 print " fprintf (file, \"%*s%s (%#x/%#x)\\n\",";
470 print " indent_to, \"\",";
471 print " \"" var_opt_char
[i
] "\",";
472 print " ptr1->x_" var_opt_char
[i
] ",";
473 print " ptr2->x_" var_opt_char
[i
] ");";
477 for (i =
0; i
< n_opt_string
; i
++) {
478 name = var_opt_string
[i
]
479 print " if (ptr1->x_" name
" != ptr2->x_" name
"";
480 print " && (!ptr1->x_" name
" || !ptr2->x_" name
481 print " || strcmp (ptr1->x_" name
", ptr2->x_" name
")))";
482 print " fprintf (file, \"%*s%s (%s/%s)\\n\",";
483 print " indent_to, \"\",";
484 print " \"" name
"\",";
485 print " ptr1->x_" name
" ? ptr1->x_" name
" : \"(null)\",";
486 print " ptr2->x_" name
" ? ptr2->x_" name
" : \"(null)\");";
494 print "/* Save selected option variables into a structure. */"
496 print "cl_target_option_save (struct cl_target_option *ptr, struct gcc_options *opts,";
497 print " struct gcc_options *opts_set)";
508 for (i =
0; i
< n_opts
; i
++) {
509 if (flag_set_p
("Save", flags
[i
])) {
510 name = var_name
(flags
[i
])
512 name =
"target_flags";
514 if(name in var_save_seen
)
517 var_save_seen
[name
]++;
518 otype = var_type_struct
(flags
[i
])
519 if (opt_args
("Mask", flags
[i
]) != "" \
520 || opt_args
("InverseMask", flags
[i
]))
521 var_target_explicit_mask
[name
] =
1;
523 if (otype ~
"^((un)?signed +)?int *$")
524 var_target_int
[n_target_int
++] = name
;
526 else if (otype ~
"^((un)?signed +)?short *$")
527 var_target_short
[n_target_short
++] = name
;
529 else if (otype ~
("^enum +[_" alnum
"]+ *$")) {
530 var_target_enum_type
[n_target_enum
] = otype
;
531 var_target_enum
[n_target_enum
++] = name
;
533 else if (otype ~
"^((un)?signed +)?char *$") {
534 var_target_char
[n_target_char
++] = name
;
535 if (otype ~
"^unsigned +char *$")
536 var_target_range
[name
] =
"0, 255"
537 else if (otype ~
"^signed +char *$")
538 var_target_range
[name
] =
"-128, 127"
539 if (otype == var_type
(flags
[i
]))
540 var_target_range
[name
] =
""
542 else if (otype ~
"^const char \\**$") {
543 var_target_string
[n_target_string
++] = name
;
544 string_options_names
[name
]++
547 var_target_other
[n_target_other
++] = name
;
551 var_target_int
[n_target_int
++] =
"target_flags";
552 var_target_explicit_mask
["target_flags"] =
1;
556 for (i =
0; i
< n_target_char
; i
++) {
557 name = var_target_char
[i
];
558 if (var_target_range
[name
] != "") {
560 print " gcc_assert (IN_RANGE (opts->x_" name
", " var_target_range
[name
] "));";
567 print " if (targetm.target_option.save)";
568 print " targetm.target_option.save (ptr, opts, opts_set);";
571 for (i =
0; i
< n_extra_target_vars
; i
++) {
572 print " ptr->x_" extra_target_vars
[i
] " = opts->x_" extra_target_vars
[i
] ";";
575 for (i =
0; i
< n_target_other
; i
++) {
576 print " ptr->x_" var_target_other
[i
] " = opts->x_" var_target_other
[i
] ";";
579 for (i =
0; i
< n_target_enum
; i
++) {
580 print " ptr->x_" var_target_enum
[i
] " = opts->x_" var_target_enum
[i
] ";";
583 for (i =
0; i
< n_target_int
; i
++) {
584 print " ptr->x_" var_target_int
[i
] " = opts->x_" var_target_int
[i
] ";";
587 for (i =
0; i
< n_target_short
; i
++) {
588 print " ptr->x_" var_target_short
[i
] " = opts->x_" var_target_short
[i
] ";";
591 for (i =
0; i
< n_target_char
; i
++) {
592 print " ptr->x_" var_target_char
[i
] " = opts->x_" var_target_char
[i
] ";";
595 for (i =
0; i
< n_target_string
; i
++) {
596 print " ptr->x_" var_target_string
[i
] " = opts->x_" var_target_string
[i
] ";";
603 for (i =
0; i
< n_extra_target_vars
; i
++) {
604 if (j ==
0 && k ==
0) {
605 print " unsigned HOST_WIDE_INT mask = 0;";
607 print " if (opts_set->x_" extra_target_vars
[i
] ") mask |= HOST_WIDE_INT_1U << " j
";";
610 print " ptr->explicit_mask[" k
"] = mask;";
617 for (i =
0; i
< n_target_other
; i
++) {
618 if (var_target_other
[i
] in var_target_explicit_mask
) {
619 print " ptr->explicit_mask_" var_target_other
[i
] " = opts_set->x_" var_target_other
[i
] ";";
622 if (j ==
0 && k ==
0) {
623 print " unsigned HOST_WIDE_INT mask = 0;";
625 print " if (opts_set->x_" var_target_other
[i
] ") mask |= HOST_WIDE_INT_1U << " j
";";
628 print " ptr->explicit_mask[" k
"] = mask;";
635 for (i =
0; i
< n_target_enum
; i
++) {
636 if (j ==
0 && k ==
0) {
637 print " unsigned HOST_WIDE_INT mask = 0;";
639 print " if (opts_set->x_" var_target_enum
[i
] ") mask |= HOST_WIDE_INT_1U << " j
";";
642 print " ptr->explicit_mask[" k
"] = mask;";
649 for (i =
0; i
< n_target_int
; i
++) {
650 if (var_target_int
[i
] in var_target_explicit_mask
) {
651 print " ptr->explicit_mask_" var_target_int
[i
] " = opts_set->x_" var_target_int
[i
] ";";
654 if (j ==
0 && k ==
0) {
655 print " unsigned HOST_WIDE_INT mask = 0;";
657 print " if (opts_set->x_" var_target_int
[i
] ") mask |= HOST_WIDE_INT_1U << " j
";";
660 print " ptr->explicit_mask[" k
"] = mask;";
667 for (i =
0; i
< n_target_short
; i
++) {
668 if (j ==
0 && k ==
0) {
669 print " unsigned HOST_WIDE_INT mask = 0;";
671 print " if (opts_set->x_" var_target_short
[i
] ") mask |= HOST_WIDE_INT_1U << " j
";";
674 print " ptr->explicit_mask[" k
"] = mask;";
681 for (i =
0; i
< n_target_char
; i
++) {
682 if (j ==
0 && k ==
0) {
683 print " unsigned HOST_WIDE_INT mask = 0;";
685 print " if (opts_set->x_" var_target_char
[i
] ") mask |= HOST_WIDE_INT_1U << " j
";";
688 print " ptr->explicit_mask[" k
"] = mask;";
695 for (i =
0; i
< n_target_string
; i
++) {
696 if (j ==
0 && k ==
0) {
697 print " unsigned HOST_WIDE_INT mask = 0;";
699 print " if (opts_set->x_" var_target_string
[i
] ") mask |= HOST_WIDE_INT_1U << " j
";";
702 print " ptr->explicit_mask[" k
"] = mask;";
710 print " ptr->explicit_mask[" k
"] = mask;";
712 has_target_explicit_mask =
0;
713 if (j
!= 0 || k
!= 0) {
714 has_target_explicit_mask =
1;
720 print "/* Restore selected current options from a structure. */";
722 print "cl_target_option_restore (struct gcc_options *opts, struct gcc_options *opts_set,";
723 print " struct cl_target_option *ptr)";
726 for (i =
0; i
< n_extra_target_vars
; i
++) {
727 print " opts->x_" extra_target_vars
[i
] " = ptr->x_" extra_target_vars
[i
] ";";
730 for (i =
0; i
< n_target_other
; i
++) {
731 print " opts->x_" var_target_other
[i
] " = ptr->x_" var_target_other
[i
] ";";
734 for (i =
0; i
< n_target_enum
; i
++) {
735 print " opts->x_" var_target_enum
[i
] " = ptr->x_" var_target_enum
[i
] ";";
738 for (i =
0; i
< n_target_int
; i
++) {
739 print " opts->x_" var_target_int
[i
] " = ptr->x_" var_target_int
[i
] ";";
742 for (i =
0; i
< n_target_short
; i
++) {
743 print " opts->x_" var_target_short
[i
] " = ptr->x_" var_target_short
[i
] ";";
746 for (i =
0; i
< n_target_char
; i
++) {
747 print " opts->x_" var_target_char
[i
] " = ptr->x_" var_target_char
[i
] ";";
750 for (i =
0; i
< n_target_string
; i
++) {
751 print " opts->x_" var_target_string
[i
] " = ptr->x_" var_target_string
[i
] ";";
755 if (has_target_explicit_mask
) {
756 print " unsigned HOST_WIDE_INT mask;";
761 for (i =
0; i
< n_extra_target_vars
; i
++) {
763 print " mask = ptr->explicit_mask[" k
"];";
767 if (extra_target_var_types
[i
] ~
("^enum +[_" alnum
"]+ *$")) {
768 print " opts_set->x_" extra_target_vars
[i
] " = static_cast<" extra_target_var_types
[i
] ">((mask & 1) != 0);";
770 else if (extra_target_var_types
[i
] ~
"^const char \\**$") {
771 print " opts_set->x_" extra_target_vars
[i
] " = (mask & 1) ? \"\" : nullptr;";
774 print " opts_set->x_" extra_target_vars
[i
] " = (mask & 1) != 0;";
780 for (i =
0; i
< n_target_other
; i
++) {
781 if (var_target_other
[i
] in var_target_explicit_mask
) {
782 print " opts_set->x_" var_target_other
[i
] " = ptr->explicit_mask_" var_target_other
[i
] ";";
786 print " mask = ptr->explicit_mask[" k
"];";
790 print " opts_set->x_" var_target_other
[i
] " = (mask & 1) != 0;";
795 for (i =
0; i
< n_target_enum
; i
++) {
797 print " mask = ptr->explicit_mask[" k
"];";
801 print " opts_set->x_" var_target_enum
[i
] " = static_cast<" var_target_enum_type
[i
] ">((mask & 1) != 0);";
806 for (i =
0; i
< n_target_int
; i
++) {
807 if (var_target_int
[i
] in var_target_explicit_mask
) {
808 print " opts_set->x_" var_target_int
[i
] " = ptr->explicit_mask_" var_target_int
[i
] ";";
812 print " mask = ptr->explicit_mask[" k
"];";
816 print " opts_set->x_" var_target_int
[i
] " = (mask & 1) != 0;";
821 for (i =
0; i
< n_target_short
; i
++) {
823 print " mask = ptr->explicit_mask[" k
"];";
827 print " opts_set->x_" var_target_short
[i
] " = (mask & 1) != 0;";
832 for (i =
0; i
< n_target_char
; i
++) {
834 print " mask = ptr->explicit_mask[" k
"];";
838 print " opts_set->x_" var_target_char
[i
] " = (mask & 1) != 0;";
843 for (i =
0; i
< n_target_string
; i
++) {
845 print " mask = ptr->explicit_mask[" k
"];";
849 print " opts_set->x_" var_target_string
[i
] " = (mask & 1) ? \"\" : nullptr;";
854 # This must occur after the normal variables in case the code depends on those
857 print " if (targetm.target_option.restore)";
858 print " targetm.target_option.restore (opts, opts_set, ptr);";
863 print "/* Print optimization options from a structure. */";
865 print "cl_target_option_print (FILE *file,";
866 print " int indent,";
867 print " struct cl_target_option *ptr)";
870 print " fputs (\"\\n\", file);";
871 for (i =
0; i
< n_target_other
; i
++) {
872 print " if (ptr->x_" var_target_other
[i
] ")";
873 hwi = host_wide_int
[var_target_other
[i
]]
875 print " fprintf (file, \"%*s%s (%#\" HOST_WIDE_INT_PRINT \"x)\\n\",";
877 print " fprintf (file, \"%*s%s (%#lx)\\n\",";
878 print " indent, \"\",";
879 print " \"" var_target_other
[i
] "\",";
881 print " ptr->x_" var_target_other
[i
] ");";
883 print " (unsigned long)ptr->x_" var_target_other
[i
] ");";
887 for (i =
0; i
< n_target_enum
; i
++) {
888 print " if (ptr->x_" var_target_enum
[i
] ")";
889 print " fprintf (file, \"%*s%s (%#x)\\n\",";
890 print " indent, \"\",";
891 print " \"" var_target_enum
[i
] "\",";
892 print " ptr->x_" var_target_enum
[i
] ");";
896 for (i =
0; i
< n_target_int
; i
++) {
897 print " if (ptr->x_" var_target_int
[i
] ")";
898 print " fprintf (file, \"%*s%s (%#x)\\n\",";
899 print " indent, \"\",";
900 print " \"" var_target_int
[i
] "\",";
901 print " ptr->x_" var_target_int
[i
] ");";
905 for (i =
0; i
< n_target_short
; i
++) {
906 print " if (ptr->x_" var_target_short
[i
] ")";
907 print " fprintf (file, \"%*s%s (%#x)\\n\",";
908 print " indent, \"\",";
909 print " \"" var_target_short
[i
] "\",";
910 print " ptr->x_" var_target_short
[i
] ");";
914 for (i =
0; i
< n_target_char
; i
++) {
915 print " if (ptr->x_" var_target_char
[i
] ")";
916 print " fprintf (file, \"%*s%s (%#x)\\n\",";
917 print " indent, \"\",";
918 print " \"" var_target_char
[i
] "\",";
919 print " ptr->x_" var_target_char
[i
] ");";
923 for (i =
0; i
< n_target_string
; i
++) {
924 print " if (ptr->x_" var_target_string
[i
] ")";
925 print " fprintf (file, \"%*s%s (%s)\\n\",";
926 print " indent, \"\",";
927 print " \"" var_target_string
[i
] "\",";
928 print " ptr->x_" var_target_string
[i
] ");";
933 print " if (targetm.target_option.print)";
934 print " targetm.target_option.print (file, indent, ptr);";
938 print "/* Print different target option variables from structures provided as arguments. */";
940 print "cl_target_option_print_diff (FILE *file,";
941 print " int indent ATTRIBUTE_UNUSED,";
942 print " struct cl_target_option *ptr1 ATTRIBUTE_UNUSED,";
943 print " struct cl_target_option *ptr2 ATTRIBUTE_UNUSED)";
946 print " fputs (\"\\n\", file);";
947 for (i =
0; i
< n_target_other
; i
++) {
948 print " if (ptr1->x_" var_target_other
[i
] " != ptr2->x_" var_target_other
[i
] ")";
949 hwi = host_wide_int
[var_target_other
[i
]]
951 print " fprintf (file, \"%*s%s (%#\" HOST_WIDE_INT_PRINT \"x/%#\" HOST_WIDE_INT_PRINT \"x)\\n\",";
953 print " fprintf (file, \"%*s%s (%#lx/%#lx)\\n\",";
954 print " indent, \"\",";
955 print " \"" var_target_other
[i
] "\",";
957 print " ptr1->x_" var_target_other
[i
] ",";
958 print " ptr2->x_" var_target_other
[i
] ");";
961 print " (unsigned long)ptr1->x_" var_target_other
[i
] ",";
962 print " (unsigned long)ptr2->x_" var_target_other
[i
] ");";
967 for (i =
0; i
< n_target_enum
; i
++) {
968 print " if (ptr1->x_" var_target_enum
[i
] " != ptr2->x_" var_target_enum
[i
] ")";
969 print " fprintf (file, \"%*s%s (%#x/%#x)\\n\",";
970 print " indent, \"\",";
971 print " \"" var_target_enum
[i
] "\",";
972 print " ptr1->x_" var_target_enum
[i
] ",";
973 print " ptr2->x_" var_target_enum
[i
] ");";
977 for (i =
0; i
< n_target_int
; i
++) {
978 print " if (ptr1->x_" var_target_int
[i
] " != ptr2->x_" var_target_int
[i
] ")";
979 print " fprintf (file, \"%*s%s (%#x/%#x)\\n\",";
980 print " indent, \"\",";
981 print " \"" var_target_int
[i
] "\",";
982 print " ptr1->x_" var_target_int
[i
] ",";
983 print " ptr2->x_" var_target_int
[i
] ");";
987 for (i =
0; i
< n_target_short
; i
++) {
988 print " if (ptr1->x_" var_target_short
[i
] " != ptr2->x_" var_target_short
[i
] ")";
989 print " fprintf (file, \"%*s%s (%#x/%#x)\\n\",";
990 print " indent, \"\",";
991 print " \"" var_target_short
[i
] "\",";
992 print " ptr1->x_" var_target_short
[i
] ",";
993 print " ptr2->x_" var_target_short
[i
] ");";
997 for (i =
0; i
< n_target_char
; i
++) {
998 print " if (ptr1->x_" var_target_char
[i
] " != ptr2->x_" var_target_char
[i
] ")";
999 print " fprintf (file, \"%*s%s (%#x/%#x)\\n\",";
1000 print " indent, \"\",";
1001 print " \"" var_target_char
[i
] "\",";
1002 print " ptr1->x_" var_target_char
[i
] ",";
1003 print " ptr2->x_" var_target_char
[i
] ");";
1007 for (i =
0; i
< n_target_string
; i
++) {
1008 name = var_target_string
[i
]
1009 print " if (ptr1->x_" name
" != ptr2->x_" name
"";
1010 print " && (!ptr1->x_" name
" || !ptr2->x_" name
1011 print " || strcmp (ptr1->x_" name
", ptr2->x_" name
")))";
1012 print " fprintf (file, \"%*s%s (%s/%s)\\n\",";
1013 print " indent, \"\",";
1014 print " \"" name
"\",";
1015 print " ptr1->x_" name
" ? ptr1->x_" name
" : \"(null)\",";
1016 print " ptr2->x_" name
" ? ptr2->x_" name
" : \"(null)\");";
1023 print "/* Compare two target options */";
1025 print "cl_target_option_eq (struct cl_target_option const *ptr1 ATTRIBUTE_UNUSED,";
1026 print " struct cl_target_option const *ptr2 ATTRIBUTE_UNUSED)";
1032 for (i =
0; i
< n_target_save
; i
++) {
1033 var = target_save_decl
[i
];
1034 sub (" *=.*", "", var
);
1037 sub("^.*[ *]", "", name
)
1038 sub(" *" name
"$", "", type
)
1039 if (target_save_decl
[i
] ~
"^const char \\*+[_" alnum
"]+$") {
1040 var_target_str
[n_target_str
++] = name
;
1041 string_options_names
[name
]++
1044 if (target_save_decl
[i
] ~
" .*\\[.+\\]+$") {
1046 sub("[^\\[]+\\[", "", size
);
1047 sub("\\]$", "", size
);
1048 sub("\\[.+", "", name
)
1049 sub(" [^ ]+$", "", type
)
1050 var_target_array
[n_target_array
] = name
1051 var_target_array_type
[n_target_array
] = type
1052 var_target_array_size
[n_target_array
++] = size
1055 var_target_val_type
[n_target_val
] = type
;
1056 var_target_val
[n_target_val
++] = name
;
1061 for (i =
0; i
< n_opts
; i
++) {
1062 if (flag_set_p
("Save", flags
[i
])) {
1063 name = var_name
(flags
[i
])
1065 name =
"target_flags";
1067 if(name in var_list_seen
)
1070 var_list_seen
[name
]++;
1071 otype = var_type_struct
(flags
[i
])
1072 if (otype ~
"^const char \\**$")
1073 var_target_str
[n_target_str
++] =
"x_" name
;
1075 var_target_val_type
[n_target_val
] = otype
;
1076 var_target_val
[n_target_val
++] =
"x_" name
;
1081 var_target_val_type
[n_target_val
] =
"int";
1082 var_target_val
[n_target_val
++] =
"x_target_flags";
1085 for (i =
0; i
< n_target_str
; i
++) {
1086 name = var_target_str
[i
]
1087 print " if (ptr1->" name
" != ptr2->" name
;
1088 print " && (!ptr1->" name
" || !ptr2->" name
1089 print " || strcmp (ptr1->" name
", ptr2->" name
")))";
1090 print " return false;";
1092 for (i =
0; i
< n_target_array
; i
++) {
1093 name = var_target_array
[i
]
1094 size = var_target_array_size
[i
]
1095 type = var_target_array_type
[i
]
1096 print " if (memcmp (ptr1->" name
", ptr2->" name
", " size
" * sizeof(" type
")))"
1097 print " return false;";
1099 for (i =
0; i
< n_target_val
; i
++) {
1100 name = var_target_val
[i
]
1101 print " if (ptr1->" name
" != ptr2->" name
")";
1102 print " return false;";
1105 if (has_target_explicit_mask
) {
1106 print " for (size_t i = 0; i < ARRAY_SIZE (ptr1->explicit_mask); i++)";
1107 print " if (ptr1->explicit_mask[i] != ptr2->explicit_mask[i])";
1108 print " return false;"
1111 for (i =
0; i
< n_target_other
; i
++) {
1112 if (var_target_other
[i
] in var_target_explicit_mask
) {
1113 print " if (ptr1->explicit_mask_" var_target_other
[i
] " != ptr2->explicit_mask_" var_target_other
[i
] ")";
1114 print " return false;";
1118 for (i =
0; i
< n_target_int
; i
++) {
1119 if (var_target_int
[i
] in var_target_explicit_mask
) {
1120 print " if (ptr1->explicit_mask_" var_target_int
[i
] " != ptr2->explicit_mask_" var_target_int
[i
] ")";
1121 print " return false;";
1125 print " return true;";
1130 print "/* Hash target options */";
1132 print "cl_target_option_hash (struct cl_target_option const *ptr ATTRIBUTE_UNUSED)";
1134 print " inchash::hash hstate;";
1135 for (i =
0; i
< n_target_str
; i
++) {
1136 name = var_target_str
[i
]
1137 print " if (ptr->" name
")";
1138 print " hstate.add (ptr->" name
", strlen (ptr->" name
"));";
1140 print " hstate.add_int (0);";
1142 for (i =
0; i
< n_target_array
; i
++) {
1143 name= var_target_array
[i
]
1144 size = var_target_array_size
[i
]
1145 type = var_target_array_type
[i
]
1146 print " hstate.add_int (" size
");";
1147 print " hstate.add (ptr->" name
", sizeof (" type
") * " size
");";
1149 for (i =
0; i
< n_target_val
; i
++) {
1150 name = var_target_val
[i
]
1151 print " hstate.add_hwi (ptr->" name
");";
1153 if (has_target_explicit_mask
) {
1154 print " for (size_t i = 0; i < ARRAY_SIZE (ptr->explicit_mask); i++)";
1155 print " hstate.add_hwi (ptr->explicit_mask[i]);";
1158 for (i =
0; i
< n_target_other
; i
++) {
1159 if (var_target_other
[i
] in var_target_explicit_mask
)
1160 print " hstate.add_hwi (ptr->explicit_mask_" var_target_other
[i
] ");";
1163 for (i =
0; i
< n_target_int
; i
++) {
1164 if (var_target_int
[i
] in var_target_explicit_mask
)
1165 print " hstate.add_hwi (ptr->explicit_mask_" var_target_int
[i
] ");";
1168 print " return hstate.end ();";
1172 print "/* Stream out target options */";
1174 print "cl_target_option_stream_out (struct output_block *ob ATTRIBUTE_UNUSED,";
1175 print " struct bitpack_d *bp ATTRIBUTE_UNUSED,";
1176 print " struct cl_target_option *ptr ATTRIBUTE_UNUSED)";
1178 for (i =
0; i
< n_target_str
; i
++) {
1179 name = var_target_str
[i
]
1180 print " bp_pack_string (ob, bp, ptr->" name
", true);";
1182 for (i =
0; i
< n_target_array
; i
++) {
1183 name = var_target_array
[i
]
1184 size = var_target_array_size
[i
]
1185 print " for (unsigned i = 0; i < " size
"; i++)"
1186 print " bp_pack_value (bp, ptr->" name
"[i], 64);";
1188 for (i =
0; i
< n_target_val
; i
++) {
1189 name = var_target_val
[i
]
1190 print " bp_pack_value (bp, ptr->" name
", 64);";
1193 if (has_target_explicit_mask
) {
1194 print " for (size_t i = 0; i < ARRAY_SIZE (ptr->explicit_mask); i++)";
1195 print " bp_pack_value (bp, ptr->explicit_mask[i], 64);";
1198 for (i =
0; i
< n_target_other
; i
++) {
1199 if (var_target_other
[i
] in var_target_explicit_mask
) {
1200 print " bp_pack_value (bp, ptr->explicit_mask_" var_target_other
[i
] ", 64);";
1204 for (i =
0; i
< n_target_int
; i
++) {
1205 if (var_target_int
[i
] in var_target_explicit_mask
) {
1206 print " bp_pack_value (bp, ptr->explicit_mask_" var_target_int
[i
] ", 64);";
1213 print "/* Stream in target options */";
1215 print "cl_target_option_stream_in (struct data_in *data_in ATTRIBUTE_UNUSED,";
1216 print " struct bitpack_d *bp ATTRIBUTE_UNUSED,";
1217 print " struct cl_target_option *ptr ATTRIBUTE_UNUSED)";
1219 for (i =
0; i
< n_target_str
; i
++) {
1220 name = var_target_str
[i
]
1221 print " ptr->" name
" = bp_unpack_string (data_in, bp);";
1222 print " if (ptr->" name
")";
1223 print " ptr->" name
" = xstrdup (ptr->" name
");";
1225 for (i =
0; i
< n_target_array
; i
++) {
1226 name = var_target_array
[i
]
1227 size = var_target_array_size
[i
]
1228 print " for (int i = " size
" - 1; i >= 0; i--)"
1229 print " ptr->" name
"[i] = (" var_target_array_type
[i
] ") bp_unpack_value (bp, 64);";
1231 for (i =
0; i
< n_target_val
; i
++) {
1232 name = var_target_val
[i
]
1233 print " ptr->" name
" = (" var_target_val_type
[i
] ") bp_unpack_value (bp, 64);";
1236 if (has_target_explicit_mask
) {
1237 print " for (size_t i = 0; i < ARRAY_SIZE (ptr->explicit_mask); i++)";
1238 print " ptr->explicit_mask[i] = bp_unpack_value (bp, 64);";
1241 for (i =
0; i
< n_target_other
; i
++) {
1242 if (var_target_other
[i
] in var_target_explicit_mask
) {
1243 print " ptr->explicit_mask_" var_target_other
[i
] " = bp_unpack_value (bp, 64);";
1247 for (i =
0; i
< n_target_int
; i
++) {
1248 if (var_target_int
[i
] in var_target_explicit_mask
) {
1249 print " ptr->explicit_mask_" var_target_int
[i
] " = bp_unpack_value (bp, 64);";
1255 print "/* free heap memory used by target options */";
1257 print "cl_target_option_free (struct cl_target_option *ptr ATTRIBUTE_UNUSED)";
1259 for (i =
0; i
< n_target_str
; i
++) {
1260 name = var_target_str
[i
]
1261 print " if (ptr->" name
")";
1262 print " free (const_cast <char *>(ptr->" name
"));";
1267 var_opt_val
[0] =
"x_optimize"
1268 var_opt_val_type
[0] =
"char "
1269 var_opt_hash
[0] =
1;
1270 var_opt_val
[1] =
"x_optimize_size"
1271 var_opt_val_type
[1] =
"char "
1272 var_opt_hash
[1] =
1;
1273 var_opt_val
[2] =
"x_optimize_debug"
1274 var_opt_val_type
[2] =
"char "
1275 var_opt_hash
[2] =
1;
1276 var_opt_val
[3] =
"x_optimize_fast"
1277 var_opt_val_type
[3] =
"char "
1278 var_opt_hash
[3] =
1;
1279 for (i =
0; i
< n_opts
; i
++) {
1280 if (flag_set_p
("(Optimization|PerFunction)", flags
[i
])) {
1281 name = var_name
(flags
[i
])
1285 if(name in var_opt_list_seen
)
1288 var_opt_list_seen
[name
]++;
1290 otype = var_type_struct
(flags
[i
])
1291 var_opt_val_type
[n_opt_val
] = otype
;
1292 var_opt_val
[n_opt_val
] =
"x_" name
;
1293 var_opt_hash
[n_opt_val
] = flag_set_p
("Optimization", flags
[i
]);
1295 # If applicable, optimize streaming for the common case that
1296 # the current value is unchanged from the 'Init' value:
1297 # XOR-encode it so that we stream value zero.
1298 # Not handling non-parameters as those really generally don't
1299 # have large initializers.
1300 # Not handling enums as we don't know if '(enum ...) 10' is
1301 # even valid (see synthesized 'if' conditionals below).
1302 if (flag_set_p
("Param", flags
[i
]) \
1303 && !
(otype ~
"^enum ")) {
1304 # Those without 'Init' are zero-initialized and thus
1305 # already encoded ideally.
1306 init = opt_args
("Init", flags
[i
])
1307 var_opt_optimize_init
[n_opt_val
] = init
;
1314 print "/* Hash optimization options */";
1316 print "cl_optimization_hash (struct cl_optimization const *ptr ATTRIBUTE_UNUSED)";
1318 print " inchash::hash hstate;";
1319 for (i =
0; i
< n_opt_val
; i
++) {
1320 if (!var_opt_hash
[i
])
1322 name = var_opt_val
[i
]
1323 otype = var_opt_val_type
[i
];
1324 if (otype ~
"^const char \\**$")
1326 print " if (ptr->" name
")";
1327 print " hstate.add (ptr->" name
", strlen (ptr->" name
"));";
1329 print " hstate.add_int (0);";
1332 print " hstate.add_hwi (ptr->" name
");";
1334 print " for (size_t i = 0; i < ARRAY_SIZE (ptr->explicit_mask); i++)";
1335 print " hstate.add_hwi (ptr->explicit_mask[i]);";
1336 print " return hstate.end ();";
1340 print "/* Compare two optimization options */";
1342 print "cl_optimization_option_eq (cl_optimization const *ptr1,";
1343 print " cl_optimization const *ptr2)";
1345 for (i =
0; i
< n_opt_val
; i
++) {
1346 if (!var_opt_hash
[i
])
1348 name = var_opt_val
[i
]
1349 otype = var_opt_val_type
[i
];
1350 if (otype ~
"^const char \\**$")
1352 print " if (ptr1->" name
" != ptr2->" name
;
1353 print " && (!ptr1->" name
" || !ptr2->" name
1354 print " || strcmp (ptr1->" name
", ptr2->" name
")))";
1355 print " return false;";
1359 print " if (ptr1->" name
" != ptr2->" name
")";
1360 print " return false;";
1363 print " for (size_t i = 0; i < ARRAY_SIZE (ptr1->explicit_mask); i++)";
1364 print " if (ptr1->explicit_mask[i] != ptr2->explicit_mask[i])";
1365 print " return false;"
1366 print " return true;";
1370 print "/* Stream out optimization options */";
1372 print "cl_optimization_stream_out (struct output_block *ob,";
1373 print " struct bitpack_d *bp,";
1374 print " struct cl_optimization *ptr)";
1376 for (i =
0; i
< n_opt_val
; i
++) {
1377 name = var_opt_val
[i
]
1378 otype = var_opt_val_type
[i
];
1379 if (otype ~
"^const char \\**$")
1380 print " bp_pack_string (ob, bp, ptr->" name
", true);";
1382 if (otype ~
"^unsigned") {
1387 # If applicable, encode the streamed value.
1388 if (var_opt_optimize_init
[i
]) {
1389 print " if (" var_opt_optimize_init
[i
] " > (" var_opt_val_type
[i
] ") 10)";
1390 print " bp_pack_var_len_" sgn
" (bp, ptr->" name
" ^ " var_opt_optimize_init
[i
] ");";
1392 print " bp_pack_var_len_" sgn
" (bp, ptr->" name
");";
1394 print " bp_pack_var_len_" sgn
" (bp, ptr->" name
");";
1398 print " for (size_t i = 0; i < ARRAY_SIZE (ptr->explicit_mask); i++)";
1399 print " bp_pack_value (bp, ptr->explicit_mask[i], 64);";
1403 print "/* Stream in optimization options */";
1405 print "cl_optimization_stream_in (struct data_in *data_in ATTRIBUTE_UNUSED,";
1406 print " struct bitpack_d *bp ATTRIBUTE_UNUSED,";
1407 print " struct cl_optimization *ptr ATTRIBUTE_UNUSED)";
1409 for (i =
0; i
< n_opt_val
; i
++) {
1410 name = var_opt_val
[i
]
1411 otype = var_opt_val_type
[i
];
1412 if (otype ~
"^const char \\**$") {
1413 print " ptr->" name
" = bp_unpack_string (data_in, bp);";
1414 print " if (ptr->" name
")";
1415 print " ptr->" name
" = xstrdup (ptr->" name
");";
1418 if (otype ~
"^unsigned") {
1423 print " ptr->" name
" = (" var_opt_val_type
[i
] ") bp_unpack_var_len_" sgn
" (bp);";
1424 # If applicable, decode the streamed value.
1425 if (var_opt_optimize_init
[i
]) {
1426 print " if (" var_opt_optimize_init
[i
] " > (" var_opt_val_type
[i
] ") 10)";
1427 print " ptr->" name
" ^= " var_opt_optimize_init
[i
] ";";
1431 print " for (size_t i = 0; i < ARRAY_SIZE (ptr->explicit_mask); i++)";
1432 print " ptr->explicit_mask[i] = bp_unpack_value (bp, 64);";
1434 print "/* Free heap memory used by optimization options */";
1436 print "cl_optimization_option_free (struct cl_optimization *ptr ATTRIBUTE_UNUSED)";
1438 for (i =
0; i
< n_opt_val
; i
++) {
1439 name = var_opt_val
[i
]
1440 otype = var_opt_val_type
[i
];
1441 if (otype ~
"^const char \\**$")
1443 print " if (ptr->" name
")";
1444 print " free (const_cast <char *>(ptr->" name
"));";
1450 print "cl_optimization_compare (gcc_options *ptr1, gcc_options *ptr2)"
1453 # all these options are mentioned in PR92860
1454 checked_options
["flag_merge_constants"]++
1455 checked_options
["param_max_fields_for_field_sensitive"]++
1456 checked_options
["flag_omit_frame_pointer"]++
1458 checked_options
["TARGET_ALIGN_CALL"]++
1459 checked_options
["TARGET_CASE_VECTOR_PC_RELATIVE"]++
1460 checked_options
["arc_size_opt_level"]++
1462 checked_options
["arm_fp16_format"]++
1465 for (i =
0; i
< n_opts
; i
++) {
1466 name = var_name
(flags
[i
]);
1470 if (name in checked_options
)
1472 checked_options
[name
]++
1474 if (name in string_options_names
|| ("x_" name
) in string_options_names
) {
1475 print " if (ptr1->x_" name
" != ptr2->x_" name
"";
1476 print " && (!ptr1->x_" name
" || !ptr2->x_" name
1477 print " || strcmp (ptr1->x_" name
", ptr2->x_" name
")))";
1478 print " internal_error (\"%<global_options%> are modified in local context\");";
1481 print " if (ptr1->x_" name
" != ptr2->x_" name
")"
1482 print " internal_error (\"%<global_options%> are modified in local context\");";