Mercurial > hg > CbC > CbC_gcc
comparison gcc/targhooks.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 /* Default target hook functions. | 1 /* Default target hook functions. |
2 Copyright (C) 2003-2018 Free Software Foundation, Inc. | 2 Copyright (C) 2003-2020 Free Software Foundation, Inc. |
3 | 3 |
4 This file is part of GCC. | 4 This file is part of GCC. |
5 | 5 |
6 GCC is free software; you can redistribute it and/or modify it under | 6 GCC is free software; you can redistribute it and/or modify it under |
7 the terms of the GNU General Public License as published by the Free | 7 the terms of the GNU General Public License as published by the Free |
77 #include "reload.h" | 77 #include "reload.h" |
78 #include "intl.h" | 78 #include "intl.h" |
79 #include "opts.h" | 79 #include "opts.h" |
80 #include "gimplify.h" | 80 #include "gimplify.h" |
81 #include "predict.h" | 81 #include "predict.h" |
82 #include "params.h" | |
83 #include "real.h" | 82 #include "real.h" |
84 #include "langhooks.h" | 83 #include "langhooks.h" |
85 #include "sbitmap.h" | 84 #include "sbitmap.h" |
85 #include "function-abi.h" | |
86 | 86 |
87 bool | 87 bool |
88 default_legitimate_address_p (machine_mode mode ATTRIBUTE_UNUSED, | 88 default_legitimate_address_p (machine_mode mode ATTRIBUTE_UNUSED, |
89 rtx addr ATTRIBUTE_UNUSED, | 89 rtx addr ATTRIBUTE_UNUSED, |
90 bool strict ATTRIBUTE_UNUSED) | 90 bool strict ATTRIBUTE_UNUSED) |
186 } | 186 } |
187 | 187 |
188 rtx | 188 rtx |
189 default_expand_builtin_saveregs (void) | 189 default_expand_builtin_saveregs (void) |
190 { | 190 { |
191 error ("__builtin_saveregs not supported by this target"); | 191 error ("%<__builtin_saveregs%> not supported by this target"); |
192 return const0_rtx; | 192 return const0_rtx; |
193 } | 193 } |
194 | 194 |
195 void | 195 void |
196 default_setup_incoming_varargs (cumulative_args_t ca ATTRIBUTE_UNUSED, | 196 default_setup_incoming_varargs (cumulative_args_t, |
197 machine_mode mode ATTRIBUTE_UNUSED, | 197 const function_arg_info &, int *, int) |
198 tree type ATTRIBUTE_UNUSED, | |
199 int *pretend_arg_size ATTRIBUTE_UNUSED, | |
200 int second_time ATTRIBUTE_UNUSED) | |
201 { | 198 { |
202 } | 199 } |
203 | 200 |
204 /* The default implementation of TARGET_BUILTIN_SETJMP_FRAME_VALUE. */ | 201 /* The default implementation of TARGET_BUILTIN_SETJMP_FRAME_VALUE. */ |
205 | 202 |
321 | 318 |
322 /* Return true if a parameter must be passed by reference. This version | 319 /* Return true if a parameter must be passed by reference. This version |
323 of the TARGET_PASS_BY_REFERENCE hook uses just MUST_PASS_IN_STACK. */ | 320 of the TARGET_PASS_BY_REFERENCE hook uses just MUST_PASS_IN_STACK. */ |
324 | 321 |
325 bool | 322 bool |
326 hook_pass_by_reference_must_pass_in_stack (cumulative_args_t c ATTRIBUTE_UNUSED, | 323 hook_pass_by_reference_must_pass_in_stack (cumulative_args_t, |
327 machine_mode mode ATTRIBUTE_UNUSED, const_tree type ATTRIBUTE_UNUSED, | 324 const function_arg_info &arg) |
328 bool named_arg ATTRIBUTE_UNUSED) | 325 { |
329 { | 326 return targetm.calls.must_pass_in_stack (arg); |
330 return targetm.calls.must_pass_in_stack (mode, type); | |
331 } | 327 } |
332 | 328 |
333 /* Return true if a parameter follows callee copies conventions. This | 329 /* Return true if a parameter follows callee copies conventions. This |
334 version of the hook is true for all named arguments. */ | 330 version of the hook is true for all named arguments. */ |
335 | 331 |
336 bool | 332 bool |
337 hook_callee_copies_named (cumulative_args_t ca ATTRIBUTE_UNUSED, | 333 hook_callee_copies_named (cumulative_args_t, const function_arg_info &arg) |
338 machine_mode mode ATTRIBUTE_UNUSED, | 334 { |
339 const_tree type ATTRIBUTE_UNUSED, bool named) | 335 return arg.named; |
340 { | |
341 return named; | |
342 } | 336 } |
343 | 337 |
344 /* Emit to STREAM the assembler syntax for insn operand X. */ | 338 /* Emit to STREAM the assembler syntax for insn operand X. */ |
345 | 339 |
346 void | 340 void |
641 default_has_ifunc_p (void) | 635 default_has_ifunc_p (void) |
642 { | 636 { |
643 return HAVE_GNU_INDIRECT_FUNCTION; | 637 return HAVE_GNU_INDIRECT_FUNCTION; |
644 } | 638 } |
645 | 639 |
640 /* Return true if we predict the loop LOOP will be transformed to a | |
641 low-overhead loop, otherwise return false. | |
642 | |
643 By default, false is returned, as this hook's applicability should be | |
644 verified for each target. Target maintainers should re-define the hook | |
645 if the target can take advantage of it. */ | |
646 | |
647 bool | |
648 default_predict_doloop_p (class loop *loop ATTRIBUTE_UNUSED) | |
649 { | |
650 return false; | |
651 } | |
652 | |
646 /* NULL if INSN insn is valid within a low-overhead loop, otherwise returns | 653 /* NULL if INSN insn is valid within a low-overhead loop, otherwise returns |
647 an error message. | 654 an error message. |
648 | 655 |
649 This function checks whether a given INSN is valid within a low-overhead | 656 This function checks whether a given INSN is valid within a low-overhead |
650 loop. If INSN is invalid it returns the reason for that, otherwise it | 657 loop. If INSN is invalid it returns the reason for that, otherwise it |
675 | 682 |
676 /* Mapping of target builtin functions to vectorized variants. */ | 683 /* Mapping of target builtin functions to vectorized variants. */ |
677 | 684 |
678 tree | 685 tree |
679 default_builtin_md_vectorized_function (tree, tree, tree) | 686 default_builtin_md_vectorized_function (tree, tree, tree) |
680 { | |
681 return NULL_TREE; | |
682 } | |
683 | |
684 /* Vectorized conversion. */ | |
685 | |
686 tree | |
687 default_builtin_vectorized_conversion (unsigned int code ATTRIBUTE_UNUSED, | |
688 tree dest_type ATTRIBUTE_UNUSED, | |
689 tree src_type ATTRIBUTE_UNUSED) | |
690 { | 687 { |
691 return NULL_TREE; | 688 return NULL_TREE; |
692 } | 689 } |
693 | 690 |
694 /* Default vectorizer cost model values. */ | 691 /* Default vectorizer cost model values. */ |
735 { | 732 { |
736 return NULL_TREE; | 733 return NULL_TREE; |
737 } | 734 } |
738 | 735 |
739 bool | 736 bool |
740 hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false ( | 737 hook_bool_CUMULATIVE_ARGS_arg_info_false (cumulative_args_t, |
741 cumulative_args_t ca ATTRIBUTE_UNUSED, | 738 const function_arg_info &) |
742 machine_mode mode ATTRIBUTE_UNUSED, | |
743 const_tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED) | |
744 { | 739 { |
745 return false; | 740 return false; |
746 } | 741 } |
747 | 742 |
748 bool | 743 bool |
749 hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true ( | 744 hook_bool_CUMULATIVE_ARGS_arg_info_true (cumulative_args_t, |
750 cumulative_args_t ca ATTRIBUTE_UNUSED, | 745 const function_arg_info &) |
751 machine_mode mode ATTRIBUTE_UNUSED, | |
752 const_tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED) | |
753 { | 746 { |
754 return true; | 747 return true; |
755 } | 748 } |
756 | 749 |
757 int | 750 int |
758 hook_int_CUMULATIVE_ARGS_mode_tree_bool_0 ( | 751 hook_int_CUMULATIVE_ARGS_arg_info_0 (cumulative_args_t, |
759 cumulative_args_t ca ATTRIBUTE_UNUSED, | 752 const function_arg_info &) |
760 machine_mode mode ATTRIBUTE_UNUSED, | |
761 tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED) | |
762 { | 753 { |
763 return 0; | 754 return 0; |
764 } | 755 } |
765 | 756 |
766 void | 757 void |
768 tree ATTRIBUTE_UNUSED) | 759 tree ATTRIBUTE_UNUSED) |
769 { | 760 { |
770 } | 761 } |
771 | 762 |
772 void | 763 void |
773 default_function_arg_advance (cumulative_args_t ca ATTRIBUTE_UNUSED, | 764 default_function_arg_advance (cumulative_args_t, const function_arg_info &) |
774 machine_mode mode ATTRIBUTE_UNUSED, | |
775 const_tree type ATTRIBUTE_UNUSED, | |
776 bool named ATTRIBUTE_UNUSED) | |
777 { | 765 { |
778 gcc_unreachable (); | 766 gcc_unreachable (); |
779 } | 767 } |
780 | 768 |
781 /* Default implementation of TARGET_FUNCTION_ARG_OFFSET. */ | 769 /* Default implementation of TARGET_FUNCTION_ARG_OFFSET. */ |
812 | 800 |
813 return PAD_UPWARD; | 801 return PAD_UPWARD; |
814 } | 802 } |
815 | 803 |
816 rtx | 804 rtx |
817 default_function_arg (cumulative_args_t ca ATTRIBUTE_UNUSED, | 805 default_function_arg (cumulative_args_t, const function_arg_info &) |
818 machine_mode mode ATTRIBUTE_UNUSED, | |
819 const_tree type ATTRIBUTE_UNUSED, | |
820 bool named ATTRIBUTE_UNUSED) | |
821 { | 806 { |
822 gcc_unreachable (); | 807 gcc_unreachable (); |
823 } | 808 } |
824 | 809 |
825 rtx | 810 rtx |
826 default_function_incoming_arg (cumulative_args_t ca ATTRIBUTE_UNUSED, | 811 default_function_incoming_arg (cumulative_args_t, const function_arg_info &) |
827 machine_mode mode ATTRIBUTE_UNUSED, | |
828 const_tree type ATTRIBUTE_UNUSED, | |
829 bool named ATTRIBUTE_UNUSED) | |
830 { | 812 { |
831 gcc_unreachable (); | 813 gcc_unreachable (); |
832 } | 814 } |
833 | 815 |
834 unsigned int | 816 unsigned int |
1057 | 1039 |
1058 poly_int64 | 1040 poly_int64 |
1059 default_return_pops_args (tree, tree, poly_int64) | 1041 default_return_pops_args (tree, tree, poly_int64) |
1060 { | 1042 { |
1061 return 0; | 1043 return 0; |
1062 } | |
1063 | |
1064 reg_class_t | |
1065 default_branch_target_register_class (void) | |
1066 { | |
1067 return NO_REGS; | |
1068 } | 1044 } |
1069 | 1045 |
1070 reg_class_t | 1046 reg_class_t |
1071 default_ira_change_pseudo_allocno_class (int regno ATTRIBUTE_UNUSED, | 1047 default_ira_change_pseudo_allocno_class (int regno ATTRIBUTE_UNUSED, |
1072 reg_class_t cl, | 1048 reg_class_t cl, |
1245 if (TREE_CODE (exp) == STRING_CST) | 1221 if (TREE_CODE (exp) == STRING_CST) |
1246 return MAX (align, BITS_PER_WORD); | 1222 return MAX (align, BITS_PER_WORD); |
1247 return align; | 1223 return align; |
1248 } | 1224 } |
1249 | 1225 |
1250 /* Default to natural alignment for vector types. */ | 1226 /* Default to natural alignment for vector types, bounded by |
1227 MAX_OFILE_ALIGNMENT. */ | |
1228 | |
1251 HOST_WIDE_INT | 1229 HOST_WIDE_INT |
1252 default_vector_alignment (const_tree type) | 1230 default_vector_alignment (const_tree type) |
1253 { | 1231 { |
1254 HOST_WIDE_INT align = tree_to_shwi (TYPE_SIZE (type)); | 1232 unsigned HOST_WIDE_INT align = MAX_OFILE_ALIGNMENT; |
1255 if (align > MAX_OFILE_ALIGNMENT) | 1233 tree size = TYPE_SIZE (type); |
1256 align = MAX_OFILE_ALIGNMENT; | 1234 if (tree_fits_uhwi_p (size)) |
1257 return align; | 1235 align = tree_to_uhwi (size); |
1236 | |
1237 return align < MAX_OFILE_ALIGNMENT ? align : MAX_OFILE_ALIGNMENT; | |
1258 } | 1238 } |
1259 | 1239 |
1260 /* The default implementation of | 1240 /* The default implementation of |
1261 TARGET_VECTORIZE_PREFERRED_VECTOR_ALIGNMENT. */ | 1241 TARGET_VECTORIZE_PREFERRED_VECTOR_ALIGNMENT. */ |
1262 | 1242 |
1263 HOST_WIDE_INT | 1243 poly_uint64 |
1264 default_preferred_vector_alignment (const_tree type) | 1244 default_preferred_vector_alignment (const_tree type) |
1265 { | 1245 { |
1266 return TYPE_ALIGN (type); | 1246 return TYPE_ALIGN (type); |
1267 } | 1247 } |
1268 | 1248 |
1306 default_split_reduction (machine_mode mode) | 1286 default_split_reduction (machine_mode mode) |
1307 { | 1287 { |
1308 return mode; | 1288 return mode; |
1309 } | 1289 } |
1310 | 1290 |
1311 /* By default only the size derived from the preferred vector mode | 1291 /* By default only the preferred vector mode is tried. */ |
1312 is tried. */ | 1292 |
1313 | 1293 unsigned int |
1314 void | 1294 default_autovectorize_vector_modes (vector_modes *, bool) |
1315 default_autovectorize_vector_sizes (vector_sizes *) | 1295 { |
1316 { | 1296 return 0; |
1297 } | |
1298 | |
1299 /* The default implementation of TARGET_VECTORIZE_RELATED_MODE. */ | |
1300 | |
1301 opt_machine_mode | |
1302 default_vectorize_related_mode (machine_mode vector_mode, | |
1303 scalar_mode element_mode, | |
1304 poly_uint64 nunits) | |
1305 { | |
1306 machine_mode result_mode; | |
1307 if ((maybe_ne (nunits, 0U) | |
1308 || multiple_p (GET_MODE_SIZE (vector_mode), | |
1309 GET_MODE_SIZE (element_mode), &nunits)) | |
1310 && mode_for_vector (element_mode, nunits).exists (&result_mode) | |
1311 && VECTOR_MODE_P (result_mode) | |
1312 && targetm.vector_mode_supported_p (result_mode)) | |
1313 return result_mode; | |
1314 | |
1315 return opt_machine_mode (); | |
1317 } | 1316 } |
1318 | 1317 |
1319 /* By default a vector of integers is used as a mask. */ | 1318 /* By default a vector of integers is used as a mask. */ |
1320 | 1319 |
1321 opt_machine_mode | 1320 opt_machine_mode |
1322 default_get_mask_mode (poly_uint64 nunits, poly_uint64 vector_size) | 1321 default_get_mask_mode (machine_mode mode) |
1323 { | 1322 { |
1324 unsigned int elem_size = vector_element_size (vector_size, nunits); | 1323 return related_int_vector_mode (mode); |
1325 scalar_int_mode elem_mode | |
1326 = smallest_int_mode_for_size (elem_size * BITS_PER_UNIT); | |
1327 machine_mode vector_mode; | |
1328 | |
1329 gcc_assert (known_eq (elem_size * nunits, vector_size)); | |
1330 | |
1331 if (mode_for_vector (elem_mode, nunits).exists (&vector_mode) | |
1332 && VECTOR_MODE_P (vector_mode) | |
1333 && targetm.vector_mode_supported_p (vector_mode)) | |
1334 return vector_mode; | |
1335 | |
1336 return opt_machine_mode (); | |
1337 } | 1324 } |
1338 | 1325 |
1339 /* By default consider masked stores to be expensive. */ | 1326 /* By default consider masked stores to be expensive. */ |
1340 | 1327 |
1341 bool | 1328 bool |
1347 /* By default, the cost model accumulates three separate costs (prologue, | 1334 /* By default, the cost model accumulates three separate costs (prologue, |
1348 loop body, and epilogue) for a vectorized loop or block. So allocate an | 1335 loop body, and epilogue) for a vectorized loop or block. So allocate an |
1349 array of three unsigned ints, set it to zero, and return its address. */ | 1336 array of three unsigned ints, set it to zero, and return its address. */ |
1350 | 1337 |
1351 void * | 1338 void * |
1352 default_init_cost (struct loop *loop_info ATTRIBUTE_UNUSED) | 1339 default_init_cost (class loop *loop_info ATTRIBUTE_UNUSED) |
1353 { | 1340 { |
1354 unsigned *cost = XNEWVEC (unsigned, 3); | 1341 unsigned *cost = XNEWVEC (unsigned, 3); |
1355 cost[vect_prologue] = cost[vect_body] = cost[vect_epilogue] = 0; | 1342 cost[vect_prologue] = cost[vect_body] = cost[vect_epilogue] = 0; |
1356 return cost; | 1343 return cost; |
1357 } | 1344 } |
1360 kind and mode, multiplies it by the occurrence count, accumulates | 1347 kind and mode, multiplies it by the occurrence count, accumulates |
1361 it into the cost specified by WHERE, and returns the cost added. */ | 1348 it into the cost specified by WHERE, and returns the cost added. */ |
1362 | 1349 |
1363 unsigned | 1350 unsigned |
1364 default_add_stmt_cost (void *data, int count, enum vect_cost_for_stmt kind, | 1351 default_add_stmt_cost (void *data, int count, enum vect_cost_for_stmt kind, |
1365 struct _stmt_vec_info *stmt_info, int misalign, | 1352 class _stmt_vec_info *stmt_info, int misalign, |
1366 enum vect_cost_model_location where) | 1353 enum vect_cost_model_location where) |
1367 { | 1354 { |
1368 unsigned *cost = (unsigned *) data; | 1355 unsigned *cost = (unsigned *) data; |
1369 unsigned retval = 0; | 1356 unsigned retval = 0; |
1370 | 1357 |
1422 pointer to int. We assume that accesses to errno are | 1409 pointer to int. We assume that accesses to errno are |
1423 not deliberately obfuscated (even in conforming ways). */ | 1410 not deliberately obfuscated (even in conforming ways). */ |
1424 if (TYPE_UNSIGNED (TREE_TYPE (base)) | 1411 if (TYPE_UNSIGNED (TREE_TYPE (base)) |
1425 || TYPE_MODE (TREE_TYPE (base)) != TYPE_MODE (integer_type_node)) | 1412 || TYPE_MODE (TREE_TYPE (base)) != TYPE_MODE (integer_type_node)) |
1426 return false; | 1413 return false; |
1427 /* The default implementation assumes an errno location | 1414 /* The default implementation assumes an errno location declaration |
1428 declaration is never defined in the current compilation unit. */ | 1415 is never defined in the current compilation unit and may not be |
1416 aliased by a local variable. */ | |
1429 if (DECL_P (base) | 1417 if (DECL_P (base) |
1418 && DECL_EXTERNAL (base) | |
1430 && !TREE_STATIC (base)) | 1419 && !TREE_STATIC (base)) |
1431 return true; | 1420 return true; |
1432 else if (TREE_CODE (base) == MEM_REF | 1421 else if (TREE_CODE (base) == MEM_REF |
1433 && TREE_CODE (TREE_OPERAND (base, 0)) == SSA_NAME) | 1422 && TREE_CODE (TREE_OPERAND (base, 0)) == SSA_NAME) |
1434 { | 1423 { |
1594 /* If args is NULL the caller is handle_pragma_pop_options (). In that case, | 1583 /* If args is NULL the caller is handle_pragma_pop_options (). In that case, |
1595 emit no warning because "#pragma GCC pop_target" is valid on targets that | 1584 emit no warning because "#pragma GCC pop_target" is valid on targets that |
1596 do not have the "target" pragma. */ | 1585 do not have the "target" pragma. */ |
1597 if (args) | 1586 if (args) |
1598 warning (OPT_Wpragmas, | 1587 warning (OPT_Wpragmas, |
1599 "#pragma GCC target is not supported for this machine"); | 1588 "%<#pragma GCC target%> is not supported for this machine"); |
1600 | 1589 |
1601 return false; | 1590 return false; |
1602 } | 1591 } |
1603 | 1592 |
1604 bool | 1593 bool |
1645 return true; | 1634 return true; |
1646 | 1635 |
1647 return false; | 1636 return false; |
1648 } | 1637 } |
1649 | 1638 |
1639 /* By default assume that libc has not a fast implementation. */ | |
1640 | |
1641 bool | |
1642 default_libc_has_fast_function (int fcode ATTRIBUTE_UNUSED) | |
1643 { | |
1644 return false; | |
1645 } | |
1646 | |
1650 bool | 1647 bool |
1651 gnu_libc_has_function (enum function_class fn_class ATTRIBUTE_UNUSED) | 1648 gnu_libc_has_function (enum function_class fn_class ATTRIBUTE_UNUSED) |
1652 { | 1649 { |
1653 return true; | 1650 return true; |
1654 } | 1651 } |
1719 { | 1716 { |
1720 unsigned int move_ratio; | 1717 unsigned int move_ratio; |
1721 #ifdef MOVE_RATIO | 1718 #ifdef MOVE_RATIO |
1722 move_ratio = (unsigned int) MOVE_RATIO (speed_p); | 1719 move_ratio = (unsigned int) MOVE_RATIO (speed_p); |
1723 #else | 1720 #else |
1724 #if defined (HAVE_movmemqi) || defined (HAVE_movmemhi) || defined (HAVE_movmemsi) || defined (HAVE_movmemdi) || defined (HAVE_movmemti) | 1721 #if defined (HAVE_cpymemqi) || defined (HAVE_cpymemhi) || defined (HAVE_cpymemsi) || defined (HAVE_cpymemdi) || defined (HAVE_cpymemti) |
1725 move_ratio = 2; | 1722 move_ratio = 2; |
1726 #else /* No movmem patterns, pick a default. */ | 1723 #else /* No cpymem patterns, pick a default. */ |
1727 move_ratio = ((speed_p) ? 15 : 3); | 1724 move_ratio = ((speed_p) ? 15 : 3); |
1728 #endif | 1725 #endif |
1729 #endif | 1726 #endif |
1730 return move_ratio; | 1727 return move_ratio; |
1731 } | 1728 } |
1732 | 1729 |
1733 /* Return TRUE if the move_by_pieces/set_by_pieces infrastructure should be | 1730 /* Return TRUE if the move_by_pieces/set_by_pieces infrastructure should be |
1734 used; return FALSE if the movmem/setmem optab should be expanded, or | 1731 used; return FALSE if the cpymem/setmem optab should be expanded, or |
1735 a call to memcpy emitted. */ | 1732 a call to memcpy emitted. */ |
1736 | 1733 |
1737 bool | 1734 bool |
1738 default_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT size, | 1735 default_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT size, |
1739 unsigned int alignment, | 1736 unsigned int alignment, |
1805 if (record_p && targetm_common.have_named_sections) | 1802 if (record_p && targetm_common.have_named_sections) |
1806 { | 1803 { |
1807 char buf[256]; | 1804 char buf[256]; |
1808 static int patch_area_number; | 1805 static int patch_area_number; |
1809 section *previous_section = in_section; | 1806 section *previous_section = in_section; |
1810 | 1807 const char *asm_op = integer_asm_op (POINTER_SIZE_UNITS, false); |
1808 | |
1809 gcc_assert (asm_op != NULL); | |
1811 patch_area_number++; | 1810 patch_area_number++; |
1812 ASM_GENERATE_INTERNAL_LABEL (buf, "LPFE", patch_area_number); | 1811 ASM_GENERATE_INTERNAL_LABEL (buf, "LPFE", patch_area_number); |
1813 | 1812 |
1814 switch_to_section (get_section ("__patchable_function_entries", | 1813 switch_to_section (get_section ("__patchable_function_entries", |
1815 0, NULL)); | 1814 SECTION_WRITE | SECTION_RELRO, NULL)); |
1816 fputs (integer_asm_op (POINTER_SIZE_UNITS, false), file); | 1815 assemble_align (POINTER_SIZE); |
1816 fputs (asm_op, file); | |
1817 assemble_name_raw (file, buf); | 1817 assemble_name_raw (file, buf); |
1818 fputc ('\n', file); | 1818 fputc ('\n', file); |
1819 | 1819 |
1820 switch_to_section (previous_section); | 1820 switch_to_section (previous_section); |
1821 ASM_OUTPUT_LABEL (file, buf); | 1821 ASM_OUTPUT_LABEL (file, buf); |
1822 } | 1822 } |
1823 | 1823 |
1824 unsigned i; | 1824 unsigned i; |
1825 for (i = 0; i < patch_area_size; ++i) | 1825 for (i = 0; i < patch_area_size; ++i) |
1826 fprintf (file, "\t%s\n", nop_templ); | 1826 output_asm_insn (nop_templ, NULL); |
1827 } | 1827 } |
1828 | 1828 |
1829 bool | 1829 bool |
1830 default_profile_before_prologue (void) | 1830 default_profile_before_prologue (void) |
1831 { | 1831 { |
1926 machine_mode | 1926 machine_mode |
1927 default_dwarf_frame_reg_mode (int regno) | 1927 default_dwarf_frame_reg_mode (int regno) |
1928 { | 1928 { |
1929 machine_mode save_mode = reg_raw_mode[regno]; | 1929 machine_mode save_mode = reg_raw_mode[regno]; |
1930 | 1930 |
1931 if (targetm.hard_regno_call_part_clobbered (regno, save_mode)) | 1931 if (targetm.hard_regno_call_part_clobbered (eh_edge_abi.id (), |
1932 save_mode = choose_hard_reg_mode (regno, 1, true); | 1932 regno, save_mode)) |
1933 save_mode = choose_hard_reg_mode (regno, 1, &eh_edge_abi); | |
1933 return save_mode; | 1934 return save_mode; |
1934 } | 1935 } |
1935 | 1936 |
1936 /* To be used by targets where reg_raw_mode doesn't return the right | 1937 /* To be used by targets where reg_raw_mode doesn't return the right |
1937 mode for registers used in apply_builtin_return and apply_builtin_arg. */ | 1938 mode for registers used in apply_builtin_return and apply_builtin_arg. */ |
2027 const char *data = (const char *)data_p; | 2028 const char *data = (const char *)data_p; |
2028 size_t i; | 2029 size_t i; |
2029 | 2030 |
2030 /* -fpic and -fpie also usually make a PCH invalid. */ | 2031 /* -fpic and -fpie also usually make a PCH invalid. */ |
2031 if (data[0] != flag_pic) | 2032 if (data[0] != flag_pic) |
2032 return _("created and used with different settings of -fpic"); | 2033 return _("created and used with different settings of %<-fpic%>"); |
2033 if (data[1] != flag_pie) | 2034 if (data[1] != flag_pie) |
2034 return _("created and used with different settings of -fpie"); | 2035 return _("created and used with different settings of %<-fpie%>"); |
2035 data += 2; | 2036 data += 2; |
2036 | 2037 |
2037 /* Check target_flags. */ | 2038 /* Check target_flags. */ |
2038 if (targetm.check_pch_target_flags) | 2039 if (targetm.check_pch_target_flags) |
2039 { | 2040 { |
2148 As of 2004, there are only 3 ARGS_GROW_DOWNWARD targets, and they all | 2149 As of 2004, there are only 3 ARGS_GROW_DOWNWARD targets, and they all |
2149 implement their own specialized gimplify_va_arg_expr routines. */ | 2150 implement their own specialized gimplify_va_arg_expr routines. */ |
2150 if (ARGS_GROW_DOWNWARD) | 2151 if (ARGS_GROW_DOWNWARD) |
2151 gcc_unreachable (); | 2152 gcc_unreachable (); |
2152 | 2153 |
2153 indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false); | 2154 indirect = pass_va_arg_by_reference (type); |
2154 if (indirect) | 2155 if (indirect) |
2155 type = build_pointer_type (type); | 2156 type = build_pointer_type (type); |
2156 | 2157 |
2157 if (targetm.calls.split_complex_arg | 2158 if (targetm.calls.split_complex_arg |
2158 && TREE_CODE (type) == COMPLEX_TYPE | 2159 && TREE_CODE (type) == COMPLEX_TYPE |
2160 { | 2161 { |
2161 tree real_part, imag_part; | 2162 tree real_part, imag_part; |
2162 | 2163 |
2163 real_part = std_gimplify_va_arg_expr (valist, | 2164 real_part = std_gimplify_va_arg_expr (valist, |
2164 TREE_TYPE (type), pre_p, NULL); | 2165 TREE_TYPE (type), pre_p, NULL); |
2165 real_part = get_initialized_tmp_var (real_part, pre_p, NULL); | 2166 real_part = get_initialized_tmp_var (real_part, pre_p); |
2166 | 2167 |
2167 imag_part = std_gimplify_va_arg_expr (unshare_expr (valist), | 2168 imag_part = std_gimplify_va_arg_expr (unshare_expr (valist), |
2168 TREE_TYPE (type), pre_p, NULL); | 2169 TREE_TYPE (type), pre_p, NULL); |
2169 imag_part = get_initialized_tmp_var (imag_part, pre_p, NULL); | 2170 imag_part = get_initialized_tmp_var (imag_part, pre_p); |
2170 | 2171 |
2171 return build2 (COMPLEX_EXPR, type, real_part, imag_part); | 2172 return build2 (COMPLEX_EXPR, type, real_part, imag_part); |
2172 } | 2173 } |
2173 | 2174 |
2174 align = PARM_BOUNDARY / BITS_PER_UNIT; | 2175 align = PARM_BOUNDARY / BITS_PER_UNIT; |
2182 boundary = MAX_SUPPORTED_STACK_ALIGNMENT; | 2183 boundary = MAX_SUPPORTED_STACK_ALIGNMENT; |
2183 | 2184 |
2184 boundary /= BITS_PER_UNIT; | 2185 boundary /= BITS_PER_UNIT; |
2185 | 2186 |
2186 /* Hoist the valist value into a temporary for the moment. */ | 2187 /* Hoist the valist value into a temporary for the moment. */ |
2187 valist_tmp = get_initialized_tmp_var (valist, pre_p, NULL); | 2188 valist_tmp = get_initialized_tmp_var (valist, pre_p); |
2188 | 2189 |
2189 /* va_list pointer is aligned to PARM_BOUNDARY. If argument actually | 2190 /* va_list pointer is aligned to PARM_BOUNDARY. If argument actually |
2190 requires greater alignment, we must perform dynamic alignment. */ | 2191 requires greater alignment, we must perform dynamic alignment. */ |
2191 if (boundary > align | 2192 if (boundary > align |
2192 && !TYPE_EMPTY_P (type) | 2193 && !TYPE_EMPTY_P (type) |
2245 addr = build_va_arg_indirect_ref (addr); | 2246 addr = build_va_arg_indirect_ref (addr); |
2246 | 2247 |
2247 return build_va_arg_indirect_ref (addr); | 2248 return build_va_arg_indirect_ref (addr); |
2248 } | 2249 } |
2249 | 2250 |
2250 void | |
2251 default_setup_incoming_vararg_bounds (cumulative_args_t ca ATTRIBUTE_UNUSED, | |
2252 machine_mode mode ATTRIBUTE_UNUSED, | |
2253 tree type ATTRIBUTE_UNUSED, | |
2254 int *pretend_arg_size ATTRIBUTE_UNUSED, | |
2255 int second_time ATTRIBUTE_UNUSED) | |
2256 { | |
2257 } | |
2258 | |
2259 /* An implementation of TARGET_CAN_USE_DOLOOP_P for targets that do | 2251 /* An implementation of TARGET_CAN_USE_DOLOOP_P for targets that do |
2260 not support nested low-overhead loops. */ | 2252 not support nested low-overhead loops. */ |
2261 | 2253 |
2262 bool | 2254 bool |
2263 can_use_doloop_if_innermost (const widest_int &, const widest_int &, | 2255 can_use_doloop_if_innermost (const widest_int &, const widest_int &, |
2279 unsigned int | 2271 unsigned int |
2280 default_max_noce_ifcvt_seq_cost (edge e) | 2272 default_max_noce_ifcvt_seq_cost (edge e) |
2281 { | 2273 { |
2282 bool predictable_p = predictable_edge_p (e); | 2274 bool predictable_p = predictable_edge_p (e); |
2283 | 2275 |
2284 enum compiler_param param | 2276 if (predictable_p) |
2285 = (predictable_p | 2277 { |
2286 ? PARAM_MAX_RTL_IF_CONVERSION_PREDICTABLE_COST | 2278 if (global_options_set.x_param_max_rtl_if_conversion_predictable_cost) |
2287 : PARAM_MAX_RTL_IF_CONVERSION_UNPREDICTABLE_COST); | 2279 return param_max_rtl_if_conversion_predictable_cost; |
2288 | 2280 } |
2289 /* If we have a parameter set, use that, otherwise take a guess using | |
2290 BRANCH_COST. */ | |
2291 if (global_options_set.x_param_values[param]) | |
2292 return PARAM_VALUE (param); | |
2293 else | 2281 else |
2294 return BRANCH_COST (true, predictable_p) * COSTS_N_INSNS (3); | 2282 { |
2283 if (global_options_set.x_param_max_rtl_if_conversion_unpredictable_cost) | |
2284 return param_max_rtl_if_conversion_unpredictable_cost; | |
2285 } | |
2286 | |
2287 return BRANCH_COST (true, predictable_p) * COSTS_N_INSNS (3); | |
2295 } | 2288 } |
2296 | 2289 |
2297 /* Default implementation of TARGET_MIN_ARITHMETIC_PRECISION. */ | 2290 /* Default implementation of TARGET_MIN_ARITHMETIC_PRECISION. */ |
2298 | 2291 |
2299 unsigned int | 2292 unsigned int |