aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/pa
AgeCommit message (Collapse)AuthorFilesLines
2021-12-03pch: Add support for PCH for relocatable executables [PR71934]Jakub Jelinek1-2/+2
So, if we want to make PCH work for PIEs, I'd say we can: 1) add a new GTY option, say callback, which would act like skip for non-PCH and for PCH would make us skip it but remember for address bias translation 2) drop the skip for tree_translation_unit_decl::language 3) change get_unnamed_section to have const char * as last argument instead of const void *, change unnamed_section::data also to const char * and update everything related to that 4) maybe add a host hook whether it is ok to support binaries changing addresses (the only thing I'm worried is if some host that uses function descriptors allocates them dynamically instead of having them somewhere in the executable) 5) maybe add a gengtype warning if it sees in GTY tracked structure a function pointer without that new callback option Here is 1), 2), 3) implemented. Note, on stdc++.h.gch/O2g.gch there are just those 10 relocations without the second patch, with it a few more, but nothing huge. And for non-PIEs there isn't really any extra work on the load side except freading two scalar values and fseek. 2021-12-03 Jakub Jelinek <jakub@redhat.com> PR pch/71934 gcc/ * ggc.h (gt_pch_note_callback): Declare. * gengtype.h (enum typekind): Add TYPE_CALLBACK. (callback_type): Declare. * gengtype.c (dbgprint_count_type_at): Handle TYPE_CALLBACK. (callback_type): New variable. (process_gc_options): Add CALLBACK argument, handle callback option. (set_gc_used_type): Adjust process_gc_options caller, if callback, set type to &callback_type. (output_mangled_typename): Handle TYPE_CALLBACK. (walk_type): Likewise. Handle callback option. (write_types_process_field): Handle TYPE_CALLBACK. (write_types_local_user_process_field): Likewise. (write_types_local_process_field): Likewise. (write_root): Likewise. (dump_typekind): Likewise. (dump_type): Likewise. * gengtype-state.c (type_lineloc): Handle TYPE_CALLBACK. (state_writer::write_state_callback_type): New method. (state_writer::write_state_type): Handle TYPE_CALLBACK. (read_state_callback_type): New function. (read_state_type): Handle TYPE_CALLBACK. * ggc-common.c (callback_vec): New variable. (gt_pch_note_callback): New function. (gt_pch_save): Stream out gt_pch_save function address and relocation table. (gt_pch_restore): Stream in saved gt_pch_save function address and relocation table and apply relocations if needed. * doc/gty.texi (callback): Document new GTY option. * varasm.c (get_unnamed_section): Change callback argument's type and last argument's type from const void * to const char *. (output_section_asm_op): Change argument's type from const void * to const char *, remove unnecessary cast. * tree-core.h (struct tree_translation_unit_decl): Drop GTY((skip)) from language member. * output.h (unnamed_section_callback): Change argument type from const void * to const char *. (struct unnamed_section): Use GTY((callback)) instead of GTY((skip)) for callback member. Change data member type from const void * to const char *. (struct noswitch_section): Use GTY((callback)) instead of GTY((skip)) for callback member. (get_unnamed_section): Change callback argument's type and last argument's type from const void * to const char *. (output_section_asm_op): Change argument's type from const void * to const char *. * config/avr/avr.c (avr_output_progmem_section_asm_op): Likewise. Remove unneeded cast. * config/darwin.c (output_objc_section_asm_op): Change argument's type from const void * to const char *. * config/pa/pa.c (som_output_text_section_asm_op): Likewise. (som_output_comdat_data_section_asm_op): Likewise. * config/rs6000/rs6000.c (rs6000_elf_output_toc_section_asm_op): Likewise. (rs6000_xcoff_output_readonly_section_asm_op): Likewise. Instead of dereferencing directive hardcode variable names and decide based on whether directive is NULL or not. (rs6000_xcoff_output_readwrite_section_asm_op): Change argument's type from const void * to const char *. (rs6000_xcoff_output_tls_section_asm_op): Likewise. Instead of dereferencing directive hardcode variable names and decide based on whether directive is NULL or not. (rs6000_xcoff_output_toc_section_asm_op): Change argument's type from const void * to const char *. (rs6000_xcoff_asm_init_sections): Adjust get_unnamed_section callers. gcc/c-family/ * c-pch.c (struct c_pch_validity): Remove pch_init member. (pch_init): Don't initialize v.pch_init. (c_common_valid_pch): Don't warn and punt if .text addresses change. libcpp/ * include/line-map.h (class line_maps): Add GTY((callback)) to reallocator and round_alloc_size members.
2021-11-05Support TI mode and soft float on PA64John David Anglin4-13/+180
This change implements TI mode on PA64. Various new patterns are added to pa.md. The libgcc build needed modification to build both DI and TI routines. We also need various softfp routines to convert to and from TImode. I added full softfp for the -msoft-float option. At the moment, this doesn't completely eliminate all use of the floating-point co-processor. For this, libgcc needs to be built with -msoft-mult. The floating-point exception support also needs a soft option. 2021-11-05 John David Anglin <danglin@gcc.gnu.org> PR libgomp/96661 gcc/ChangeLog: * config/pa/pa-modes.def: Add OImode integer type. * config/pa/pa.c (pa_scalar_mode_supported_p): Allow TImode for TARGET_64BIT. * config/pa/pa.h (MIN_UNITS_PER_WORD) Define to MIN_UNITS_PER_WORD to UNITS_PER_WORD if IN_LIBGCC2. * config/pa/pa.md (addti3, addvti3, subti3, subvti3, negti2, negvti2, ashlti3, shrpd_internal): New patterns. Change some multi instruction types to multi. libgcc/ChangeLog: * config.host (hppa*64*-*-linux*): Revise tmake_file. (hppa*64*-*-hpux11*): Likewise. * config/pa/sfp-exceptions.c: New. * config/pa/sfp-machine.h: New. * config/pa/t-dimode: New. * config/pa/t-softfp-sfdftf: New.
2021-11-05Move PREFERRED_DEBUGGING_TYPE define in pa64-hpux.h to pa.hJohn David Anglin2-1/+3
This fixes D language build on hppa64-hpux11. 2021-11-05 John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog: * config/pa/pa.h (PREFERRED_DEBUGGING_TYPE): Define to DWARF2_DEBUG. * config/pa/pa64-hpux.h (PREFERRED_DEBUGGING_TYPE): Remove define.
2021-10-24Revise -mdisable-fpregs option and add new -msoft-mult optionJohn David Anglin5-20/+23
The behavior of the -mdisable-fpregs is confusing in that it doesn't disable the use of the floating-point registers in all situations. The -msoft-float disables the use of the floating-point registers in all situations. The Linux kernel only needs to disable use of the xmpyu instruction to avoid using the floating-point registers. This change revises the -mdisable-fpregs option to disable the use of the floating-point registers in all situations. It is now equivalent to the -msoft-float option. A new -msoft-mult option is added to disable use of the xmpyu instruction. The libgcc library can be compiled with the -msoft-mult option to avoid using hardware integer multiplication. 2021-10-24 John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog: * config/pa/pa-d.c (pa_d_handle_target_float_abi): Don't check TARGET_DISABLE_FPREGS. * config/pa/pa.c (fix_range): Use MASK_SOFT_FLOAT instead of MASK_DISABLE_FPREGS. (hppa_rtx_costs): Don't check TARGET_DISABLE_FPREGS. Adjust cost of hardware integer multiplication. (pa_conditional_register_usage): Don't check TARGET_DISABLE_FPREGS. * config/pa/pa.h (INT14_OK_STRICT): Likewise. * config/pa/pa.md: Don't check TARGET_DISABLE_FPREGS. Check TARGET_SOFT_FLOAT in patterns that use xmpyu instruction. * config/pa/pa.opt (mdisable-fpregs): Change target mask to SOFT_FLOAT. Revise comment. (msoft-float): New option.
2021-10-24Don't use 'G' constraint in integer move patternsJohn David Anglin1-16/+16
The 'G' constraint only matches a float zero. 2021-10-24 John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog: * config/pa/pa.md: Don't use 'G' constraint in integer move patterns.
2021-10-15Consistently use "rG" constraint for copy instruction in move patternsJohn David Anglin1-20/+20
2021-10-15 John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog: * config/pa/pa.md: Consistently use "rG" constraint for copy instruction in move patterns.
2021-10-15Always default to DWARF2_DEBUG if not specified, warn about deprecated STABSRichard Biener1-0/+4
This makes defaults.h choose DWARF2_DEBUG if PREFERRED_DEBUGGING_TYPE is not specified by the target and errors out if DWARF DWARF is not supported. It also makes us warn when STABS is enabled but not the preferred debugging type and removes the corresponding diagnostic from the Ada frontend. The warnings are pruned from the testsuite output via prune_gcc_output. The following target configurations now explicitely default to STABS: pdp11-*-* pdp11 is a.out, dwarf support is difficult hppa[12]*-*-hpux10* does not support DWARF hppa[12]*-*-hpux11* likewise note that the hppa configs have been deprecated. Targets with DWARF support will now see > ./cc1 -quiet t.c -gstabs t.c: warning: STABS debugging information is obsolete and not supported anymore that is, -gstabs will still generate STABS but use will be diagnosed on targets where DWARF is available. I have built all targets from contrib/config-list.mk to make sure we don't run into the #error and the following makes the STABS usage explicit for pdp11 and hppa with SOM. This completes the series of deprecating STABS for GCC 12. 2021-09-21 Richard Biener <rguenther@suse.de> gcc/ * defaults.h (PREFERRED_DEBUGGING_TYPE): Choose DWARF2_DEBUG when not set. * toplev.c (process_options): Warn when STABS debugging is enabled but not the preferred format. * config/pa/som.h (PREFERRED_DEBUGGING_TYPE): Define to DBX_DEBUG. * config/pdp11/pdp11.h (PREFERRED_DEBUGGING_TYPE): Likewise. gcc/ada/ * gcc-interface/misc.c (gnat_post_options): Do not warn about DBX_DEBUG use here. gcc/testsuite/ * lib/prune.exp: Prune STABS obsoletion message.
2021-10-14Fix TARGET_SOFT_FLOAT patterns in pa.mdJohn David Anglin1-2/+83
2021-10-13 John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog: * config/pa/pa.md (cbranchsf4): Disable if TARGET_SOFT_FLOAT. (cbranchdf4): Likewise. Add missing move patterns for TARGET_SOFT_FLOAT.
2021-10-13Add support for 32-bit hppa targets in muldi3 expanderJohn David Anglin1-26/+54
2021-10-13 John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog: * config/pa/pa.md (muldi3): Add support for inlining 64-bit multiplication on 32-bit PA 1.1 and 2.0 targets.
2021-10-08Come up with OPTION_SET_P macro.Martin Liska1-2/+2
gcc/ada/ChangeLog: * gcc-interface/misc.c (gnat_post_options): Use new macro OPTION_SET_P. (gnat_init_gcc_eh): Likewise. (gnat_init_gcc_fp): Likewise. gcc/c-family/ChangeLog: * c-opts.c (c_common_post_options): Use new macro OPTION_SET_P. gcc/ChangeLog: * config/alpha/alpha.c (alpha_option_override): Use new macro OPTION_SET_P. * config/arc/arc.c (arc_override_options): Likewise. * config/arm/arm.c (arm_option_override): Likewise. * config/bfin/bfin.c (bfin_load_pic_reg): Likewise. * config/c6x/c6x.c (c6x_option_override): Likewise. * config/csky/csky.c: Likewise. * config/darwin.c (darwin_override_options): Likewise. * config/frv/frv.c (frv_option_override): Likewise. * config/i386/djgpp.h: Likewise. * config/i386/i386.c (ix86_stack_protect_guard): Likewise. (ix86_max_noce_ifcvt_seq_cost): Likewise. * config/ia64/ia64.c (ia64_option_override): Likewise. (ia64_override_options_after_change): Likewise. * config/m32c/m32c.c (m32c_option_override): Likewise. * config/m32r/m32r.c (m32r_init): Likewise. * config/m68k/m68k.c (m68k_option_override): Likewise. * config/microblaze/microblaze.c (microblaze_option_override): Likewise. * config/mips/mips.c (mips_option_override): Likewise. * config/nios2/nios2.c (nios2_option_override): Likewise. * config/nvptx/nvptx.c (nvptx_option_override): Likewise. * config/pa/pa.c (pa_option_override): Likewise. * config/riscv/riscv.c (riscv_option_override): Likewise. * config/rs6000/aix71.h: Likewise. * config/rs6000/aix72.h: Likewise. * config/rs6000/aix73.h: Likewise. * config/rs6000/rs6000.c (darwin_rs6000_override_options): Likewise. (rs6000_override_options_after_change): Likewise. (rs6000_linux64_override_options): Likewise. (glibc_supports_ieee_128bit): Likewise. (rs6000_option_override_internal): Likewise. (rs6000_file_start): Likewise. (rs6000_darwin_file_start): Likewise. * config/rs6000/rtems.h: Likewise. * config/rs6000/sysv4.h: Likewise. * config/rs6000/vxworks.h (SUB3TARGET_OVERRIDE_OPTIONS): Likewise. * config/s390/s390.c (s390_option_override): Likewise. * config/sh/linux.h: Likewise. * config/sh/netbsd-elf.h (while): Likewise. * config/sh/sh.c (sh_option_override): Likewise. * config/sol2.c (solaris_override_options): Likewise. * config/sparc/sparc.c (sparc_option_override): Likewise. * config/tilegx/tilegx.c (tilegx_option_override): Likewise. * config/visium/visium.c (visium_option_override): Likewise. * config/vxworks.c (vxworks_override_options): Likewise. * lto-opts.c (lto_write_options): Likewise. * omp-expand.c (expand_omp_simd): Likewise. * omp-general.c (omp_max_vf): Likewise. * omp-offload.c (oacc_xform_loop): Likewise. * opts.h (OPTION_SET_P): Likewise. * targhooks.c (default_max_noce_ifcvt_seq_cost): Likewise. * toplev.c (process_options): Likewise. * tree-predcom.c: Likewise. * tree-sra.c (analyze_all_variable_accesses): Likewise. gcc/cp/ChangeLog: * constexpr.c (maybe_warn_about_constant_value): Use new macro OPTION_SET_P. * decl.c (redeclaration_error_message): Likewise. (cxx_init_decl_processing): Likewise. gcc/d/ChangeLog: * d-lang.cc (d_post_options): Use new macro OPTION_SET_P. gcc/fortran/ChangeLog: * options.c (gfc_post_options): Use new macro OPTION_SET_P. gcc/objc/ChangeLog: * objc-next-runtime-abi-01.c: Use new macro OPTION_SET_P. * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Likewise.
2021-10-01Default to dwarf version 4 on hppa64-hpuxJohn David Anglin1-0/+10
2021-10-01 John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog: PR debug/102373 * config/pa/pa.c (pa_option_override): Default to dwarf version 4 on hppa64-hpux.
2021-08-21Don't warn when alignment of global common data exceeds maximum alignment.John David Anglin1-3/+1
2021-08-21 John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog: * config/pa/pa.c (pa_asm_output_aligned_common): Remove warning.
2021-05-18Use startswith in targets.Martin Liska1-8/+5
gcc/ChangeLog: * common/config/aarch64/aarch64-common.c (aarch64_parse_extension): Use startswith function instead of strncmp. * common/config/bfin/bfin-common.c (bfin_handle_option): Likewise. * common/config/riscv/riscv-common.c (riscv_subset_list::parse): Likewise. * config/aarch64/aarch64-sve-builtins-shapes.cc (parse_type): Likewise. * config/aarch64/aarch64.c (aarch64_process_one_target_attr): Likewise. * config/alpha/alpha.c (alpha_elf_section_type_flags): Likewise. * config/arm/aarch-common.c (arm_md_asm_adjust): Likewise. * config/arm/arm.c (arm_file_start): Likewise. (arm_valid_target_attribute_rec): Likewise. (thumb1_md_asm_adjust): Likewise. * config/arm/driver-arm.c (host_detect_local_cpu): Likewise. * config/avr/avr.c (STR_PREFIX_P): Likewise. (avr_set_current_function): Likewise. (avr_handle_addr_attribute): Likewise. (avr_asm_output_aligned_decl_common): Likewise. (avr_asm_named_section): Likewise. (avr_section_type_flags): Likewise. (avr_asm_select_section): Likewise. * config/c6x/c6x.c (c6x_in_small_data_p): Likewise. (c6x_section_type_flags): Likewise. * config/darwin-c.c (darwin_cfstring_ref_p): Likewise. (darwin_objc_declare_unresolved_class_reference): Likewise. (darwin_objc_declare_class_definition): Likewise. * config/darwin.c (indirect_data): Likewise. (darwin_encode_section_info): Likewise. (darwin_objc2_section): Likewise. (darwin_objc1_section): Likewise. (machopic_select_section): Likewise. (darwin_globalize_label): Likewise. (darwin_label_is_anonymous_local_objc_name): Likewise. (darwin_asm_named_section): Likewise. (darwin_asm_output_dwarf_offset): Likewise. * config/frv/frv.c (frv_string_begins_with): Likewise. (frv_in_small_data_p): Likewise. * config/gcn/mkoffload.c (STR): Likewise. (main): Likewise. * config/i386/i386-builtins.c (get_builtin_code_for_version): Likewise. * config/i386/i386-options.c (ix86_option_override_internal): Likewise. * config/i386/i386.c (x86_64_elf_section_type_flags): Likewise. (ix86_md_asm_adjust): Likewise. * config/i386/intelmic-mkoffload.c (STR): Likewise. * config/i386/winnt.c (i386_pe_asm_named_section): Likewise. (i386_pe_file_end): Likewise. * config/ia64/ia64.c (ia64_in_small_data_p): Likewise. (ia64_section_type_flags): Likewise. * config/mips/driver-native.c (host_detect_local_cpu): Likewise. * config/mips/mips.c (mips_handle_interrupt_attr): Likewise. (mips16_stub_function_p): Likewise. (mips_function_rodata_section): Likewise. * config/msp430/msp430.c (msp430_mcu_name): Likewise. (msp430_function_section): Likewise. (msp430_section_type_flags): Likewise. (msp430_expand_helper): Likewise. * config/nios2/nios2.c (nios2_small_section_name_p): Likewise. (nios2_valid_target_attribute_rec): Likewise. * config/nvptx/mkoffload.c (process): Likewise. (STR): Likewise. * config/pa/som.h: Likewise. * config/pdp11/pdp11.c (pdp11_output_ident): Likewise. * config/riscv/riscv.c (riscv_elf_select_rtx_section): Likewise. * config/rs6000/rs6000.c (VTABLE_NAME_P): Likewise. (rs6000_inner_target_options): Likewise. * config/s390/driver-native.c (s390_host_detect_local_cpu): Likewise. * config/sparc/driver-sparc.c (host_detect_local_cpu): Likewise. * config/vax/vax.c (vax_output_int_move): Likewise. * config/vms/vms-ld.c (startswith): Likewise. (process_args): Likewise. (main): Likewise. * config/vms/vms.c: Likewise.
2021-04-17d: Implement __traits(getTargetInfo, "objectFormat")Iain Buclaw1-0/+17
Following on from adding TARGET_D_REGISTER_OS_TARGET_INFO, this adds the required handlers to implement `__traits(getTargetInfo, "objectFormat")' for all platforms that have D support files. Some back-ends (i386, rs6000, and pa) have some awarenes of the what object format they are compiling for, so new getTargetInfo handlers have been have added both to those back-ends as well as platform-specific target files to override the default in the D front-end. gcc/ChangeLog: * config/darwin-d.c (darwin_d_handle_target_object_format): New function. (darwin_d_register_target_info): New function. (TARGET_D_REGISTER_OS_TARGET_INFO): Define. * config/dragonfly-d.c (dragonfly_d_handle_target_object_format): New function. (dragonfly_d_register_target_info): New function. (TARGET_D_REGISTER_OS_TARGET_INFO): Define. * config/freebsd-d.c (freebsd_d_handle_target_object_format): New function. (freebsd_d_register_target_info): New function. (TARGET_D_REGISTER_OS_TARGET_INFO): Define. * config/glibc-d.c (glibc_d_handle_target_object_format): New function. (glibc_d_register_target_info): New function. (TARGET_D_REGISTER_OS_TARGET_INFO): Define. * config/i386/i386-d.c (ix86_d_handle_target_object_format): New function. (ix86_d_register_target_info): Add ix86_d_handle_target_object_format as handler for objectFormat key. * config/i386/winnt-d.c (winnt_d_handle_target_object_format): New function. (winnt_d_register_target_info): New function. (TARGET_D_REGISTER_OS_TARGET_INFO): Define. * config/netbsd-d.c (netbsd_d_handle_target_object_format): New function. (netbsd_d_register_target_info): New function. (TARGET_D_REGISTER_OS_TARGET_INFO): Define. * config/openbsd-d.c (openbsd_d_handle_target_object_format): New function. (openbsd_d_register_target_info): New function. (TARGET_D_REGISTER_OS_TARGET_INFO): Define. * config/pa/pa-d.c (pa_d_handle_target_object_format): New function. (pa_d_register_target_info): Add pa_d_handle_target_object_format as handler for objectFormat key. * config/rs6000/rs6000-d.c (rs6000_d_handle_target_object_format): New function. (rs6000_d_register_target_info): Add rs6000_d_handle_target_object_format as handler for objectFormat key. * config/sol2-d.c (solaris_d_handle_target_object_format): New function. (solaris_d_register_target_info): New function. (TARGET_D_REGISTER_OS_TARGET_INFO): Define. gcc/d/ChangeLog: * d-target.cc (d_handle_target_object_format): New function. (d_language_target_info): Add d_handle_target_object_format as handler for objectFormat key. (Target::getTargetInfo): Continue if handler returned NULL_TREE.
2021-04-14d: Add TARGET_D_REGISTER_CPU_TARGET_INFOIain Buclaw3-1/+31
This implements `__traits(getTargetInfo, "floatAbi")' for all targets that have D support files. gcc/ChangeLog: * config/aarch64/aarch64-d.c (aarch64_d_handle_target_float_abi): New function. (aarch64_d_register_target_info): New function. * config/aarch64/aarch64-protos.h (aarch64_d_register_target_info): Declare. * config/aarch64/aarch64.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * config/arm/arm-d.c (arm_d_handle_target_float_abi): New function. (arm_d_register_target_info): New function. * config/arm/arm-protos.h (arm_d_register_target_info): Declare. * config/arm/arm.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * config/i386/i386-d.c (ix86_d_handle_target_float_abi): New function. (ix86_d_register_target_info): New function. * config/i386/i386-protos.h (ix86_d_register_target_info): Declare. * config/i386/i386.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * config/mips/mips-d.c (mips_d_handle_target_float_abi): New function. (mips_d_register_target_info): New function. * config/mips/mips-protos.h (mips_d_register_target_info): Declare. * config/mips/mips.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * config/pa/pa-d.c (pa_d_handle_target_float_abi): New function. (pa_d_register_target_info): New function. * config/pa/pa-protos.h (pa_d_register_target_info): Declare. * config/pa/pa.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * config/riscv/riscv-d.c (riscv_d_handle_target_float_abi): New function. (riscv_d_register_target_info): New function. * config/riscv/riscv-protos.h (riscv_d_register_target_info): Declare. * config/riscv/riscv.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * config/rs6000/rs6000-d.c (rs6000_d_handle_target_float_abi): New function. (rs6000_d_register_target_info): New function. * config/rs6000/rs6000-protos.h (rs6000_d_register_target_info): Declare. * config/rs6000/rs6000.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * config/s390/s390-d.c (s390_d_handle_target_float_abi): New function. (s390_d_register_target_info): New function. * config/s390/s390-protos.h (s390_d_register_target_info): Declare. * config/s390/s390.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * config/sparc/sparc-d.c (sparc_d_handle_target_float_abi): New function. (sparc_d_register_target_info): New function. * config/sparc/sparc-protos.h (sparc_d_register_target_info): Declare. * config/sparc/sparc.h (TARGET_D_REGISTER_CPU_TARGET_INFO): Define. * doc/tm.texi: Regenerate. * doc/tm.texi.in (D language and ABI): Add @hook for TARGET_D_REGISTER_CPU_TARGET_INFO. gcc/d/ChangeLog: * d-target.cc (Target::_init): Call new targetdm hook to register CPU specific target info keys. * d-target.def (d_register_cpu_target_info): New hook.
2021-03-26d: Define IN_TARGET_CODE in all machine-specific D language files.Iain Buclaw1-0/+2
This is to be consistent with the rest of the back-end. gcc/ChangeLog: * config/aarch64/aarch64-d.c (IN_TARGET_CODE): Define. * config/arm/arm-d.c (IN_TARGET_CODE): Likewise. * config/i386/i386-d.c (IN_TARGET_CODE): Likewise. * config/mips/mips-d.c (IN_TARGET_CODE): Likewise. * config/pa/pa-d.c (IN_TARGET_CODE): Likewise. * config/riscv/riscv-d.c (IN_TARGET_CODE): Likewise. * config/rs6000/rs6000-d.c (IN_TARGET_CODE): Likewise. * config/s390/s390-d.c (IN_TARGET_CODE): Likewise. * config/sparc/sparc-d.c (IN_TARGET_CODE): Likewise.
2021-03-19Use memcpy instead of strncpy to avoid error with -Werror=stringop-truncation.John David Anglin1-1/+1
gcc/ChangeLog: * config/pa/pa.c (import_milli): Use memcpy instead of strncpy.
2021-02-22Add mi_thunk support for vcalls on hppa.John David Anglin1-158/+346
gcc/ChangeLog: PR target/85074 * config/pa/pa.c (TARGET_ASM_CAN_OUTPUT_MI_THUNK): Define as hook_bool_const_tree_hwi_hwi_const_tree_true. (pa_asm_output_mi_thunk): Add support for nonzero vcall_offset.
2021-01-04Update copyright years.Jakub Jelinek35-35/+35
2020-12-16opts: Remove all usages of Report keyword.Martin Liska1-13/+13
gcc/brig/ChangeLog: * lang.opt: Remove usage of Report. gcc/c-family/ChangeLog: * c.opt: Remove usage of Report. gcc/ChangeLog: * common.opt: Remove usage of Report. * config/aarch64/aarch64.opt: Ditto. * config/alpha/alpha.opt: Ditto. * config/arc/arc.opt: Ditto. * config/arm/arm.opt: Ditto. * config/avr/avr.opt: Ditto. * config/bfin/bfin.opt: Ditto. * config/bpf/bpf.opt: Ditto. * config/c6x/c6x.opt: Ditto. * config/cr16/cr16.opt: Ditto. * config/cris/cris.opt: Ditto. * config/cris/elf.opt: Ditto. * config/csky/csky.opt: Ditto. * config/darwin.opt: Ditto. * config/fr30/fr30.opt: Ditto. * config/frv/frv.opt: Ditto. * config/ft32/ft32.opt: Ditto. * config/gcn/gcn.opt: Ditto. * config/i386/cygming.opt: Ditto. * config/i386/i386.opt: Ditto. * config/ia64/ia64.opt: Ditto. * config/ia64/ilp32.opt: Ditto. * config/linux-android.opt: Ditto. * config/linux.opt: Ditto. * config/lm32/lm32.opt: Ditto. * config/m32r/m32r.opt: Ditto. * config/m68k/m68k.opt: Ditto. * config/mcore/mcore.opt: Ditto. * config/microblaze/microblaze.opt: Ditto. * config/mips/mips.opt: Ditto. * config/mmix/mmix.opt: Ditto. * config/mn10300/mn10300.opt: Ditto. * config/moxie/moxie.opt: Ditto. * config/msp430/msp430.opt: Ditto. * config/nds32/nds32.opt: Ditto. * config/nios2/elf.opt: Ditto. * config/nios2/nios2.opt: Ditto. * config/nvptx/nvptx.opt: Ditto. * config/pa/pa.opt: Ditto. * config/pdp11/pdp11.opt: Ditto. * config/pru/pru.opt: Ditto. * config/riscv/riscv.opt: Ditto. * config/rl78/rl78.opt: Ditto. * config/rs6000/aix64.opt: Ditto. * config/rs6000/linux64.opt: Ditto. * config/rs6000/rs6000.opt: Ditto. * config/rs6000/sysv4.opt: Ditto. * config/rx/elf.opt: Ditto. * config/rx/rx.opt: Ditto. * config/s390/s390.opt: Ditto. * config/s390/tpf.opt: Ditto. * config/sh/sh.opt: Ditto. * config/sol2.opt: Ditto. * config/sparc/long-double-switch.opt: Ditto. * config/sparc/sparc.opt: Ditto. * config/tilegx/tilegx.opt: Ditto. * config/tilepro/tilepro.opt: Ditto. * config/v850/v850.opt: Ditto. * config/visium/visium.opt: Ditto. * config/vms/vms.opt: Ditto. * config/vxworks.opt: Ditto. * config/xtensa/xtensa.opt: Ditto. gcc/lto/ChangeLog: * lang.opt: Remove usage of Report.
2020-09-20Fix linkage with -nodefaultlibs option.John David Anglin3-12/+10
2020-09-20 John David Anglin < danglin@gcc.gnu.org> gcc/ChangeLog * config/pa/pa-hpux11.h (LINK_GCC_C_SEQUENCE_SPEC): Delete. * config/pa/pa64-hpux.h (LINK_GCC_C_SEQUENCE_SPEC): Likewise. (ENDFILE_SPEC): Link with libgcc_stub.a and mill.a. * config/pa/pa32-linux.h (ENDFILE_SPEC): Link with libgcc.a.
2020-09-13Improve costs for DImode shifts of interger constants.John David Anglin1-12/+21
2020-09-13 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog * config/pa/pa.c (hppa_rtx_costs) [ASHIFT, ASHIFTRT, LSHIFTRT]: Provide accurate costs for DImode shifts of integer constants.
2020-09-12Add new shrpsi instruction variands to gcc/config/pa/pa.md.John David Anglin1-21/+119
2020-09-12 Roger Sayle <roger@nextmovesoftware.com> John David Anglin <danglin@gcc.gnu.org> gcc/ChangeLog * config/pa/pa.md (shrpsi4_1, shrpsi4_2): New define_insns split out from previous shrpsi4 providing two commutitive variants using plus_xor_ior_operator as a predicate. (shrpdi4_1, shrpdi4_2, shrpdi_3, shrpdi_4): Likewise DImode versions where _1 and _2 take register shifts, and _3 and _4 for integers. (rotlsi3_internal): Name this anonymous instruction. (rotrdi3): New DImode insn copied from rotrsi3. (rotldi3): New DImode expander copied from rotlsi3. (rotldi4_internal): New DImode insn copied from rotsi3_internal.
2020-09-02hppa: Improve hppa_rtx_costs for shifts by constants.Roger Sayle1-0/+21
This patch provides more accurate rtx_costs estimates for shifts by integer constants (which are cheaper than by a register amount). 2020-09-02 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog * config/pa/pa.c (hppa_rtx_costs) [ASHIFT, ASHIFTRT, LSHIFTRT]: Provide accurate costs for shifts of integer constants.
2020-08-25hppa: PR middle-end/87256: Improved hppa_rtx_costs avoids synth_mult madness.Roger Sayle1-34/+138
This is my proposed fix to PR middle-end/87256 where synth_mult takes an unreasonable amount of CPU time determining an optimal sequence of instructions to perform multiplication by (large) integer constants on hppa. One workaround proposed in bugzilla, is to increase the hash table used to cache/reuse intermediate results. This helps but is a workaround for the (hidden) underlying problem. The real issue is that the hppa_rtx_costs function is providing wildly inaccurate values (estimates) to the middle-end. For example, (p*q)+(r*s) would appear to be cheaper than a single multiplication. Another example is that "(ashiftrt:di regA regB)" is claimed to be only be COST_N_INSNS(1) when in fact the hppa backend actually generates slightly more than a single instruction. It turns out that simply tightening up the logic in hppa_rtx_costs to return more reasonable values, dramatically reduces the number of recursive invocations in synth_mult for the test case in PR87256, and presumably also produces faster code (that should be observable in benchmarks). 2020-08-25 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog PR middle-end/87256 * config/pa/pa.c (hppa_rtx_costs_shadd_p): New helper function to check for coefficients supported by shNadd and shladd,l. (hppa_rtx_costs): Rewrite to avoid using estimates based upon FACTOR and enable recursing deeper into RTL expressions.
2020-08-25hppa: Improve expansion of ashldi3 when !TARGET_64BITRoger Sayle1-1/+33
This patch improves the code generated on PA-RISC for DImode (double word) left shifts by small constants (1-31). This target has a very cool shd instruction that can be recognized by combine for simple shifts, but relying on combine is fragile for more complicated functions. This patch tweaks pa.md's ashldi3 expander, to form the optimal two instruction shd/zdep sequence at RTL expansion time. As an example of the benefits of this approach, the simple function unsigned long long u9(unsigned long long x) { return x*9; } currently generates 9 instructions and with this patch now requires only 7. 2020-08-25 Roger Sayle <roger@nextmovesoftware.com> * config/pa/pa.md (ashldi3): Additionally, on !TARGET_64BIT generate a two instruction shd/zdep sequence when shifting registers by suitable constants. (shd_internal): New define_expand to provide gen_shd_internal.
2020-06-30Fix bootstrap failure on PAJeff Law1-4/+4
gcc/ * config/pa/pa.c (pa_emit_move_sequence): Drop register keyword. (pa_output_ascii): Likewise.
2020-04-21Fix weakening of external declarations.John David Anglin1-7/+38
2020-04-21 John David Anglin <danglin@gcc.gnu.org> * config/pa/som.h (ASM_WEAKEN_LABEL): Delete. (ASM_WEAKEN_DECL): New define. (HAVE_GAS_WEAKREF): Undefine.
2020-03-29Delete duplicate .align output.John David Anglin1-1/+0
2020-03-29 John David Anglin <dave.anglin@bell.net> * gcc/config/pa/pa.c (pa_asm_output_aligned_bss): Delete duplicate .align output.
2020-03-24Define __BIG_ENDIAN__John David Anglin1-0/+1
2020-03-24 John David Anglin <danglin@gcc.gnu.org> PR lto/94249 * config/pa/pa.h (TARGET_CPU_CPP_BUILTINS): Define __BIG_ENDIAN__.
2020-02-21Fix handling of floating-point homogeneous aggregates.John David Anglin2-7/+13
2020-02-21 John David Anglin <danglin@gcc.gnu.org> * gcc/config/pa/pa.c (pa_function_value): Fix check for word and double-word size when handling aggregate return values. * gcc/config/pa/som.h (ASM_DECLARE_FUNCTION_NAME): Fix to indicate that homogeneous SFmode and DFmode aggregates are passed and returned in general registers.
2020-01-30Fix ICE in pa_elf_select_rtx_section.John David Anglin1-1/+1
2020-01-30 John David Anglin <danglin@gcc.gnu.org> * config/pa/pa.c (pa_elf_select_rtx_section): Place function pointers without a DECL in .data.rel.ro.local.
2020-01-06pa.md: Revert change to use ordered_comparison_operator instead of...John David Anglin2-2/+8
* config/pa/pa.md: Revert change to use ordered_comparison_operator instead of cmpib_comparison_operator in cmpib patterns. * config/pa/predicates.md (cmpib_comparison_operator): Revert removal of cmpib_comparison_operator. Revise comment. From-SVN: r279927
2020-01-01re PR target/67834 (Local references inside comdat groups)John David Anglin2-0/+26
PR target/67834 * config/pa/pa.c (pa_elf_select_rtx_section): New. Put references to COMDAT group function labels in .data.rel.ro.local section. * config/pa/pa32-linux.h (TARGET_ASM_SELECT_RTX_SECTION): Define. From-SVN: r279823
2020-01-01re PR target/93111 (FAIL: gfortran.fortran-torture/compile/pr32663.f, -O3 ↵John David Anglin2-31/+25
-g (internal compiler error)) PR target/93111 * config/pa/pa.md (scc): Use ordered_comparison_operator instead of comparison_operator in B and S integer comparisons. Likewise, use ordered_comparison_operator instead of cmpib_comparison_operator in cmpib patterns. * config/pa/predicates.md (cmpib_comparison_operator): Remove. From-SVN: r279818
2020-01-01Update copyright years.Jakub Jelinek35-35/+35
From-SVN: r279813
2019-11-08pa.md (memory_barrier): Revise to use ldcw barriers.John David Anglin2-10/+50
* config/pa/pa.md (memory_barrier): Revise to use ldcw barriers. Enhance comment. (memory_barrier_coherent, memory_barrier_64, memory_barrier_32): New insn patterns using ldcw instruction. (memory_barrier): Remove insn pattern using sync instruction. * config/pa/pa.opt (coherent-ldcw): New option. (ordered): New option. From-SVN: r277941
2019-10-17pa.c (pa_output_indirect_call): Fix typos in last change.John David Anglin1-7/+7
* config/pa/pa.c (pa_output_indirect_call): Fix typos in last change. From-SVN: r277135
2019-10-12pa.c (pa_output_call): Load descriptor address to register %r22.John David Anglin2-78/+87
* config/pa/pa.c (pa_output_call): Load descriptor address to register %r22. Load function address before global pointer. (pa_attr_length_indirect_call): Adjust length of inline versions of $$dyncall. (pa_output_indirect_call): Remove fast inline version of $$dyncall before normal cases. Update inline $$dyncall sequences to preserve function descriptor address in register %r22. (TRAMPOLINE_CODE_SIZE): Adjust. (pa_asm_trampoline_template): Revise 32-bit trampoline. Don't assume register %r22 contains trampoline address. (pa_trampoline_init): Adjust offsets. (pa_trampoline_adjust_address): Likewise. * config/pa/pa.h (TRAMPOLINE_SIZE): Adjust 32-bit size. From-SVN: r276928
2019-10-12pa.c (pa_option_override): Remove trailing comma from warning.John David Anglin1-1/+1
* gcc/config/pa/pa.c (pa_option_override): Remove trailing comma from warning. From-SVN: r276920
2019-10-03pa.h (MAX_PCREL17F_OFFSET): Adjust.John David Anglin1-7/+6
* config/pa/pa.h (MAX_PCREL17F_OFFSET): Adjust. From-SVN: r276555
2019-10-03pa.c (pa_output_call): Remove 64-bit sibcall sequence.John David Anglin1-22/+8
* config/pa/pa.c (pa_output_call): Remove 64-bit sibcall sequence. (pa_attr_length_call): Adjust length for 64-bit plabel sequence. From-SVN: r276543
2019-09-20pa.c (pa_trampoline_init): Remove spurious extended character.John David Anglin1-1/+1
* config/pa/pa.c (pa_trampoline_init): Remove spurious extended character. From-SVN: r276007
2019-09-10Add call_used_or_fixed_reg_pRichard Sandiford1-4/+4
Similarly to the call_used_or_fixed_regs patch, this one replaces tests of call_used_regs[i] with call_used_or_fixed_reg_p (i). The only remaining direct uses of call_used_regs are in reginfo.c and in the conditional register usage hooks. Again, this is purely mechanical. A later patch will clear up the oddities in config/ code. 2019-09-10 Richard Sandiford <richard.sandiford@arm.com> gcc/ * hard-reg-set.h (call_used_or_fixed_reg_p): New macro. * cfgloopanal.c (init_set_costs): Use call_used_or_fixed_reg_p instead of testing call_used_regs directly. * config/aarch64/aarch64.c (aarch64_layout_frame): Likewise. (aarch64_components_for_bb): Likewise. * config/alpha/alpha.c (alpha_compute_frame_layout): Likewise. * config/arc/arc.c (arc_must_save_register): Likewise. (arc_epilogue_uses): Likewise. * config/arm/arm.c (arm_option_override, use_return_insn): Likewise. (legitimize_pic_address, callee_saved_reg_p): Likewise. (arm_compute_save_reg0_reg12_mask): Likewise. (arm_compute_save_core_reg_mask): Likewise. (arm_get_vfp_saved_size, arm_compute_frame_layout): Likewise. (arm_save_coproc_regs, thumb1_extra_regs_pushed): Likewise. (cmse_nonsecure_entry_clear_before_return): Likewise. (thumb1_expand_epilogue, arm_expand_epilogue_apcs_frame): Likewise. (arm_expand_epilogue): Likewise. * config/avr/avr.c (avr_regs_to_save, sequent_regs_live): Likewise. (avr_function_arg_advance, avr_find_unused_d_reg): Likewise. (_reg_unused_after): Likewise. * config/bfin/bfin.c (must_save_p, expand_prologue_reg_save): Likewise. (expand_epilogue_reg_restore, n_regs_saved_by_prologue): Likewise. (add_to_reg, hwloop_optimize): Likewise. * config/bpf/bpf.c (bpf_compute_frame_layout, bpf_expand_prologue) (bpf_expand_epilogue): Likewise. * config/c6x/c6x.c (c6x_save_reg, c6x_regno_reg_class): Likewise. * config/cr16/cr16.c (cr16_compute_save_regs): Likewise. * config/cris/cris.c (cris_reg_saved_in_regsave_area): Likewise. * config/epiphany/epiphany.c (epiphany_init_reg_tables): Likewise. (epiphany_compute_function_type, MUST_SAVE_REGISTER): Likewise. (epiphany_output_mi_thunk, epiphany_start_function): Likewise. * config/fr30/fr30.c (fr30_num_arg_regs): Likewise. * config/frv/frv.c (frv_stack_info): Likewise. * config/ft32/ft32.c (ft32_compute_frame): Likewise. (ft32_expand_prologue, ft32_expand_epilogue): Likewise. * config/gcn/gcn.c (gcn_compute_frame_offsets): Likewise. (move_callee_saved_registers): Likewise. * config/h8300/h8300.c (byte_reg): Likewise. * config/i386/i386-options.c (ix86_set_current_function): Likewise. * config/i386/i386.c (ix86_save_reg, ix86_expand_prologue): Likewise. (ix86_expand_epilogue, x86_order_regs_for_local_alloc): Likewise. * config/i386/predicates.md (sibcall_memory_operand): Likewise. * config/ia64/ia64.c (emit_safe_across_calls, find_gr_spill): Likewise. (next_scratch_gr_reg, ia64_compute_frame_size): Likewise. * config/iq2000/iq2000.h (MUST_SAVE_REGISTER): Likewise. * config/lm32/lm32.c (lm32_compute_frame_size): Likewise. * config/m32c/m32c.c (need_to_save): Likewise. * config/m68k/m68k.c (m68k_save_reg): Likewise. * config/mcore/mcore.c (calc_live_regs): Likewise. * config/microblaze/microblaze.c (microblaze_must_save_register): Likewise. * config/mmix/mmix.c (mmix_local_regno): Likewise. (mmix_initial_elimination_offset, mmix_reorg): Likewise. (mmix_use_simple_return, mmix_expand_prologue): Likewise. (mmix_expand_epilogue): Likewise. * config/moxie/moxie.c (moxie_compute_frame): Likewise. (moxie_expand_prologue, moxie_expand_epilogue): Likewise. * config/msp430/msp430.c (msp430_preserve_reg_p): Likewise. * config/nds32/nds32.h (nds32_16bit_address_type): Likewise. (NDS32_REQUIRED_CALLEE_SAVED_P): Likewise. * config/nios2/nios2.c (prologue_saved_reg_p): Likewise. * config/or1k/or1k.c (callee_saved_regno_p): Likewise. * config/pa/pa.c (pa_expand_prologue, pa_expand_epilogue): Likewise. * config/pdp11/pdp11.c (pdp11_saved_regno): Likewise. * config/pru/pru.c (prologue_saved_reg_p): Likewise. * config/riscv/riscv.c (riscv_save_reg_p): Likewise. (riscv_epilogue_uses, riscv_hard_regno_mode_ok): Likewise. * config/rl78/rl78.c (need_to_save): Likewise. * config/rs6000/rs6000-logue.c (save_reg_p): Likewise. (rs6000_stack_info, generate_set_vrsave): Likewise. (rs6000_emit_prologue, rs6000_emit_epilogue): Likewise. * config/rs6000/rs6000.c (rs6000_debug_reg_print): Likewise. * config/rx/rx.c (rx_get_stack_layout): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (calc_live_regs, sh_output_mi_thunk): Likewise. * config/sparc/sparc.c (save_global_or_fp_reg_p): Likewise. (save_local_or_in_reg_p): Likewise. * config/stormy16/stormy16.c (REG_NEEDS_SAVE): Likewise. (xstormy16_epilogue_uses): Likewise. * config/tilegx/tilegx.c (need_to_save_reg): Likewise. * config/tilepro/tilepro.c (need_to_save_reg): Likewise. * config/v850/v850.c (compute_register_save_size): Likewise. * config/vax/vax.c (vax_expand_prologue): Likewise. * config/visium/visium.c (visium_save_reg_p): Likewise. * config/xtensa/xtensa.c (xtensa_call_save_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * df-scan.c (df_get_entry_block_def_set): Likewise. * function.c (aggregate_value_p): Likewise. * haifa-sched.c (alloc_global_sched_pressure_data): Likewise. * ira-lives.c (process_bb_node_lives): Likewise. * ira.c (do_reload): Likewise. * lra-lives.c (process_bb_lives): Likewise. * lra-remat.c (lra_remat): Likewise. * lra.c (lra): Likewise. * postreload.c (reload_combine_recognize_pattern): Likewise. (reload_cse_move2add): Likewise. * recog.c (peep2_find_free_register): Likewise. * regrename.c (check_new_reg_p): Likewise. * reload.c (find_equiv_reg): Likewise. * reload1.c (reload, find_reg): Likewise. * sel-sched.c (init_hard_regs_data): Likewise. From-SVN: r275602
2019-08-20Use function_arg_info for TARGET_CALLEE_COPIESRichard Sandiford1-6/+2
The hook is passed the unpromoted type mode instead of the promoted mode. The aarch64 definition is redundant, but worth keeping for emphasis. 2019-08-20 Richard Sandiford <richard.sandiford@arm.com> gcc/ * target.def (callee_copies): Take a function_arg_info instead of a mode, type and named flag. * doc/tm.texi: Regenerate. * targhooks.h (hook_callee_copies_named): Take a function_arg_info instead of a mode, type and named flag. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Delete. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_bool_CUMULATIVE_ARGS_arg_info_true): New function. * targhooks.c (hook_callee_copies_named): Take a function_arg_info instead of a mode, type and named flag. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Delete. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_bool_CUMULATIVE_ARGS_arg_info_true): New function. * calls.h (reference_callee_copied): Take a function_arg_info instead of a mode, type and named flag. * calls.c (reference_callee_copied): Likewise. (initialize_argument_information): Update call accordingly. (emit_library_call_value_1): Likewise. * function.c (gimplify_parameters): Likewise. * config/aarch64/aarch64.c (TARGET_CALLEE_COPIES): Define to hook_bool_CUMULATIVE_ARGS_arg_info_false instead of hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false. * config/c6x/c6x.c (c6x_callee_copies): Delete. (TARGET_CALLEE_COPIES): Define to hook_bool_CUMULATIVE_ARGS_arg_info_true instead. * config/epiphany/epiphany.c (TARGET_CALLEE_COPIES): Define to hook_bool_CUMULATIVE_ARGS_arg_info_true instead of hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true. * config/mips/mips.c (mips_callee_copies): Take a function_arg_info instead of a mode, type and named flag. * config/mmix/mmix.c (TARGET_CALLEE_COPIES): Define to hook_bool_CUMULATIVE_ARGS_arg_info_true instead of hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true. * config/mn10300/mn10300.c (TARGET_CALLEE_COPIES): Likewise. * config/msp430/msp430.c (msp430_callee_copies): Delete. (TARGET_CALLEE_COPIES): Define to hook_bool_CUMULATIVE_ARGS_arg_info_true instead. * config/pa/pa.c (pa_callee_copies): Take a function_arg_info instead of a mode, type and named flag. * config/sh/sh.c (sh_callee_copies): Likewise. * config/v850/v850.c (TARGET_CALLEE_COPIES): Define to hook_bool_CUMULATIVE_ARGS_arg_info_true instead of hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true. From-SVN: r274702
2019-08-20Use function_arg_info for TARGET_FUNCTION_ARG_ADVANCERichard Sandiford1-9/+7
There seems to be a bit of confusion around this one. Almost all callers pass the same arguments as TARGET_FUNCTION_ARG, meaning that the mode is the promoted mode rather than the type mode. But the calls.c handling for normal typed arguments instead passes the unpromoted TYPE_MODE (despite passing the promoted mode to TARGET_FUNCTION_ARG). I've kept this behaviour with a ??? comment. (The calls.c handling of libgcc functions does pass the promoted mode though, as does the function.c handling of incoming arguments.) Also, a couple of the arm callers don't seem to be using the hook correctly. Again I kept the current choices and added a ??? comment. 2019-08-20 Richard Sandiford <richard.sandiford@arm.com> gcc/ * target.def (function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * doc/tm.texi: Regenerate. * targhooks.h (default_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * targhooks.c (default_function_arg_advance): Likewise. * calls.c (initialize_argument_information): Update call to targetm.calls.function_arg_advance. (emit_library_call_value_1): Likewise. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (assign_parms, gimplify_parameters): Likewise. * var-tracking.c (prepare_call_arguments): Likewise. * config/aarch64/aarch64.c (aarch64_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (aarch64_setup_incoming_varargs): Update call accordingly. * config/alpha/alpha.c (alpha_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (alpha_setup_incoming_varargs): Update call accordingly. * config/arc/arc.c (arc_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (arc_setup_incoming_varargs): Update call accordingly. * config/arm/arm.c (arm_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (cmse_func_args_or_return_in_stack): Update call accordingly. (arm_function_ok_for_sibcall): Likewise. (cmse_nonsecure_call_clear_caller_saved): Likewise. * config/avr/avr.c (avr_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/bfin/bfin.c (bfin_function_arg_advance): Likewise. * config/c6x/c6x.c (c6x_function_arg_advance): Likewise. (c6x_call_saved_register_used): Update call accordingly. * config/cr16/cr16.c (cr16_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/cris/cris.c (cris_function_arg_advance): Likewise. * config/csky/csky.c (csky_function_arg_advance): Likewise. (csky_setup_incoming_varargs): Update call accordingly. * config/epiphany/epiphany.c (epiphany_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/fr30/fr30.c (fr30_function_arg_advance): Likewise. * config/frv/frv.c (frv_function_arg_advance): Likewise. * config/ft32/ft32.c (ft32_function_arg_advance): Likewise. * config/gcn/gcn.c (gcn_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_setup_incoming_varargs): Update call accordingly. * config/ia64/ia64.c (ia64_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (ia64_setup_incoming_varargs): Update call accordingly. * config/iq2000/iq2000.c (iq2000_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (iq2000_expand_prologue): Update call accordingly. * config/lm32/lm32.c (lm32_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/m32c/m32c.c (m32c_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_function_arg_advance): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. * config/mcore/mcore.c (mcore_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_expand_prologue): Update call accordingly. * config/mips/mips.c (mips_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (mips_setup_incoming_varargs): Update call accordingly. (mips_output_args_xfer): Likewise. * config/mmix/mmix.c (mmix_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/mn10300/mn10300.c (mn10300_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_function_arg_advance): Likewise. * config/msp430/msp430.c (msp430_function_arg_advance): Likewise. * config/nds32/nds32.c (nds32_function_arg_advance): Likewise. * config/nios2/nios2.c (nios2_function_arg_advance): Likewise. (nios2_setup_incoming_varargs): Update call accordingly. * config/nvptx/nvptx.c (nvptx_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/or1k/or1k.c (or1k_function_arg_advance): Likewise. * config/pa/pa.c (pa_function_arg_advance): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg_advance): Likewise. * config/pru/pru.c (pru_function_arg_advance): Likewise. * config/riscv/riscv.c (riscv_function_arg_advance): Likewise. (riscv_setup_incoming_varargs): Update call accordingly. * config/rl78/rl78.c (rl78_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/rs6000/rs6000-internal.h (rs6000_function_arg_advance): Likewise. * config/rs6000/rs6000-call.c (rs6000_function_arg_advance): Likewise. (rs6000_parm_needs_stack): Update call accordingly. * config/rx/rx.c (rx_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/s390/s390.c (s390_function_arg_advance): Likewise. (s390_call_saved_register_used): Update call accordingly. * config/sh/sh.c (sh_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (sh_output_mi_thunk): Update call accordingly. * config/sparc/sparc.c (sparc_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/spu/spu.c (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Update call accordingly. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/tilegx/tilegx.c (tilegx_function_arg_advance): Likewise. (tilegx_setup_incoming_varargs): Update call accordingly. * config/tilepro/tilepro.c (tilepro_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (tilegx_setup_incoming_varargs): Update call accordingly. * config/v850/v850.c (v850_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/vax/vax.c (vax_function_arg_advance): Likewise. * config/visium/visium.c (visium_function_arg_advance): Likewise. (visium_setup_incoming_varargs): Update call accordingly. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. From-SVN: r274701
2019-08-20Use function_arg_info for TARGET_FUNCTION_(INCOMING_)ARGRichard Sandiford1-5/+5
This patch makes both TARGET_FUNCTION_ARG and TARGET_FUNCTION_INCOMING_ARG take a function_arg_info. They have to be done together since many targets use the same function for both. The hooks are passed the promoted mode instead of the original type mode. 2019-08-20 Richard Sandiford <richard.sandiford@arm.com> gcc/ * target.def (function_arg, function_incoming_arg): Take a function_arg_info instead of a mode, tree and named flag. * doc/tm.texi: Regenerate. * targhooks.h (default_function_arg): Take a function_arg_info instead of a mode, tree and named flag. (default_function_incoming_arg): Likewise. * targhooks.c (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. * calls.h (function_arg_info::end_marker_p): New function. (function_arg_info::end_marker): Likewise. * calls.c (prepare_call_address, initialize_argument_information) (expand_call, emit_library_call_value_1): Update calls to targetm.calls.function_arg and targetm.calls.function_incoming_arg. * dse.c: Include calls.h. (get_call_args): Update call to targetm.calls.function_arg. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * var-tracking.c (prepare_call_arguments): Likewise. * function.c (assign_parm_find_entry_rtl): Update call to targetm.calls.function_incoming_arg. * config/aarch64/aarch64.c (aarch64_function_arg): Take a function_arg_info instead of a mode, tree and named flag. * config/alpha/alpha.c (alpha_function_arg): Likewise. * config/arc/arc.c (arc_function_arg): Likewise. * config/arm/arm.c (arm_function_arg): Likewise. (cmse_func_args_or_return_in_stack): Update call accordingly. (arm_function_ok_for_sibcall): Likewise. (cmse_nonsecure_call_clear_caller_saved): Likewise. * config/avr/avr.c (avr_function_arg): Take a function_arg_info instead of a mode, tree and named flag. * config/bfin/bfin.c (bfin_function_arg): Likewise. * config/c6x/c6x.c (c6x_function_arg): Likewise. (c6x_call_saved_register_used): Update call accordingly. * config/cr16/cr16.c (cr16_function_arg): Take a function_arg_info instead of a mode, tree and named flag. * config/cris/cris.c (cris_function_arg, cris_function_incoming_arg) (cris_function_arg_1): Likewise. * config/csky/csky.c (csky_function_arg): Likewise. * config/epiphany/epiphany.c (epiphany_function_arg): Likewise. * config/fr30/fr30.c (fr30_function_arg): Likewise. * config/frv/frv.c (frv_function_arg, frv_function_incoming_arg) (frv_function_arg_1): Likewise. * config/ft32/ft32.c (ft32_function_arg): Likewise. * config/gcn/gcn.c (gcn_function_arg): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. * config/i386/i386.c (ix86_function_arg): Likewise. * config/ia64/ia64.c (ia64_function_arg, ia64_function_incoming_arg) (ia64_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_function_arg): Likewise. (iq2000_expand_prologue, iq2000_pass_by_reference): Update call accordingly. * config/lm32/lm32.c (lm32_function_arg): Take a function_arg_info instead of a mode, tree and named flag. * config/m32c/m32c.c (m32c_function_arg): Likewise. * config/m32r/m32r.c (m32r_function_arg): Likewise. * config/m68k/m68k.c (m68k_function_arg): Likewise. * config/mcore/mcore.c (mcore_function_arg): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg): Likewise. (microblaze_expand_prologue): Update call accordingly. * config/mips/mips.c (mips_function_arg): Take a function_arg_info instead of a mode, tree and named flag. * config/mmix/mmix.c (mmix_function_incoming_arg, mmix_function_arg) (mmix_function_arg_1): Likewise. * config/mn10300/mn10300.c (mn10300_function_arg): Likewise. * config/moxie/moxie.c (moxie_function_arg): Likewise. * config/msp430/msp430.c (msp430_function_arg): Likewise. * config/nds32/nds32.c (nds32_function_arg): Likewise. * config/nios2/nios2.c (nios2_function_arg): Likewise. * config/nvptx/nvptx.c (nvptx_function_arg): Likewise. (nvptx_function_incoming_arg): Likewise. * config/or1k/or1k.c (or1k_function_arg): Likewise. * config/pa/pa.c (pa_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. * config/pru/pru.c (pru_function_arg): Likewise. * config/riscv/riscv.c (riscv_function_arg): Likewise. * config/rl78/rl78.c (rl78_function_arg): Likewise. * config/rs6000/rs6000-internal.h (rs6000_function_arg): Likewise. * config/rs6000/rs6000-call.c (rs6000_function_arg): Likewise. (rs6000_parm_needs_stack): Update call accordingly. * config/rx/rx.c (rx_function_arg): Take a function_arg_info instead of a mode, tree and named flag. * config/s390/s390.c (s390_function_arg): Likewise. (s390_call_saved_register_used): Update call accordingly. * config/sh/sh.c (sh_function_arg): Take a function_arg_info instead of a mode, tree and named flag. (sh_output_mi_thunk): Update call accordingly. * config/sparc/sparc.c (sparc_function_arg_1, sparc_function_arg) (sparc_function_incoming_arg): Take a function_arg_info instead of a mode, tree and named flag. * config/spu/spu.c (spu_function_arg): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg): Likewise. * config/tilegx/tilegx.c (tilegx_function_arg): Likewise. * config/tilepro/tilepro.c (tilepro_function_arg): Likewise. * config/v850/v850.c (v850_function_arg): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. * config/visium/visium.c (visium_function_arg): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_1, xtensa_function_arg) (xtensa_function_incoming_arg): Likewise. From-SVN: r274700
2019-08-20Use function_arg_info for TARGET_PASS_BY_REFERENCERichard Sandiford1-12/+4
The hook is passed the unpromoted type mode instead of the promoted mode. 2019-08-20 Richard Sandiford <richard.sandiford@arm.com> gcc/ * target.def (pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * doc/tm.texi: Regenerate. * targhooks.h (hook_pass_by_reference_must_pass_in_stack): Update accordingly. (hook_bool_CUMULATIVE_ARGS_arg_info_false): Declare. * targhooks.c (hook_pass_by_reference_must_pass_in_stack): Take a function_arg_info instead of a mode, type and named flag. (hook_bool_CUMULATIVE_ARGS_arg_info_false): New function. * calls.h (pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * calls.c (pass_by_reference): Likewise. (pass_va_arg_by_reference): Update call accordingly. (initialize_argument_information): Likewise. (emit_library_call_value_1): Likewise. * function.c (assign_parm_find_data_types): Likewise. * var-tracking.c (prepare_call_arguments): Likewise. * stor-layout.c: Include calls.h. (compute_record_mode): Update call to targetm.calls.pass_by_reference. * config/aarch64/aarch64.c (aarch64_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * config/alpha/alpha.c (alpha_pass_by_reference): Likewise. * config/arc/arc.c (arc_pass_by_reference): Likewise. * config/arm/arm.c (arm_pass_by_reference): Likewise. * config/bfin/bfin.c (bfin_pass_by_reference): Likewise. * config/c6x/c6x.c (c6x_pass_by_reference): Likewise. (c6x_call_saved_register_used): Update call to pass_by_reference. * config/cris/cris.c (cris_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * config/epiphany/epiphany.c (epiphany_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. (epiphany_arg_partial_bytes): Update call accordingly. * config/ft32/ft32.c (ft32_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. (ft32_arg_partial_bytes): Update call accordingly. * config/i386/i386.c (ix86_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * config/iq2000/iq2000.c (iq2000_pass_by_reference): Likewise. * config/m32c/m32c.c (m32c_pass_by_reference): Likewise. * config/m32r/m32r.c (m32r_pass_by_reference): Likewise. (m32r_return_in_memory): Update call accordingly. * config/mips/mips.c (mips_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * config/mmix/mmix.c (mmix_pass_by_reference): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. * config/moxie/moxie.c (moxie_pass_by_reference): Likewise. (moxie_arg_partial_bytes): Update call accordingly. * config/msp430/msp430.c (msp430_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * config/nvptx/nvptx.c (nvptx_pass_by_reference): Likewise. * config/or1k/or1k.c (or1k_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. * config/riscv/riscv.c (riscv_pass_by_reference): Likewise. (riscv_return_in_memory): Update call accordingly. * config/rs6000/rs6000-internal.h (rs6000_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * config/rs6000/rs6000-call.c (rs6000_pass_by_reference): Likewise. (rs6000_parm_needs_stack): Update call to pass_by_reference. * config/s390/s390.c (s390_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. (s390_call_saved_register_used): Update call accordingly. * config/sh/sh.c (sh_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * config/sparc/sparc.c (sparc_pass_by_reference): Likewise. * config/spu/spu.c (spu_pass_by_reference): Likewise. * config/tilegx/tilegx.c (tilegx_pass_by_reference): Likewise. * config/tilepro/tilepro.c (tilepro_pass_by_reference): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. * config/visium/visium.c (visium_pass_by_reference): Likewise. gcc/ada/ * gcc-interface/misc.c (default_pass_by_ref): Update call to pass_by_reference. From-SVN: r274698
2019-08-20Use function_arg_info for TARGET_ARG_PARTIAL_BYTESRichard Sandiford1-6/+5
This patch adds the function_arg_info class and uses it for TARGET_ARG_PARTIAL_BYTES. The hook is passed the promoted mode instead of the original type mode. The arguments aren't mentioned in the documentation, which is why the target.def change is so small. The patch changes "true" to "arg.named" in: gcc_assert (!epiphany_pass_by_reference (cum, mode, type, /* named */ true)); but epiphany_pass_by_reference doesn't care about the named flag. 2019-08-20 Richard Sandiford <richard.sandiford@arm.com> gcc/ * target.def (arg_partial_bytes): Take a function_arg_info instead of a mode, type and named flag. * doc/tm.texi: Regenerate. * target.h (function_arg_info): Declare. * calls.h (function_arg_info): New class. * targhooks.h (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Delete. (hook_int_CUMULATIVE_ARGS_arg_info_0): Declare. * targhooks.c (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Delete. (hook_int_CUMULATIVE_ARGS_arg_info_0): New function. * calls.c (initialize_argument_information): Update call to targetm.calls.partial_bytes. (emit_library_call_value_1): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (assign_parm_find_entry_rtl): Likewise. * config/alpha/alpha.c (alpha_arg_partial_bytes): Take a function_arg_info instead of a mode, type and named flag. * config/arc/arc.c (arc_arg_partial_bytes): Likewise. * config/arm/arm.c (arm_arg_partial_bytes): Likewise. (cmse_func_args_or_return_in_stack): Update accordingly. * config/bfin/bfin.c (bfin_arg_partial_bytes): Take a function_arg_info instead of a mode, type and named flag. * config/cris/cris.c (cris_arg_partial_bytes): Likewise. * config/csky/csky.c (csky_arg_partial_bytes): Likewise. * config/epiphany/epiphany.c (epiphany_arg_partial_bytes): Likewise. * config/fr30/fr30.c: Include calls.h. (fr30_arg_partial_bytes): Take a function_arg_info instead of a mode, type and named flag. * config/frv/frv.c: Include calls.h. (frv_arg_partial_bytes): Take a function_arg_info instead of a mode, type and named flag. * config/ft32/ft32.c (ft32_arg_partial_bytes): Likewise. * config/gcn/gcn.c (gcn_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_arg_partial_bytes): Likewise. * config/iq2000/iq2000.c (iq2000_arg_partial_bytes): Likewise. * config/m32r/m32r.c (m32r_arg_partial_bytes): Likewise. * config/mcore/mcore.c (mcore_arg_partial_bytes): Likewise. * config/microblaze/microblaze.c (function_arg_partial_bytes): Likewise. * config/mips/mips.c (mips_arg_partial_bytes): Likewise. * config/mn10300/mn10300.c (mn10300_arg_partial_bytes): Likewise. * config/moxie/moxie.c (moxie_arg_partial_bytes): Likewise. * config/msp430/msp430.c (msp430_arg_partial_bytes): Likewise. * config/nds32/nds32.c (nds32_arg_partial_bytes): Likewise. * config/nios2/nios2.c (nios2_arg_partial_bytes): Likewise. * config/pa/pa.c (pa_arg_partial_bytes): Likewise. * config/pru/pru.c (pru_arg_partial_bytes): Likewise. * config/riscv/riscv.c (riscv_arg_partial_bytes): Likewise. * config/rs6000/rs6000-internal.h (rs6000_arg_partial_bytes): Likewise. * config/rs6000/rs6000-call.c (rs6000_arg_partial_bytes): Likewise. (rs6000_parm_needs_stack): Update call accordingly. * config/sh/sh.c (sh_arg_partial_bytes): Take a function_arg_info instead of a mode, type and named flag. * config/sparc/sparc.c (sparc_arg_partial_bytes): Likewise. * config/v850/v850.c (v850_arg_partial_bytes): Likewise. From-SVN: r274697
2019-08-20Add pass_va_arg_by_referenceRichard Sandiford1-1/+1
This patch splits out a common idiom from the va_arg gimplification routines, so that there's only one place to update later. 2019-08-20 Richard Sandiford <richard.sandiford@arm.com> gcc/ * calls.h (pass_va_arg_by_reference): Declare. * calls.c (pass_va_arg_by_reference): New function. * config/aarch64/aarch64.c (aarch64_gimplify_va_arg_expr): Use it. * config/alpha/alpha.c (alpha_gimplify_va_arg): Likewise. * config/gcn/gcn.c (gcn_gimplify_va_arg_expr): Likewise. * config/i386/i386.c (ix86_gimplify_va_arg): Likewise. * config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise. * config/mips/mips.c (mips_std_gimplify_va_arg_expr): Likewise. (mips_gimplify_va_arg_expr): Likewise. * config/msp430/msp430.c (msp430_gimplify_va_arg_expr): Likewise. * config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise. * config/rs6000/rs6000-call.c (rs6000_gimplify_va_arg): Likewise. * config/s390/s390.c (s390_gimplify_va_arg): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Likewise. * config/spu/spu.c (spu_gimplify_va_arg_expr): Likewise. * config/tilegx/tilegx.c (tilegx_gimplify_va_arg_expr): Likewise. * config/tilepro/tilepro.c (tilepro_gimplify_va_arg_expr): Likewise. * config/visium/visium.c (visium_gimplify_va_arg): Likewise. * config/xtensa/xtensa.c (xtensa_gimplify_va_arg_expr): Likewise. * targhooks.c (std_gimplify_va_arg_expr): Likewise. From-SVN: r274695