1 # Copyright (C) 2003-2021 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.c
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, 1";
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
" ? ptr1->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 (ptr1->" name
" != ptr2->" name
"";
1097 print " || memcmp (ptr1->" name
", ptr2->" name
", " size
" * sizeof(" type
")))"
1098 print " return false;";
1100 for (i =
0; i
< n_target_val
; i
++) {
1101 name = var_target_val
[i
]
1102 print " if (ptr1->" name
" != ptr2->" name
")";
1103 print " return false;";
1106 if (has_target_explicit_mask
) {
1107 print " for (size_t i = 0; i < sizeof (ptr1->explicit_mask) / sizeof (ptr1->explicit_mask[0]); i++)";
1108 print " if (ptr1->explicit_mask[i] != ptr2->explicit_mask[i])";
1109 print " return false;"
1112 for (i =
0; i
< n_target_other
; i
++) {
1113 if (var_target_other
[i
] in var_target_explicit_mask
) {
1114 print " if (ptr1->explicit_mask_" var_target_other
[i
] " != ptr2->explicit_mask_" var_target_other
[i
] ")";
1115 print " return false;";
1119 for (i =
0; i
< n_target_int
; i
++) {
1120 if (var_target_int
[i
] in var_target_explicit_mask
) {
1121 print " if (ptr1->explicit_mask_" var_target_int
[i
] " != ptr2->explicit_mask_" var_target_int
[i
] ")";
1122 print " return false;";
1126 print " return true;";
1131 print "/* Hash target options */";
1133 print "cl_target_option_hash (struct cl_target_option const *ptr ATTRIBUTE_UNUSED)";
1135 print " inchash::hash hstate;";
1136 for (i =
0; i
< n_target_str
; i
++) {
1137 name = var_target_str
[i
]
1138 print " if (ptr->" name
")";
1139 print " hstate.add (ptr->" name
", strlen (ptr->" name
"));";
1141 print " hstate.add_int (0);";
1143 for (i =
0; i
< n_target_array
; i
++) {
1144 name= var_target_array
[i
]
1145 size = var_target_array_size
[i
]
1146 type = var_target_array_type
[i
]
1147 print " hstate.add_int (" size
");";
1148 print " hstate.add (ptr->" name
", sizeof (" type
") * " size
");";
1150 for (i =
0; i
< n_target_val
; i
++) {
1151 name = var_target_val
[i
]
1152 print " hstate.add_hwi (ptr->" name
");";
1154 if (has_target_explicit_mask
) {
1155 print " for (size_t i = 0; i < sizeof (ptr->explicit_mask) / sizeof (ptr->explicit_mask[0]); i++)";
1156 print " hstate.add_hwi (ptr->explicit_mask[i]);";
1159 for (i =
0; i
< n_target_other
; i
++) {
1160 if (var_target_other
[i
] in var_target_explicit_mask
)
1161 print " hstate.add_hwi (ptr->explicit_mask_" var_target_other
[i
] ");";
1164 for (i =
0; i
< n_target_int
; i
++) {
1165 if (var_target_int
[i
] in var_target_explicit_mask
)
1166 print " hstate.add_hwi (ptr->explicit_mask_" var_target_int
[i
] ");";
1169 print " return hstate.end ();";
1173 print "/* Stream out target options */";
1175 print "cl_target_option_stream_out (struct output_block *ob ATTRIBUTE_UNUSED,";
1176 print " struct bitpack_d *bp ATTRIBUTE_UNUSED,";
1177 print " struct cl_target_option *ptr ATTRIBUTE_UNUSED)";
1179 for (i =
0; i
< n_target_str
; i
++) {
1180 name = var_target_str
[i
]
1181 print " bp_pack_string (ob, bp, ptr->" name
", true);";
1183 for (i =
0; i
< n_target_array
; i
++) {
1184 name = var_target_array
[i
]
1185 size = var_target_array_size
[i
]
1186 print " for (unsigned i = 0; i < " size
"; i++)"
1187 print " bp_pack_value (bp, ptr->" name
"[i], 64);";
1189 for (i =
0; i
< n_target_val
; i
++) {
1190 name = var_target_val
[i
]
1191 print " bp_pack_value (bp, ptr->" name
", 64);";
1194 if (has_target_explicit_mask
) {
1195 print " for (size_t i = 0; i < sizeof (ptr->explicit_mask) / sizeof (ptr->explicit_mask[0]); i++)";
1196 print " bp_pack_value (bp, ptr->explicit_mask[i], 64);";
1199 for (i =
0; i
< n_target_other
; i
++) {
1200 if (var_target_other
[i
] in var_target_explicit_mask
) {
1201 print " bp_pack_value (bp, ptr->explicit_mask_" var_target_other
[i
] ", 64);";
1205 for (i =
0; i
< n_target_int
; i
++) {
1206 if (var_target_int
[i
] in var_target_explicit_mask
) {
1207 print " bp_pack_value (bp, ptr->explicit_mask_" var_target_int
[i
] ", 64);";
1214 print "/* Stream in target options */";
1216 print "cl_target_option_stream_in (struct data_in *data_in ATTRIBUTE_UNUSED,";
1217 print " struct bitpack_d *bp ATTRIBUTE_UNUSED,";
1218 print " struct cl_target_option *ptr ATTRIBUTE_UNUSED)";
1220 for (i =
0; i
< n_target_str
; i
++) {
1221 name = var_target_str
[i
]
1222 print " ptr->" name
" = bp_unpack_string (data_in, bp);";
1223 print " if (ptr->" name
")";
1224 print " ptr->" name
" = xstrdup (ptr->" name
");";
1226 for (i =
0; i
< n_target_array
; i
++) {
1227 name = var_target_array
[i
]
1228 size = var_target_array_size
[i
]
1229 print " for (int i = " size
" - 1; i >= 0; i--)"
1230 print " ptr->" name
"[i] = (" var_target_array_type
[i
] ") bp_unpack_value (bp, 64);";
1232 for (i =
0; i
< n_target_val
; i
++) {
1233 name = var_target_val
[i
]
1234 print " ptr->" name
" = (" var_target_val_type
[i
] ") bp_unpack_value (bp, 64);";
1237 if (has_target_explicit_mask
) {
1238 print " for (size_t i = 0; i < sizeof (ptr->explicit_mask) / sizeof (ptr->explicit_mask[0]); i++)";
1239 print " ptr->explicit_mask[i] = bp_unpack_value (bp, 64);";
1242 for (i =
0; i
< n_target_other
; i
++) {
1243 if (var_target_other
[i
] in var_target_explicit_mask
) {
1244 print " ptr->explicit_mask_" var_target_other
[i
] " = bp_unpack_value (bp, 64);";
1248 for (i =
0; i
< n_target_int
; i
++) {
1249 if (var_target_int
[i
] in var_target_explicit_mask
) {
1250 print " ptr->explicit_mask_" var_target_int
[i
] " = bp_unpack_value (bp, 64);";
1256 print "/* free heap memory used by target options */";
1258 print "cl_target_option_free (struct cl_target_option *ptr ATTRIBUTE_UNUSED)";
1260 for (i =
0; i
< n_target_str
; i
++) {
1261 name = var_target_str
[i
]
1262 print " if (ptr->" name
")";
1263 print " free (const_cast <char *>(ptr->" name
"));";
1268 var_opt_val
[0] =
"x_optimize"
1269 var_opt_val_type
[0] =
"char "
1270 var_opt_hash
[0] =
1;
1271 var_opt_val
[1] =
"x_optimize_size"
1272 var_opt_val_type
[1] =
"char "
1273 var_opt_hash
[1] =
1;
1274 var_opt_val
[2] =
"x_optimize_debug"
1275 var_opt_val_type
[2] =
"char "
1276 var_opt_hash
[2] =
1;
1277 var_opt_val
[3] =
"x_optimize_fast"
1278 var_opt_val_type
[3] =
"char "
1279 var_opt_hash
[3] =
1;
1280 for (i =
0; i
< n_opts
; i
++) {
1281 if (flag_set_p
("(Optimization|PerFunction)", flags
[i
])) {
1282 name = var_name
(flags
[i
])
1286 if(name in var_opt_list_seen
)
1289 var_opt_list_seen
[name
]++;
1291 otype = var_type_struct
(flags
[i
])
1292 var_opt_val_type
[n_opt_val
] = otype
;
1293 var_opt_val
[n_opt_val
] =
"x_" name
;
1294 var_opt_hash
[n_opt_val
] = flag_set_p
("Optimization", flags
[i
]);
1295 var_opt_init
[n_opt_val
] = opt_args
("Init", flags
[i
]);
1300 print "/* Hash optimization options */";
1302 print "cl_optimization_hash (struct cl_optimization const *ptr ATTRIBUTE_UNUSED)";
1304 print " inchash::hash hstate;";
1305 for (i =
0; i
< n_opt_val
; i
++) {
1306 if (!var_opt_hash
[i
])
1308 name = var_opt_val
[i
]
1309 otype = var_opt_val_type
[i
];
1310 if (otype ~
"^const char \\**$")
1312 print " if (ptr->" name
")";
1313 print " hstate.add (ptr->" name
", strlen (ptr->" name
"));";
1315 print " hstate.add_int (0);";
1318 print " hstate.add_hwi (ptr->" name
");";
1320 print " for (size_t i = 0; i < sizeof (ptr->explicit_mask) / sizeof (ptr->explicit_mask[0]); i++)";
1321 print " hstate.add_hwi (ptr->explicit_mask[i]);";
1322 print " return hstate.end ();";
1326 print "/* Compare two optimization options */";
1328 print "cl_optimization_option_eq (cl_optimization const *ptr1,";
1329 print " cl_optimization const *ptr2)";
1331 for (i =
0; i
< n_opt_val
; i
++) {
1332 if (!var_opt_hash
[i
])
1334 name = var_opt_val
[i
]
1335 otype = var_opt_val_type
[i
];
1336 if (otype ~
"^const char \\**$")
1338 print " if (ptr1->" name
" != ptr2->" name
;
1339 print " && (!ptr1->" name
" || !ptr2->" name
1340 print " || strcmp (ptr1->" name
", ptr2->" name
")))";
1341 print " return false;";
1345 print " if (ptr1->" name
" != ptr2->" name
")";
1346 print " return false;";
1349 print " for (size_t i = 0; i < sizeof (ptr1->explicit_mask) / sizeof (ptr1->explicit_mask[0]); i++)";
1350 print " if (ptr1->explicit_mask[i] != ptr2->explicit_mask[i])";
1351 print " return false;"
1352 print " return true;";
1356 print "/* Stream out optimization options */";
1358 print "cl_optimization_stream_out (struct output_block *ob,";
1359 print " struct bitpack_d *bp,";
1360 print " struct cl_optimization *ptr)";
1362 for (i =
0; i
< n_opt_val
; i
++) {
1363 name = var_opt_val
[i
]
1364 otype = var_opt_val_type
[i
];
1365 if (otype ~
"^const char \\**$")
1366 print " bp_pack_string (ob, bp, ptr->" name
", true);";
1368 if (otype ~
"^unsigned") {
1373 if (name ~
"^x_param" && !
(otype ~
"^enum ") && var_opt_init
[i
]) {
1374 print " if (" var_opt_init
[i
] " > (" var_opt_val_type
[i
] ") 10)";
1375 print " bp_pack_var_len_" sgn
" (bp, ptr->" name
" ^ " var_opt_init
[i
] ");";
1377 print " bp_pack_var_len_" sgn
" (bp, ptr->" name
");";
1379 print " bp_pack_var_len_" sgn
" (bp, ptr->" name
");";
1383 print " for (size_t i = 0; i < sizeof (ptr->explicit_mask) / sizeof (ptr->explicit_mask[0]); i++)";
1384 print " bp_pack_value (bp, ptr->explicit_mask[i], 64);";
1388 print "/* Stream in optimization options */";
1390 print "cl_optimization_stream_in (struct data_in *data_in ATTRIBUTE_UNUSED,";
1391 print " struct bitpack_d *bp ATTRIBUTE_UNUSED,";
1392 print " struct cl_optimization *ptr ATTRIBUTE_UNUSED)";
1394 for (i =
0; i
< n_opt_val
; i
++) {
1395 name = var_opt_val
[i
]
1396 otype = var_opt_val_type
[i
];
1397 if (otype ~
"^const char \\**$") {
1398 print " ptr->" name
" = bp_unpack_string (data_in, bp);";
1399 print " if (ptr->" name
")";
1400 print " ptr->" name
" = xstrdup (ptr->" name
");";
1403 if (otype ~
"^unsigned") {
1408 print " ptr->" name
" = (" var_opt_val_type
[i
] ") bp_unpack_var_len_" sgn
" (bp);";
1409 if (name ~
"^x_param" && !
(otype ~
"^enum ") && var_opt_init
[i
]) {
1410 print " if (" var_opt_init
[i
] " > (" var_opt_val_type
[i
] ") 10)";
1411 print " ptr->" name
" ^= " var_opt_init
[i
] ";";
1415 print " for (size_t i = 0; i < sizeof (ptr->explicit_mask) / sizeof (ptr->explicit_mask[0]); i++)";
1416 print " ptr->explicit_mask[i] = bp_unpack_value (bp, 64);";
1418 print "/* Free heap memory used by optimization options */";
1420 print "cl_optimization_option_free (struct cl_optimization *ptr ATTRIBUTE_UNUSED)";
1422 for (i =
0; i
< n_opt_val
; i
++) {
1423 name = var_opt_val
[i
]
1424 otype = var_opt_val_type
[i
];
1425 if (otype ~
"^const char \\**$")
1427 print " if (ptr->" name
")";
1428 print " free (const_cast <char *>(ptr->" name
"));";
1434 print "cl_optimization_compare (gcc_options *ptr1, gcc_options *ptr2)"
1437 # all these options are mentioned in PR92860
1438 checked_options
["flag_merge_constants"]++
1439 checked_options
["param_max_fields_for_field_sensitive"]++
1440 checked_options
["flag_omit_frame_pointer"]++
1442 checked_options
["TARGET_ALIGN_CALL"]++
1443 checked_options
["TARGET_CASE_VECTOR_PC_RELATIVE"]++
1444 checked_options
["arc_size_opt_level"]++
1446 checked_options
["arm_fp16_format"]++
1449 for (i =
0; i
< n_opts
; i
++) {
1450 name = var_name
(flags
[i
]);
1454 if (name in checked_options
)
1456 checked_options
[name
]++
1458 if (name in string_options_names
|| ("x_" name
) in string_options_names
) {
1459 print " if (ptr1->x_" name
" != ptr2->x_" name
"";
1460 print " && (!ptr1->x_" name
" || !ptr2->x_" name
1461 print " || strcmp (ptr1->x_" name
", ptr2->x_" name
")))";
1462 print " internal_error (\"%<global_options%> are modified in local context\");";
1465 print " if (ptr1->x_" name
" != ptr2->x_" name
")"
1466 print " internal_error (\"%<global_options%> are modified in local context\");";