Commit Graph

1077 Commits

Author SHA1 Message Date
Ilia Diachkov 5a4602805e Add --disable-tm-clone-registry libgcc configure option.
This patch adds libgcc configuration option to disable TM clone 
registry. This option helps to reduce code size for embedded targets 
which do not need transactional memory support.

	gcc/
	* doc/install.texi: Document --disable-tm-clone-registry.
	libgcc/
	* Makefile.in (USE_TM_CLONE_REGISTRY): New.
	(CRTSTUFF_CFLAGS): Use USE_TM_CLONE_REGISTRY.
	* configure.ac: Add --disable-tm-clone-registry option.
	* configure: Regenerate.

From-SVN: r272769
2019-06-27 16:41:03 -07:00
Martin Liska 45309d286c Remove quite obvious dead assignments.
2019-06-27  Martin Liska  <mliska@suse.cz>

	* asan.c (asan_emit_allocas_unpoison): Remove obviously
	dead assignments.
	* bt-load.c (move_btr_def): Likewise.
	* builtins.c (expand_builtin_apply_args_1): Likewise.
	(expand_builtin_apply): Likewise.
	* cfgexpand.c (expand_asm_stmt): Likewise.
	(construct_init_block): Likewise.
	* cfghooks.c (verify_flow_info): Likewise.
	* cfgloopmanip.c (remove_path): Likewise.
	* cfgrtl.c (rtl_verify_bb_layout): Likewise.
	* cgraph.c (cgraph_node::set_pure_flag): Likewise.
	* combine.c (simplify_if_then_else): Likewise.
	* config/i386/i386.c (ix86_setup_incoming_vararg_bounds): Likewise.
	(choose_basereg): Likewise.
	(ix86_expand_prologue): Likewise.
	(ix86_preferred_output_reload_class): Likewise.
	* cselib.c (cselib_record_sets): Likewise.
	* df-scan.c (df_scan_alloc): Likewise.
	* dojump.c (do_jump_by_parts_greater_rtx): Likewise.
	* early-remat.c (early_remat::record_equiv_candidates): Likewise.
	* emit-rtl.c (try_split): Likewise.
	* graphite-scop-detection.c (assign_parameter_index_in_region): Likewise.
	* ipa-cp.c (cgraph_edge_brings_all_agg_vals_for_node): Likewise.
	* ira-color.c (setup_profitable_hard_regs): Likewise.
	* ira.c (rtx_moveable_p): Likewise.
	* lra-eliminations.c (eliminate_regs_in_insn): Likewise.
	* read-rtl.c (read_subst_mapping): Likewise.
	* regrename.c (scan_rtx): Likewise.
	* reorg.c (fill_slots_from_thread): Likewise.
	* tree-inline.c (tree_function_versioning): Likewise.
	* tree-ssa-reassoc.c (optimize_ops_list): Likewise.
	* tree-ssa-sink.c (statement_sink_location): Likewise.
	* tree-ssa-threadedge.c (thread_across_edge): Likewise.
	* tree-vect-loop.c (vect_get_loop_niters): Likewise.
	(vect_create_epilog_for_reduction): Likewise.
	* tree.c (build_nonstandard_integer_type): Likewise.
2019-06-27  Martin Liska  <mliska@suse.cz>

	* class.c (adjust_clone_args): Remove obviously
	dead assignments.
	(dump_class_hierarchy_r): Likewise.
	* decl.c (check_initializer): Likewise.
	* parser.c (cp_parser_lambda_expression): Likewise.
	* pt.c (unify_bound_ttp_args): Likewise.
	(convert_template_argument): Likewise.
	* rtti.c (build_headof): Likewise.
	* typeck.c (convert_for_initialization): Likewise.
2019-06-27  Martin Liska  <mliska@suse.cz>

	* libgcov-driver-system.c (gcov_exit_open_gcda_file): Remove obviously
	dead assignments.
	* libgcov-util.c: Likewise.

From-SVN: r272744
2019-06-27 10:25:21 +00:00
Martin Liska c2f7a665a1 Fix misc stuff seen by clang-static-analyzer.
2019-06-27  Martin Liska  <mliska@suse.cz>

	* lto-dump.c (struct symbol_entry): Add default dtor.
	(struct variable_entry): Likewise.
	(struct function_entry): Likewise.
	(dump_list_functions): Release memory.
	(dump_list_variables): Likewise.
2019-06-27  Martin Liska  <mliska@suse.cz>

	* libgcov-util.c (gcov_profile_merge): Release allocated
	memory.
	(calculate_overlap): Likewise.

From-SVN: r272733
2019-06-27 08:21:32 +00:00
Iain Sandoe a8e55c61f8 [Darwin, PPC] Move the out of line register save/restore to an endfile.
We have been including this in libgcc, which means that we have to append
-lgcc even when using shared libgcc. In preparation for revision of libgcc
split this into an endfile.

gcc/
2019-06-25  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin.h (ENDFILE_SPEC): New.

libgcc/
2019-06-25  Iain Sandoe  <iain@sandoe.co.uk>

	* config.host: Add libef_ppc.a to the extra files for powerpc-darwin.
	* config/rs6000/t-darwin: (PPC_ENDFILE_SRC, PPC_ENDFILE_OBJS): New.
	Build objects for the out of line save/restore register functions
	so that they can be used for any supported Darwin version.
	* config/t-darwin: Default the build Darwin version to Darwin8
	(MacOS 10.4).

From-SVN: r272659
2019-06-25 20:11:11 +00:00
Martin Liska e5ce4cbc72 Do not call strlen with NULL argument in libgcov.
2019-06-25  Martin Liska  <mliska@suse.cz>

	* libgcov-driver-system.c (replace_filename_variables): Do not
	call strlen with NULL argument.

From-SVN: r272650
2019-06-25 11:49:36 +00:00
Andrew Stubbs 52a47d2856 Stub implementation of unwinding for AMD GCN.
2019-06-25  Andrew Stubbs  <ams@codesourcery.com>

	libgcc/
	* config/gcn/t-amdgcn (LIB2ADD): Add unwind-gcn.c.
	* config/gcn/unwind-gcn.c: New file.

From-SVN: r272648
2019-06-25 11:41:33 +00:00
Kwok Cheung Yeung 76d4633107 Create GCN-specific gthreads
2019-06-25  Kwok Cheung Yeung  <kcy@codesourcery.com>
            Andrew Stubbs  <ams@codesourcery.com>

        gcc/
	* config.gcc (thread_file): Set to gcn for AMD GCN.
	* config/gcn/gcn.c (gcn_emutls_var_init): New function.
	(TARGET_EMUTLS_VAR_INIT): New hook.

	config/
	* gthr.m4 (GCC_AC_THREAD_HEADER): Add case for gcn.

	libgcc/
	* configure: Regenerate.
	* config/gcn/gthr-gcn.h: New.

Co-Authored-By: Andrew Stubbs <ams@codesourcery.com>

From-SVN: r272647
2019-06-25 11:41:29 +00:00
Tom de Vries 787783a035 [nvptx] Fix __main missing prototype warning in crt0.c
Atm we see:
...
libgcc/config/nvptx/crt0.c:36:1: warning: no previous prototype for \
  ‘__main’ [-Wmissing-prototypes]
...

Fix this by adding the prototype.

Build and reg-tested on nvptx.
Build and reg-tested on x86_64 with nvptx accelerator.

2019-06-18  Tom de Vries  <tdevries@suse.de>

	* config/nvptx/crt0.c (__main): Declare.

From-SVN: r272412
2019-06-18 09:19:28 +00:00
Matthew Green f32f75858a [netbsd][aarch64] add netbsd/aarch64 target
Initial support for AArch64 running NetBSD.

Matthew Green <mrg@eterna.com.au>
Maya Rashish <coypu@sdf.org>

gcc:
	* config.gcc (aarch64*-*-netbsd*): New target.
	* config/aarch64/aarch64-netbsd.h: New file.
	* config/aarch64/t-aarch64-netbsd: Likewise.

libgcc:
	* config.host (aarch64*-*-netbsd*): New case.

Co-Authored-By: Maya Rashish <coypu@sdf.org>

From-SVN: r272387
2019-06-17 14:43:11 +00:00
Jozef Lawrynowicz 0fcc78f79e MSP430: Implement 64-bit shifts in assembly code
gcc/ChangeLog:

2019-06-16  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config/msp430/msp430.c (msp430_expand_helper): Setup arguments which
	describe how to perform MSPABI compliant 64-bit shift.
	* config/msp430/msp430.md (ashldi3): New define_expand.
	(ashrdi3): New define_expand.
	(lshrdi3): New define_expand.

libgcc/ChangeLog:

2019-06-16  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config/msp430/slli.S (__mspabi_sllll): New library function for
	performing a logical left shift of a 64-bit value.
	* config/msp430/srai.S (__mspabi_srall): New library function for
	performing a arithmetic right shift of a 64-bit value.
	* config/msp430/srll.S (__mspabi_srlll): New library function for
	performing a logical right shift of a 64-bit value.

gcc/testsuite/ChangeLog:

2019-06-16  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* gcc.target/msp430/mspabi_sllll.c: New test.
	* gcc.target/msp430/mspabi_srall.c: New test.
	* gcc.target/msp430/mspabi_srlll.c: New test.
	* gcc.c-torture/execute/shiftdi-2.c: New test.

From-SVN: r272360
2019-06-16 21:24:56 +00:00
Matt Thomas b27c108234 [NetBSD] Add support for the Arm EABI.
This is a roll-up of a set of changes needed to support the Arm EABI on NetBSD.

2019-06-14  Matt Thomas  <matt@3am-software.com>
	    Matthew Green  <mrg@eterna.com.au>
	    Nick Hudson  <skrll@netbsd.org>
	    Maya Rashish  <coypu@sdf.org>
	    Richard Earnshaw  <rearnsha@arm.com>

gcc:

	* config.gcc (arm*-*-netbsdelf*) Add support for EABI configuration.
	* config.host (arm*-*-netbsd*): Use driver-arm.o on native NetBSD.
	* config/arm/netbsd-eabi.h: New file.
	* config/arm/netbsd-elf.h (TARGET_OS_CPP_BUILTINS): Undefine before
	redefining.
	(SUBTARGET_EXTRA_ASM_SPEC): Don't pass -matpcs to the assembler.
	* config/netbsd-elf.h (NETBSD_LINK_LD_ELF_SO_SPEC): New define.
	(NETBSD_SUBTARGET_EXTRA_SPECS): New define.
	(SUBTARGET_EXTRA_SPECS): Define to NETBSD_SUBTARGET_EXTRA_SPECS.

libatomic:
	* configure.tgt (arm*): Handle NetBSD in the same way as FreeBSD.

libgcc:
	* config.host (arm*-*-netbsdelf*): Add support for EABI configurations.
	* config/arm/t-netbsd (LIB1ASMFUNCS): Add some additional assembler
	functions to build.
	* config/arm/t-netbsd-eabi: New file.


Co-Authored-By: Matthew Green <mrg@eterna.com.au>
Co-Authored-By: Maya Rashish <coypu@sdf.org>
Co-Authored-By: Nick Hudson <skrll@netbsd.org>
Co-Authored-By: Richard Earnshaw <rearnsha@arm.com>

From-SVN: r272290
2019-06-14 14:04:20 +00:00
Dimitar Dimitrov ae7deb4b85 Initial TI PRU libgcc port
libgcc/ChangeLog:

2019-06-12  Dimitar Dimitrov  <dimitar@dinux.eu>

	* config.host: Add PRU target.
	* config/pru/asri.c: New file.
	* config/pru/eqd.c: New file.
	* config/pru/eqf.c: New file.
	* config/pru/ged.c: New file.
	* config/pru/gef.c: New file.
	* config/pru/gtd.c: New file.
	* config/pru/gtf.c: New file.
	* config/pru/led.c: New file.
	* config/pru/lef.c: New file.
	* config/pru/lib2bitcountHI.c: New file.
	* config/pru/lib2divHI.c: New file.
	* config/pru/lib2divQI.c: New file.
	* config/pru/lib2divSI.c: New file.
	* config/pru/libgcc-eabi.ver: New file.
	* config/pru/ltd.c: New file.
	* config/pru/ltf.c: New file.
	* config/pru/mpyll.S: New file.
	* config/pru/pru-abi.h: New file.
	* config/pru/pru-asm.h: New file.
	* config/pru/pru-divmod.h: New file.
	* config/pru/sfp-machine.h: New file.
	* config/pru/t-pru: New file.

From-SVN: r272204
2019-06-12 19:28:51 +00:00
Jakub Jelinek 0d7b3e477b * libgcov-merge.c (__gcov_merge_single): Revert previous change.
From-SVN: r272143
2019-06-11 09:54:17 +02:00
Martin Liska 54e2d83caf Add missing ATTR_UNUSED (PR bootstrap/90808).
2019-06-10  Martin Liska  <mliska@suse.cz>

	PR bootstrap/90808
	* libgcov.h: Add ATTRIBUTE_UNUSED.

From-SVN: r272114
2019-06-10 09:53:46 +00:00
Martin Liska 92d417175b Implement N disk counters for single value and indirect call counters.
2019-06-10  Martin Liska  <mliska@suse.cz>

	* gcov-io.h (GCOV_DISK_SINGLE_VALUES): New.
	(GCOV_SINGLE_VALUE_COUNTERS): Likewise.
	* ipa-profile.c (ipa_profile_generate_summary):
	Use get_most_common_single_value.
	* tree-profile.c (gimple_init_gcov_profiler):
	Instrument with __gcov_one_value_profiler_v2
	and __gcov_indirect_call_profiler_v4.
	* value-prof.c (dump_histogram_value):
	Print all values for HIST_TYPE_SINGLE_VALUE.
	(stream_out_histogram_value): Update assert for
	N values.
	(stream_in_histogram_value): Set number of
	counters for HIST_TYPE_SINGLE_VALUE.
	(get_most_common_single_value): New.
	(gimple_divmod_fixed_value_transform):
	Use get_most_common_single_value.
	(gimple_ic_transform): Likewise.
	(gimple_stringops_transform): Likewise.
	(gimple_find_values_to_profile): Set number
	of counters for HIST_TYPE_SINGLE_VALUE.
	* value-prof.h (get_most_common_single_value):
	New.
2019-06-10  Martin Liska  <mliska@suse.cz>

	* Makefile.in: Add __gcov_one_value_profiler_v2,
	__gcov_one_value_profiler_v2_atomic and
	__gcov_indirect_call_profiler_v4.
	* libgcov-merge.c (__gcov_merge_single): Change
	function signature.
	(merge_single_value_set): New.
	* libgcov-profiler.c (__gcov_one_value_profiler_body):
	Update functionality.
	(__gcov_one_value_profiler): Remove.
	(__gcov_one_value_profiler_v2): ... this.
	(__gcov_one_value_profiler_atomic): Rename to ...
	(__gcov_one_value_profiler_v2_atomic): this.
	(__gcov_indirect_call_profiler_v3): Rename to ...
	(__gcov_indirect_call_profiler_v4): ... this.
	* libgcov.h (__gcov_one_value_profiler): Remove.
	(__gcov_one_value_profiler_atomic): Remove.
	(__gcov_one_value_profiler_v2_atomic): New.
	(__gcov_indirect_call_profiler_v3): Remove.
	(__gcov_one_value_profiler_v2): New.
	(__gcov_indirect_call_profiler_v4): New.
	(gcov_get_counter_ignore_scaling): New function.

From-SVN: r272106
2019-06-10 07:38:59 +00:00
Martin Liska e37333bad7 Remove indirect call top N counter type.
2019-06-07  Martin Liska  <mliska@suse.cz>

	* doc/invoke.texi: Remove param.
	* gcov-counter.def (GCOV_COUNTER_ICALL_TOPNV):
	Remove.
	* gcov-io.h (GCOV_ICALL_TOPN_VAL): Likewise.
	(GCOV_ICALL_TOPN_NCOUNTS): Likewise.
	* params.def (PARAM_INDIR_CALL_TOPN_PROFILE): Likewise.
	* profile.c (instrument_values): Remove
	HIST_TYPE_INDIR_CALL_TOPN.
	* tree-profile.c (init_ic_make_global_vars):
	Always build __gcov_indirect_call only.
	(gimple_init_gcov_profiler): Remove usage
	of PARAM_INDIR_CALL_TOPN_PROFILE.
	(gimple_gen_ic_profiler): Likewise.
	* value-prof.c (dump_histogram_value): Likewise.
	(stream_in_histogram_value): Likewise.
	(gimple_indirect_call_to_profile): Likewise.
	(gimple_find_values_to_profile): Likewise.
	* value-prof.h (enum hist_type): Likewise.
2019-06-07  Martin Liska  <mliska@suse.cz>

	* Makefile.in: Remove usage of
	_gcov_merge_icall_topn.
	* libgcov-driver.c (gcov_sort_n_vals): Remove.
	(gcov_sort_icall_topn_counter): Likewise.
	(gcov_sort_topn_counter_arrays): Likewise.
	(dump_one_gcov): Remove call to gcov_sort_topn_counter_arrays.
	* libgcov-merge.c (__gcov_merge_icall_topn): Remove.
	* libgcov-profiler.c (__gcov_topn_value_profiler_body):
	Likewise.
	(GCOV_ICALL_COUNTER_CLEAR_THRESHOLD): Remove.
	(struct indirect_call_tuple): Remove.
	(__gcov_indirect_call_topn_profiler): Remove.
	* libgcov-util.c (__gcov_icall_topn_counter_op): Remove.
	* libgcov.h (gcov_sort_n_vals): Remove.
	(L_gcov_merge_icall_topn): Likewise.
	(__gcov_merge_icall_topn): Likewise.
	(__gcov_indirect_call_topn_profiler): Likewise.

From-SVN: r272030
2019-06-07 06:41:58 +00:00
Iain Sandoe 34a4a9c2b5 Darwin, PowerPC, libgcc - Ensure unwinder is built with altivec enabled.
When libgcc is built on Darwin, it is usually built for the earliest potential
target (Darwin8, 10.4).  Build for that revision default to assuming that the
processor might be G3 (without vector ops) and there is an outlined function
used for save/restore that checks whether the processor is G3 or G4+ at run-
time.  However, the unwinder itself needs to be built with the assumption of
vector usage so that the relevant outlined functions are called.

2019-06-06  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/t-darwin: Ensure that the unwinder is built with
	altivec enabled.

From-SVN: r272017
2019-06-06 19:02:54 +00:00
Jozef Lawrynowicz d1b2f85f78 MSP430: Put libgcc shift functions in their own section
2019-06-06  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config/msp430/slli.S (__mspabi_slli_n): Put function in its own
	section.
	(__mspabi_slli): Likewise.
	(__mspabi_slll_n): Likewise.
	(__mspabi_slll): Likewise.
	* config/msp430/srai.S (__mspabi_srai_n): Likewise.
	(__mspabi_srai): Likewise.
	(__mspabi_sral_n): Likewise.
	(__mspabi_sral): Likewise.
	* config/msp430/srli.S (__mspabi_srli_n): Likewise.
	(__mspabi_srli): Likewise.
	(__mspabi_srll_n): Likewise.
	(__mspabi_srll): Likewise.

From-SVN: r271992
2019-06-06 09:07:36 +00:00
Yoshinori Sato e69a13d15d config.host (rx-*-linux*): Add t-fdpbit to tmake_file Add appropriate tm_file clause as well.
* config.host (rx-*-linux*): Add t-fdpbit to tmake_file
        Add appropriate tm_file clause as well.
        * config/rx/t-rx (HOST_LIBGCC2_CFLAGS): Remove.

From-SVN: r271978
2019-06-05 17:20:27 -06:00
James Clarke b009eac157 crtbegin.S (__dso_handle): Put in .sdata/.sbss rather than .data/.bss so it can be accessed via...
* config/ia64/crtbegin.S (__dso_handle): Put in .sdata/.sbss
	rather than .data/.bss so it can be accessed via gp-relative
	addressing.

From-SVN: r271977
2019-06-05 16:27:37 -06:00
David Edelsohn 781d39f26e aix-unwind.h (LR_REGNO): Rename to R_LR.
* config/rs6000/aix-unwind.h (LR_REGNO): Rename to R_LR.
(CR2_REGNO): Rename to R_CR2.
(XER_REGNO): Rename to R_XER.
(FIRST_ALTIVEC_REGNO): Rename to R_FIRST_ALTIVEC.
(VRSAVE_REGNO): Rename to R_VRSAVE.
(VSCR_REGNO): R_VSCR.

From-SVN: r271967
2019-06-05 12:45:57 -04:00
Yoshinori Sato 76aaa9cdb1 config.gcc (rx-*-linux*): New target.
* config.gcc (rx-*-linux*): New target.
	* config/rx/elf.opt: New file.
	* config/rx/linux.h: Likewise.
	* config/rx/t-linux: Likewise.
	* config/rx/rx.c (TARGET_SAVE_ACC_REGISTER): If not defined,
	make it zero.
	* config/rx/rx.h (ASM_APP_ON): Allow to be overridden.
	(ASM_APP_OFF): Likewise.
	* config/rx/rx.opt: Drop -msim and -mas100-syntax, they were
	moved elsewhere.

	* config.host (rx-*-linux*): Add new case.
	* config/rx/t-rx (HOST_LIBGCC2_CFLAGS): Force DFmode to SFmode.

From-SVN: r271748
2019-05-29 12:36:06 -06:00
Sam Tebbs 8fc16d7252 [PATCH 3/3][GCC][AARCH64] Add support for pointer authentication B key
gcc/
2019-05-29  Sam Tebbs  <sam.tebbs@arm.com>

	* config/aarch64/aarch64-builtins.c (aarch64_builtins): Add
	AARCH64_PAUTH_BUILTIN_AUTIB1716 and AARCH64_PAUTH_BUILTIN_PACIB1716.
	* config/aarch64/aarch64-builtins.c (aarch64_init_pauth_hint_builtins):
	Add autib1716 and pacib1716 initialisation.
	* config/aarch64/aarch64-builtins.c (aarch64_expand_builtin): Add checks
	for autib1716 and pacib1716.
	* config/aarch64/aarch64-protos.h (aarch64_key_type,
	aarch64_post_cfi_startproc): Define.
	* config/aarch64/aarch64-protos.h (aarch64_ra_sign_key): Define extern.
	* config/aarch64/aarch64.c (aarch64_handle_standard_branch_protection,
	aarch64_handle_pac_ret_protection): Set default sign key to A.
	* config/aarch64/aarch64.c (aarch64_expand_epilogue,
	aarch64_expand_prologue): Add check for b-key.
	* config/aarch64/aarch64.c (aarch64_ra_sign_key,
	aarch64_post_cfi_startproc, aarch64_handle_pac_ret_b_key): Define.
	* config/aarch64/aarch64.h (TARGET_ASM_POST_CFI_STARTPROC): Define.
	* config/aarch64/aarch64.c (aarch64_pac_ret_subtypes): Add "b-key".
	* config/aarch64/aarch64.md (unspec): Add UNSPEC_AUTIA1716,
	UNSPEC_AUTIB1716, UNSPEC_AUTIASP, UNSPEC_AUTIBSP, UNSPEC_PACIA1716,
	UNSPEC_PACIB1716, UNSPEC_PACIASP, UNSPEC_PACIBSP.
	* config/aarch64/aarch64.md (do_return): Add check for b-key.
	* config/aarch64/aarch64.md (<pauth_mnem_prefix>sp): Replace
	pauth_hint_num_a with pauth_hint_num.
	* config/aarch64/aarch64.md (<pauth_mnem_prefix>1716): Replace
	pauth_hint_num_a with pauth_hint_num.
	* config/aarch64/aarch64.opt (msign-return-address=): Deprecate.
	* config/aarch64/iterators.md (PAUTH_LR_SP): Add UNSPEC_AUTIASP,
	UNSPEC_AUTIBSP, UNSPEC_PACIASP, UNSPEC_PACIBSP.
	* config/aarch64/iterators.md (PAUTH_17_16): Add UNSPEC_AUTIA1716,
	UNSPEC_AUTIB1716, UNSPEC_PACIA1716, UNSPEC_PACIB1716.
	* config/aarch64/iterators.md (pauth_mnem_prefix): Add UNSPEC_AUTIA1716,
	UNSPEC_AUTIB1716, UNSPEC_PACIA1716, UNSPEC_PACIB1716, UNSPEC_AUTIASP,
	UNSPEC_AUTIBSP, UNSPEC_PACIASP, UNSPEC_PACIBSP.
	* config/aarch64/iterators.md (pauth_hint_num_a): Replace
	UNSPEC_PACI1716 and UNSPEC_AUTI1716 with UNSPEC_PACIA1716 and
	UNSPEC_AUTIA1716 respectively.
	* config/aarch64/iterators.md (pauth_hint_num_a): Rename to pauth_hint_num
	and add UNSPEC_PACIBSP, UNSPEC_AUTIBSP, UNSPEC_PACIB1716, UNSPEC_AUTIB1716.
	* doc/invoke.texi (-mbranch-protection): Add b-key type.
	* config/aarch64/aarch64-bti-insert.c (aarch64_pac_insn_p): Rename
	UNSPEC_PACISP to UNSPEC_PACIASP and UNSPEC_PACIBSP.

gcc/testsuite
2019-05-29  Sam Tebbs  <sam.tebbs@arm.com>

	* gcc.target/aarch64/return_address_sign_b_1.c: New file.
	* gcc.target/aarch64/return_address_sign_b_2.c: New file.
	* gcc.target/aarch64/return_address_sign_b_3.c: New file.
	* gcc.target/aarch64/return_address_sign_b_exception.c: New file.
	* gcc.target/aarch64/return_address_sign_ab_exception.c: New file.
	* gcc.target/aarch64/return_address_sign_builtin.c: New file

libgcc/
2019-05-29  Sam Tebbs  <sam.tebbs@arm.com>

	* config/aarch64/aarch64-unwind.h (aarch64_cie_signed_with_b_key): New
	function.
	* config/aarch64/aarch64-unwind.h (aarch64_post_extract_frame_addr,
	aarch64_post_frob_eh_handler_addr): Add	check for b-key.
	* config/aarch64/aarch64-unwind-h (aarch64_post_extract_frame_addr,
	aarch64_post_frob_eh_handler_addr, aarch64_post_frob_update_context):
	Rename RA_A_SIGNED_BIT to RA_SIGNED_BIT.
	* unwind-dw2-fde.c (get_cie_encoding): Add check for 'B' in augmentation
	string.
	* unwind-dw2.c (extract_cie_info): Add check for 'B' in augmentation
	string.
	(RA_A_SIGNED_BIT): Rename to RA_SIGNED_BIT.

From-SVN: r271735
2019-05-29 09:22:17 +00:00
Rainer Orth e54b1a92ac Remove pre-Solaris 11/SPARC unwinding support
* config/sparc/sol2-unwind.h [__arch64__] (sparc64_is_sighandler):
	Remove Solaris 9 and 10 support.
	(sparc_is_sighandler): Likewise.

From-SVN: r271715
2019-05-28 17:27:51 +00:00
John David Anglin abbb83070a linux-unwind.h (pa32_fallback_frame_state): Add cast.
* config/pa/linux-unwind.h (pa32_fallback_frame_state): Add cast.

From-SVN: r271631
2019-05-26 15:16:50 +00:00
H.J. Lu 2581344df6 soft-fp: Update soft-fp from glibc
This patch is updating all soft-fp from glibc, most changes are
copyright years update, and changes other than years update are

	* soft-fp/extenddftf2.c: Use "_FP_W_TYPE_SIZE < 64" to check if
	4_FP_W_TYPEs are used for IEEE quad precision.
	* soft-fp/extendhftf2.c: Likewise.
	* soft-fp/extendsftf2.c: Likewise.
	* soft-fp/extendxftf2.c: Likewise.
	* soft-fp/trunctfdf2.c: Likewise.
	* soft-fp/trunctfhf2.c: Likewise.
	* soft-fp/trunctfsf2.c: Likewise.
	* soft-fp/trunctfxf2.c: Likewise.
	* config/rs6000/ibm-ldouble.c: Likewise.

From-SVN: r271327
2019-05-17 07:37:39 -07:00
Rainer Orth ccd1242eec Remove obsolete Solaris 10 support
libstdc++-v3:
	* config/os/solaris/solaris2.10: Move to ...
	* config/os/solaris: ... this.
	* configure.host (os_include_dir): Adapt.
	(abi_baseline_pair): Remove Solaris 10 handling.
	* config/abi/post/i386-solaris2.10: Remove.
	* config/abi/post/sparc-solaris2.10: Remove.
	* config/abi/post/i386-solaris2.11: Rename to ...
	* config/abi/post/i386-solaris: ... this.
	* config/abi/post/sparc-solaris2.11: Rename to ...
	* config/abi/post/sparc-solaris: ... this.

	* libsupc++/new_opa.cc [_GLIBCXX_HAVE_MEMALIGN] [__sun]: Remove
	workaround.

	* testsuite/ext/enc_filebuf/char/13598.cc: Remove *-*-solaris2.10
	xfail.

	libsanitizer:
	* configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
	handling.
	* configure: Regenerate.

	libgcc:
	* config.host: Simplify various *-*-solaris2.1[0-9]* to
	*-*-solaris2*.
	* configure.ac: Likewise.
	* configure: Regenerate.

	* config/i386/sol2-unwind.h (x86_fallback_frame_state): Remove
	Solaris 10 and Solaris 11 < snv_125 handling.

	libbacktrace:
	* configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
	handling.
	* configure: Regenerate.

	gcc/testsuite:
	* gcc.dg/atomic/c11-atomic-exec-4.c: Simplify triplet to
	*-*-solaris2*.
	* gcc.dg/atomic/c11-atomic-exec-5.c: Likewise.
	* gcc.dg/c99-math-double-1.c: Likewise.
	* gcc.dg/c99-math-float-1.c: Likewise.
	* gcc.dg/c99-math-long-double-1.c: Likewise.
	* gcc.misc-tests/linkage.exp: Simplify triplet to
	x86_64-*-solaris2*.

	* gcc.target/i386/mcount_pic.c: Remove *-*-solaris2.10* && !gld
	xfail.
	* gcc.target/i386/pr63620.c: Likewise.

	* lib/target-supports.exp (check_sse_os_support_available): Remove
	Solaris 9/x86 workaround.

	gcc:
	* config.gcc: Move *-*-solaris2.10* from obsolete configurations
	to unsupported ones.
	Simplify x86_64-*-solaris2.1[0-9]* to x86_64-*-solaris2*.
	* config.host: Likewise.
	* config/i386/sol2.h (ASM_COMMENT_START): Remove.
	* config/sparc/driver-sparc.c (host_detect_local_cpu) [__sun__ &&
	__svr4__]: Remove "brand" fallback.
	[!KSTAT_DATA_STRING]: Remove.
	* configure.ac (gcc_cv_ld_hidden): Simplify *-*-solaris2.1[0-9]*
	to *-*-solaris2*.
	(comdat_group): Likewise.
	(set_have_as_tls): Likewise.
	(gcc_cv_target_dl_iterate_phdr): Likewise.
	(gcc_cv_as_shf_merge): Remove Solaris 10/x86 workaround.
	(gcc_cv_ld_aligned_shf_merge): Remove Solaris 10/SPARC workaround.
	* configure: Regenerate.
	* doc/install.texi: Simplify Solaris target triplets.
	(Specific, i?86-*-solaris2*): Remove Solaris 10 references.
	(Specific, *-*-solaris2*): Document Solaris 10 removal.
	Remove Solaris 10 references.
	Remove obsolete Solaris bug reference.
	(Specific, sparc-sun-solaris2.10): Remove.

From-SVN: r271183
2019-05-14 17:17:23 +00:00
Iain Sandoe ef5eb79dfd darwin, powerpc - set .machine in an asm file.
The asm file fails to build if we use a modern assembler
which checks that the machine is consistent with the 
filetype.  Fixed by adjusting in a similar manner to 
other assembler.

libgcc/

2019-05-12  Iain Sandoe  <iain@sandoe.co.uk>

	* config/rs6000/darwin-vecsave.S: Set .machine appropriately.

From-SVN: r271111
2019-05-12 19:26:16 +00:00
Hongtao Liu 4f0e90fae9 Enable support for bfloat16 which will be in Future Cooper Lake.
There are 3 instructions for AVX512BF16: VCVTNE2PS2BF16, VCVTNEPS2BF16 and
DPBF16PS instructions, which are Vector Neural Network Instructions
supporting:
    
- VCVTNE2PS2BF16: Convert Two Packed Single Data to One Packed BF16 Data.
- VCVTNEPS2BF16: Convert Packed Single Data to Packed BF16 Data.
- VDPBF16PS: Dot Product of BF16 Pairs Accumulated into Packed Single Precision.

2019-05-07  Wei Xiao  <wei3.xiao@intel.com>

	* common/config/i386/i386-common.c (OPTION_MASK_ISA_AVX512BF16_SET
	OPTION_MASK_ISA_AVX512BF16_UNSET, OPTION_MASK_ISA2_AVX512BW_UNSET): New.
	(OPTION_MASK_ISA2_AVX512F_UNSET): Add OPTION_MASK_ISA_AVX512BF16_UNSET.
	(ix86_handle_option): Handle -mavx512bf16.
	* config.gcc: Add avx512bf16vlintrin.h and avx512bf16intrin.h
	to extra_headers.
	* config/i386/avx512bf16vlintrin.h: New.
	* config/i386/avx512bf16intrin.h: New.
	* config/i386/cpuid.h (bit_AVX512BF16): New.
	* config/i386/driver-i386.c (host_detect_local_cpu): Detect BF16.
	* config/i386/i386-builtin-types.def: Add new types.
	* config/i386/i386-builtin.def: Add new builtins.
	* config/i386/i386-c.c (ix86_target_macros_internal): Define
	__AVX512BF16__.
	* config/i386/i386-option.c (ix86_target_string): Add -mavx512bf16.
	(ix86_option_override_internal): Handle BF16.
	(ix86_valid_target_attribute_inner_p): Ditto.
	* config/i386/i386-expand.c (ix86_expand_args_builtin): Ditto.
	* config/i386/i386-builtin.c (enum processor_features): Add
	F_AVX512BF16.
	(static const _isa_names_table isa_names_table): Ditto.
	* config/i386/i386.h (TARGET_AVX512BF16, TARGET_AVX512BF16_P): New.
	(PTA_AVX512BF16): Ditto.
	* config/i386/i386.opt: Add -mavx512bf16.
	* config/i386/immintrin.h: Include avx512bf16intrin.h
	and avx512bf16vlintrin.h.
	* config/i386/sse.md (avx512f_cvtne2ps2bf16_<mode><mask_name>,
	avx512f_cvtneps2bf16_<mode><mask_name>,
	avx512f_dpbf16ps_<mode><mask_half_name>): New define_insn patterns.
	* config/i386/subst.md (mask_half): Add new subst.
	* doc/invoke.texi: Document -mavx512bf16.

2019-05-07  Wei Xiao  <wei3.xiao@intel.com>

	* gcc.target/i386/avx512bf16-vcvtne2ps2bf16-1.c: New test.
	* gcc.target/i386/avx512bf16-vcvtneps2bf16-1.c: New test.
	* gcc.target/i386/avx512bf16-vdpbf16ps-1.c: New test.
	* gcc.target/i386/avx512bf16vl-vcvtne2ps2bf16-1.c: New test.
	* gcc.target/i386/avx512bf16vl-vcvtneps2bf16-1.c: New test.
	* gcc.target/i386/avx512bf16vl-vdpbf16ps-1.c: New test.
	* gcc.target/i386/builtin_target.c: Handle avx512bf16.
	* gcc.target/i386/sse-12.c: Add -mavx512bf16.
	* gcc.target/i386/sse-13.c: Ditto.
	* gcc.target/i386/sse-14.c: Ditto.
	* gcc.target/i386/sse-22.c: Ditto.
	* gcc.target/i386/sse-23.c: Ditto.
	* g++.dg/other/i386-2.C: Ditto.
	* g++.dg/other/i386-3.C: Ditto.

2019-05-07  Hongtao Liu  <hongtao.liu@intel.com>

	* config/i386/cpuinfo.c (get_available_features): Detect BF16.
	* config/i386/cpuinfo.h (enum processor_features): Add
	FEATURE_AVX512BF16.

From-SVN: r271006
2019-05-08 10:21:40 +00:00
Ramana Radhakrishnan 48528842bd re PR target/89093 (C++ exception handling clobbers d8 VFP register)
PR target/89093
	* config/arm/arm.c (aapcs_vfp_is_call_or_return_candidate): Diagnose
	if used with general-regs-only.
	(arm_conditional_register_usage): Don't add non-general regs if
	general-regs-only.
	(arm_valid_target_attribute_rec): Handle general-regs-only.
	* config/arm/arm.h (TARGET_HARD_FLOAT): Return false if
	general-regs-only.
	(TARGET_HARD_FLOAT_SUB): Define.
	(TARGET_SOFT_FLOAT): Define as negation of TARGET_HARD_FLOAT_SUB.
	(TARGET_REALLY_IWMMXT): Add && !TARGET_GENERAL_REGS_ONLY.
	(TARGET_REALLY_IWMMXT2): Likewise.
	* config/arm/arm.opt: Add -mgeneral-regs-only.
	* doc/extend.texi: Document ARM general-regs-only target.
	* doc/invoke.texi: Document ARM -mgeneral-regs-only.
libgcc/
	* config/arm/pr-support.c: Add #pragma GCC target("general-regs-only").
	* config/arm/unwind-arm.c: Likewise.
	* unwind-c.c (PERSONALITY_FUNCTION): Add general-regs-only target
	attribute for ARM.
libobjc/
	* exception.c (PERSONALITY_FUNCTION): Add general-regs-only target
	attribute for ARM.
libphobos/
	* libdruntime/gcc/deh.d: Import gcc.attribute.
	(personality_fn_attributes): New enum.
	(scanLSDA, CONTINUE_UNWINDING, gdc_personality, __gdc_personality):
	Add @personality_fn_attributes.
libstdc++-v3/
	* libsupc++/eh_personality.cc (PERSONALITY_FUNCTION): Add
	general-regs-only target attribute for ARM.

Co-Authored-By: Bernd Edlinger <bernd.edlinger@hotmail.de>
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r270504
2019-04-23 12:03:41 +02:00
Monk Chiang 887e182f05 [NDS32] Refine force unwind. Linux kernel only uses RT_SIGRETURN.
libgcc/
	* config/nds32/linux-unwind.h (SIGRETURN): Remove.
	(RT_SIGRETURN): Update.
	(nds32_fallback_frame_state): Update.

From-SVN: r270363
2019-04-15 08:19:23 +00:00
Martin Sebor a90b0cdd44 extend.texi (__clear_cache): Correct signature.
gcc/ChangeLog:

	* doc/extend.texi (__clear_cache): Correct signature.

libgcc/ChangeLog:

	* libgcc2.h (__clear_cache): Correct signature.
	* libgcc2.c (__clear_cache): Same.

gcc/testsuite/ChangeLog:

	* gcc.dg/Wbuiltin-declaration-mismatch-12.c: New test.

From-SVN: r269082
2019-02-21 16:23:12 -07:00
Uros Bizjak 1ed28eda9f linux-unwind.h (alpha_fallback_frame_state): Cast 'mcontext_t *' &rt_->uc.uc_mcontext to 'struct sigcontext *'.
* config/alpha/linux-unwind.h (alpha_fallback_frame_state):
	Cast 'mcontext_t *' &rt_->uc.uc_mcontext to 'struct sigcontext *'.

From-SVN: r269053
2019-02-20 22:37:21 +01:00
Uros Bizjak fe95aee9ce unwind-dw2.c (_Unwind_GetGR): Compare regno instead of index to DWARF_ZERO_REG.
* unwind-dw2.c (_Unwind_GetGR) [DWARF_ZERO_REG]: Compare
	regno instead of index to DWARF_ZERO_REG.

From-SVN: r269021
2019-02-19 17:10:00 +01:00
Eric Botcazou bf7988f1e9 lib2funcs.c (__set_trampoline_parity): Replace TRAMPOLINE_SIZE with __LIBGCC_TRAMPOLINE_SIZE__.
libgcc/
	* config/visium/lib2funcs.c (__set_trampoline_parity): Replace
	TRAMPOLINE_SIZE with __LIBGCC_TRAMPOLINE_SIZE__.
gcc/
	* final.c (insn_current_reference_address): Replace test on JUMP_P
	with test on jump_to_label_p.
	* config/visium/visium-passes.def: New file.
	* config/visium/t-visium (PASSES_EXTRA): Define.
	* config/visium/visium-protos.h (make_pass_visium_reorg): Declare.
	* config/visium/visium.h (TRAMPOLINE_SIZE): Adjust.
	(TRAMPOLINE_ALIGNMENT): Define.
	* config/visium/visium.c (visium_option_override): Do not register
	the machine-specific reorg pass here.
	(visium_trampoline_init): Align the BRA insn on a 64-bit boundary
	for the GR6.
	(output_branch): Adjust threshold for long branch instruction.
	* config/visium/visium.md (cpu): Move around.
	(length): Adjust for the GR6.

From-SVN: r268931
2019-02-15 10:40:34 +00:00
Uros Bizjak ba2c1ca8c3 t-linux: Add -mfp-rounding-mode=d to HOST_LIBGCC2_CFLAGS.
* config/alpha/t-linux: Add -mfp-rounding-mode=d
	to HOST_LIBGCC2_CFLAGS.

From-SVN: r268430
2019-01-31 21:49:02 +01:00
H.J. Lu 6395ba73f8 libgcc2.c: Correct DI/TI -> SF/DF conversions
FSTYPE FUNC (DWtype u) in libgcc2.c, which converts DI/TI to SF/DF, has

  /* No leading bits means u == minimum.  */
  if (count == 0)
    return -(Wtype_MAXp1_F * (Wtype_MAXp1_F / 2));

in the third case (where actually count == 0 only means the high part is
minimum).  It should be:

  /* No leading bits means u == minimum.  */
  if (count == 0)
    return Wtype_MAXp1_F * (FSTYPE) (hi | ((UWtype) u != 0));

instead.

gcc/testsuite/

2019-01-23  H.J. Lu  <hongjiu.lu@intel.com>

	PR libgcc/88931
	* gcc.dg/torture/fp-int-convert-timode-1.c: New test.
	* gcc.dg/torture/fp-int-convert-timode-2.c: Likewise.
	* gcc.dg/torture/fp-int-convert-timode-3.c: Likewise.
	* gcc.dg/torture/fp-int-convert-timode-4.c: Likewise.

libgcc/

2019-01-23  Joseph Myers  <joseph@codesourcery.com>

	PR libgcc/88931
	* libgcc2.c (FSTYPE FUNC (DWtype u)): Correct no leading bits
	case.

From-SVN: r268216
2019-01-23 13:41:59 -08:00
Martin Liska 756721ba89 Bump version of __gcov_indirect_call_profiler function as there was ABI change.
2019-01-18  Martin Liska  <mliska@suse.cz>

	* params.def: Fix comment.
	* tree-profile.c (gimple_init_gcov_profiler): Bump function
	name.
	(gimple_gen_ic_func_profiler): Likewise.
2019-01-18  Martin Liska  <mliska@suse.cz>

	* gcc.dg/no_profile_instrument_function-attr-1.c: Update
	expected function name.
2019-01-18  Martin Liska  <mliska@suse.cz>

	* libgcov-profiler.c (__gcov_indirect_call_profiler_v2): Rename
	to ...
	(__gcov_indirect_call_profiler_v3): ... this.
	* libgcov.h (__gcov_indirect_call_profiler_v2): Likewise.
	(__gcov_indirect_call_profiler_v3): Likewise.
	* Makefile.in: Bump function name.

From-SVN: r268071
2019-01-18 11:32:53 +00:00
Martin Liska d273c40a55 Update error message prefix in libgcov profiling.
2019-01-18  Martin Liska  <mliska@suse.cz>

	* libgcov-driver.c (GCOV_PROF_PREFIX): Define.
	(gcov_version): Use in gcov_error.
	(merge_one_data): Likewise.
	(dump_one_gcov): Likewise.

From-SVN: r268070
2019-01-18 11:31:45 +00:00
Martin Liska be9d9fdbed Describe better version mismatch in libgcov driver.
2019-01-18  Martin Liska  <mliska@suse.cz>

	* libgcov-driver.c (gcov_version_string): New function.
	(gcov_version): Convert version integer into string.

From-SVN: r268069
2019-01-18 11:30:56 +00:00
Andrew Stubbs 91d7b7fe84 GCN libgcc.
This patch contains the GCN port of libgcc.

2019-01-17  Andrew Stubbs  <ams@codesourcery.com>
	    Kwok Cheung Yeung  <kcy@codesourcery.com>
	    Julian Brown  <julian@codesourcery.com>
	    Tom de Vries  <tom@codesourcery.com>

	libgcc/
	* config.host: Recognize amdgcn*-*-amdhsa.
	* config/gcn/crt0.c: New file.
	* config/gcn/lib2-divmod-hi.c: New file.
	* config/gcn/lib2-divmod.c: New file.
	* config/gcn/lib2-gcn.h: New file.
	* config/gcn/sfp-machine.h: New file.
	* config/gcn/t-amdgcn: New file.


Co-Authored-By: Julian Brown <julian@codesourcery.com>
Co-Authored-By: Kwok Cheung Yeung <kcy@codesourcery.com>
Co-Authored-By: Tom de Vries <tom@codesourcery.com>

From-SVN: r268021
2019-01-17 12:29:13 +00:00
Sandra Loosemore 6791469314 PR other/16615 [1/5]
2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>

	PR other/16615 [1/5]

	contrib/
	* mklog: Mechanically replace "can not" with "cannot".

	gcc/
	* Makefile.in: Mechanically replace "can not" with "cannot".
	* alias.c: Likewise.
	* builtins.c: Likewise.
	* calls.c: Likewise.
	* cgraph.c: Likewise.
	* cgraph.h: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* combine-stack-adj.c: Likewise.
	* combine.c: Likewise.
	* common/config/i386/i386-common.c: Likewise.
	* config/aarch64/aarch64.c: Likewise.
	* config/alpha/sync.md: Likewise.
	* config/arc/arc.c: Likewise.
	* config/arc/predicates.md: Likewise.
	* config/arm/arm-c.c: Likewise.
	* config/arm/arm.c: Likewise.
	* config/arm/arm.h: Likewise.
	* config/arm/arm.md: Likewise.
	* config/arm/cortex-r4f.md: Likewise.
	* config/csky/csky.c: Likewise.
	* config/csky/csky.h: Likewise.
	* config/darwin-f.c: Likewise.
	* config/epiphany/epiphany.md: Likewise.
	* config/i386/i386.c: Likewise.
	* config/i386/sol2.h: Likewise.
	* config/m68k/m68k.c: Likewise.
	* config/mcore/mcore.h: Likewise.
	* config/microblaze/microblaze.md: Likewise.
	* config/mips/20kc.md: Likewise.
	* config/mips/sb1.md: Likewise.
	* config/nds32/nds32.c: Likewise.
	* config/nds32/predicates.md: Likewise.
	* config/pa/pa.c: Likewise.
	* config/rs6000/e300c2c3.md: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/s390/s390.h: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sh/sh.md: Likewise.
	* config/spu/vmx2spu.h: Likewise.
	* cprop.c: Likewise.
	* dbxout.c: Likewise.
	* df-scan.c: Likewise.
	* doc/cfg.texi: Likewise.
	* doc/extend.texi: Likewise.
	* doc/fragments.texi: Likewise.
	* doc/gty.texi: Likewise.
	* doc/invoke.texi: Likewise.
	* doc/lto.texi: Likewise.
	* doc/md.texi: Likewise.
	* doc/objc.texi: Likewise.
	* doc/rtl.texi: Likewise.
	* doc/tm.texi: Likewise.
	* dse.c: Likewise.
	* emit-rtl.c: Likewise.
	* emit-rtl.h: Likewise.
	* except.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* fold-const.c: Likewise.
	* genautomata.c: Likewise.
	* gimple-fold.c: Likewise.
	* hard-reg-set.h: Likewise.
	* ifcvt.c: Likewise.
	* ipa-comdats.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-fnsummary.c: Likewise.
	* ipa-icf.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-polymorphic-call.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-visibility.c: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-conflicts.c: Likewise.
	* ira-costs.c: Likewise.
	* ira-int.h: Likewise.
	* ira-lives.c: Likewise.
	* ira.c: Likewise.
	* ira.h: Likewise.
	* loop-invariant.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lra-assigns.c: Likewise.
	* lra-constraints.c: Likewise.
	* lra-eliminations.c: Likewise.
	* lra-lives.c: Likewise.
	* lra-remat.c: Likewise.
	* lra-spills.c: Likewise.
	* lra.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* postreload-gcse.c: Likewise.
	* predict.c: Likewise.
	* profile-count.h: Likewise.
	* profile.c: Likewise.
	* recog.c: Likewise.
	* ree.c: Likewise.
	* reload.c: Likewise.
	* reload1.c: Likewise.
	* reorg.c: Likewise.
	* resource.c: Likewise.
	* rtl.def: Likewise.
	* rtl.h: Likewise.
	* rtlanal.c: Likewise.
	* sched-deps.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-rgn.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched.c: Likewise.
	* shrink-wrap.c: Likewise.
	* simplify-rtx.c: Likewise.
	* symtab.c: Likewise.
	* target.def: Likewise.
	* toplev.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-core.h: Likewise.
	* tree-eh.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-phionlycprop.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.
	* vr-values.c: Likewise.

	gcc/ada/
	* exp_ch9.adb: Mechanically replace "can not" with "cannot".
	* libgnat/s-regpat.ads: Likewise.
	* par-ch4.adb: Likewise.
	* set_targ.adb: Likewise.
	* types.ads: Likewise.

	gcc/cp/
	* cp-tree.h: Mechanically replace "can not" with "cannot".
	* parser.c: Likewise.
	* pt.c: Likewise.

	gcc/fortran/
	* class.c: Mechanically replace "can not" with "cannot".
	* decl.c: Likewise.
	* expr.c: Likewise.
	* gfc-internals.texi: Likewise.
	* intrinsic.texi: Likewise.
	* invoke.texi: Likewise.
	* io.c: Likewise.
	* match.c: Likewise.
	* parse.c: Likewise.
	* primary.c: Likewise.
	* resolve.c: Likewise.
	* symbol.c: Likewise.
	* trans-array.c: Likewise.
	* trans-decl.c: Likewise.
	* trans-intrinsic.c: Likewise.
	* trans-stmt.c: Likewise.

	gcc/go/
	* go-backend.c: Mechanically replace "can not" with "cannot".
	* go-gcc.cc: Likewise.

	gcc/lto/
	* lto-partition.c: Mechanically replace "can not" with "cannot".
	* lto-symtab.c: Likewise.
	* lto.c: Likewise.

	gcc/objc/
	* objc-act.c: Mechanically replace "can not" with "cannot".

	libbacktrace/
	* backtrace.h: Mechanically replace "can not" with "cannot".

	libgcc/
	* config/c6x/libunwind.S: Mechanically replace "can not" with
	"cannot".
	* config/tilepro/atomic.h: Likewise.
	* config/vxlib-tls.c: Likewise.
	* generic-morestack-thread.c: Likewise.
	* generic-morestack.c: Likewise.
	* mkmap-symver.awk: Likewise.

	libgfortran/
	* caf/single.c: Mechanically replace "can not" with "cannot".
	* io/unit.c: Likewise.

	libobjc/
	* class.c: Mechanically replace "can not" with "cannot".
	* objc/runtime.h: Likewise.
	* sendmsg.c: Likewise.

	liboffloadmic/
	* include/coi/common/COIResult_common.h: Mechanically replace
	"can not" with "cannot".
	* include/coi/source/COIBuffer_source.h: Likewise.

	libstdc++-v3/
	* include/ext/bitmap_allocator.h: Mechanically replace "can not"
	with "cannot".

From-SVN: r267783
2019-01-09 16:37:45 -05:00
Jakub Jelinek a554497024 Update copyright years.
From-SVN: r267494
2019-01-01 13:31:55 +01:00
H.J. Lu da77eace90 C/C++: Add -Waddress-of-packed-member
When address of packed member of struct or union is taken, it may result
in an unaligned pointer value.  This patch adds -Waddress-of-packed-member
to check alignment at pointer assignment and warn unaligned address as
well as unaligned pointer:

$ cat x.i
struct pair_t
{
  char c;
  int i;
} __attribute__ ((packed));

extern struct pair_t p;
int *addr = &p.i;
$ gcc -O2 -S x.i
x.i:8:13: warning: taking address of packed member of ‘struct pair_t’ may result in an unaligned pointer value [-Waddress-of-packed-member]
8 | int *addr = &p.i;
  |             ^

$ cat c.i
struct B { int i; };
struct C { struct B b; } __attribute__ ((packed));

long* g8 (struct C *p) { return p; }
$ gcc -O2 -S c.i -Wno-incompatible-pointer-types
c.i: In function ‘g8’:
c.i:4:18: warning: converting a packed ‘struct C *’ pointer (alignment 1) to ‘long int *’ (alignment 8) may may result in an unaligned pointer value [-Waddress-of-packed-member]
4 | long* g8 (struct C *p) { return p; }
  |                  ^
c.i:2:8: note: defined here
2 | struct C { struct B b; } __attribute__ ((packed));
  |        ^
$

This warning is enabled by default.  Since read_encoded_value_with_base
in unwind-pe.h has

  union unaligned
    {
      void *ptr;
      unsigned u2 __attribute__ ((mode (HI)));
      unsigned u4 __attribute__ ((mode (SI)));
      unsigned u8 __attribute__ ((mode (DI)));
      signed s2 __attribute__ ((mode (HI)));
      signed s4 __attribute__ ((mode (SI)));
      signed s8 __attribute__ ((mode (DI)));
    } __attribute__((__packed__));
  _Unwind_Internal_Ptr result;

and GCC warns:

gcc/libgcc/unwind-pe.h:210:37: warning: taking address of packed member of 'union unaligned' may result in an unaligned pointer value [-Waddress-of-packed-member]
    result = (_Unwind_Internal_Ptr) u->ptr;
                                    ^
we need to add GCC pragma to ignore -Waddress-of-packed-member.

gcc/

	PR c/51628
	* doc/invoke.texi: Document -Wno-address-of-packed-member.

gcc/c-family/

	PR c/51628
	* c-common.h (warn_for_address_or_pointer_of_packed_member): New.
	* c-warn.c (check_alignment_of_packed_member): New function.
	(check_address_of_packed_member): Likewise.
	(check_and_warn_address_of_packed_member): Likewise.
	(warn_for_address_or_pointer_of_packed_member): Likewise.
	* c.opt: Add -Wno-address-of-packed-member.

gcc/c/

	PR c/51628
	* c-typeck.c (convert_for_assignment): Call
	warn_for_address_or_pointer_of_packed_member.

gcc/cp/

	PR c/51628
	* call.c (convert_for_arg_passing): Call
	warn_for_address_or_pointer_of_packed_member.
	* typeck.c (convert_for_assignment): Likewise.

gcc/testsuite/

	PR c/51628
	* c-c++-common/pr51628-1.c: New test.
	* c-c++-common/pr51628-2.c: Likewise.
	* c-c++-common/pr51628-3.c: Likewise.
	* c-c++-common/pr51628-4.c: Likewise.
	* c-c++-common/pr51628-5.c: Likewise.
	* c-c++-common/pr51628-6.c: Likewise.
	* c-c++-common/pr51628-7.c: Likewise.
	* c-c++-common/pr51628-8.c: Likewise.
	* c-c++-common/pr51628-9.c: Likewise.
	* c-c++-common/pr51628-10.c: Likewise.
	* c-c++-common/pr51628-11.c: Likewise.
	* c-c++-common/pr51628-12.c: Likewise.
	* c-c++-common/pr51628-13.c: Likewise.
	* c-c++-common/pr51628-14.c: Likewise.
	* c-c++-common/pr51628-15.c: Likewise.
	* c-c++-common/pr51628-26.c: Likewise.
	* c-c++-common/pr51628-27.c: Likewise.
	* c-c++-common/pr51628-28.c: Likewise.
	* c-c++-common/pr51628-29.c: Likewise.
	* c-c++-common/pr51628-30.c: Likewise.
	* c-c++-common/pr51628-31.c: Likewise.
	* c-c++-common/pr51628-32.c: Likewise.
	* gcc.dg/pr51628-17.c: Likewise.
	* gcc.dg/pr51628-18.c: Likewise.
	* gcc.dg/pr51628-19.c: Likewise.
	* gcc.dg/pr51628-20.c: Likewise.
	* gcc.dg/pr51628-21.c: Likewise.
	* gcc.dg/pr51628-22.c: Likewise.
	* gcc.dg/pr51628-23.c: Likewise.
	* gcc.dg/pr51628-24.c: Likewise.
	* gcc.dg/pr51628-25.c: Likewise.
	* c-c++-common/asan/misalign-1.c: Add
	-Wno-address-of-packed-member.
	* c-c++-common/asan/misalign-2.c: Likewise.
	* c-c++-common/ubsan/align-2.c: Likewise.
	* c-c++-common/ubsan/align-4.c: Likewise.
	* c-c++-common/ubsan/align-6.c: Likewise.
	* c-c++-common/ubsan/align-7.c: Likewise.
	* c-c++-common/ubsan/align-8.c: Likewise.
	* c-c++-common/ubsan/align-10.c: Likewise.
	* g++.dg/ubsan/align-2.C: Likewise.
	* gcc.target/i386/avx512bw-vmovdqu16-2.c: Likewise.
	* gcc.target/i386/avx512f-vmovdqu32-2.c: Likewise.
	* gcc.target/i386/avx512f-vmovdqu64-2.c: Likewise.
	* gcc.target/i386/avx512vl-vmovdqu16-2.c: Likewise.
	* gcc.target/i386/avx512vl-vmovdqu32-2.c: Likewise.
	* gcc.target/i386/avx512vl-vmovdqu64-2.c: Likewise.

libgcc/

	* unwind-pe.h (read_encoded_value_with_base): Add GCC pragma
	to ignore -Waddress-of-packed-member.

From-SVN: r267313
2018-12-20 13:41:48 -08:00
Thomas Preud'homme 72e3a52923 [ARM] Optimize executable size when using softfloat fmul/dmul
Softfloat single precision and double precision floating-point
multiplication routines in libgcc share some code with the
floating-point division of their corresponding precision. As the code
is structured now, this leads to *all* division code being pulled in an
executable in softfloat mode even if only multiplication is
performed.

This patch create some new LIB1ASMFUNCS macros to also build files with
just the multiplication and shared code as weak symbols. By putting
these earlier in the static library, they can then be picked up when
only multiplication is used and they are overriden by the global
definition in the existing file containing both multiplication and
division code when division is needed.

The patch also removes changes made to the FUNC_START and ARM_FUNC_START
macros in r218124 since the intent was to put multiplication and
division code into their own section in a later patch to achieve the
same size optimization. That approach relied on specific section layout
to ensure multiplication and division were not too far from the shared
bit of code in order to the branches to be within range. Due to lack of
guarantee regarding section layout, in particular with all the
possibility of linker scripts, this approach was chosen instead. This
patch keeps the two testcases that were posted by Tony Wang on the mailing
list to implement this approach and adds a new one.

2018-12-19  Thomas Preud'homme  <thomas.preudhomme@linaro.org>

    libgcc/
    * /config/arm/lib1funcs.S (FUNC_START): Remove unused sp_section
    parameter and corresponding code.
    (ARM_FUNC_START): Likewise in both definitions.
    Also update footer comment about condition that need to match with
    gcc/config/arm/elf.h to also include libgcc/config/arm/t-arm.
    * config/arm/ieee754-df.S (muldf3): Also build it if L_arm_muldf3 is
    defined.  Weakly define it in this case.
    * config/arm/ieee754-sf.S (mulsf3): Likewise with L_arm_mulsf3.
    * config/arm/t-elf (LIB1ASMFUNCS): Build _arm_muldf3.o and
    _arm_mulsf3.o before muldiv versions if targeting Thumb-1 only. Add
    comment to keep condition in sync with the one in
    libgcc/config/arm/lib1funcs.S and gcc/config/arm/elf.h.

    gcc/
    * config/arm/elf.h: Update comment about condition that need to
    match with libgcc/config/arm/lib1funcs.S to also include
    libgcc/config/arm/t-arm.
    * doc/sourcebuild.texi (output-exists, output-exists-not): Rename
    subsubsection these directives are in to "Check for output files".
    Move scan-symbol to that section and add to it new scan-symbol-not
    directive.

2018-12-19  Tony Wang  <tony.wang@arm.com>
	    Thomas Preud'homme  <thomas.preudhomme@linaro.org>

    gcc/testsuite/
    * lib/lto.exp (lto-execute): Define output_file and testname_with_flags
    to same value as execname.
    (scan-symbol): Move and rename to ...
    * lib/gcc-dg.exp (scan-symbol-common): This.  Adapt into a
    helper function returning true or false if a symbol is present.
    (scan-symbol): New procedure.
    (scan-symbol-not): Likewise.
    * gcc.target/arm/size-optimization-ieee-1.c: New testcase.
    * gcc.target/arm/size-optimization-ieee-2.c: Likewise.
    * gcc.target/arm/size-optimization-ieee-3.c: Likewise.

From-SVN: r267282
2018-12-19 17:34:18 +00:00
Wei Xiao 5d54c79858 driver-i386.c (host_detect_local_cpu): Detect cascadelake.
gcc/ChangeLog
2018-12-18  Wei Xiao  <wei3.xiao@intel.com>

	* config/i386/driver-i386.c (host_detect_local_cpu): Detect cascadelake.
	* config/i386/i386.c (fold_builtin_cpu): Handle cascadelake.
	* doc/extend.texi: Add cascadelake.

gcc/testsuite/ChangeLog
2018-12-18  Wei Xiao  <wei3.xiao@intel.com>

	* g++.target/i386/mv16.C: Handle new march.
	* gcc.target/i386/builtin_target.c: Ditto.

libgcc/ChangeLog
2018-12-18  Wei Xiao  <wei3.xiao@intel.com>

	* config/i386/cpuinfo.c (get_intel_cpu): Handle cascadelake.
	* config/i386/cpuinfo.h: Add INTEL_COREI7_CASCADELAKE.

From-SVN: r267226
2018-12-18 03:41:44 +00:00
Rasmus Villemoes 5a2580b6ad libgcc: rs6000: tramp.S: fix placement of .cfi_endproc for __trampoline_setup
Currently, .cfi_endproc and FUNC_END(__trampoline_setup) are placed
inside the #else branch of an "#if defined (__VXWORKS__) ...", so
non-pic vxworks does not get proper CFI nor a .size directive for
__trampoline_setup. I assume there's no magic reason for that (which
would warrant a comment), so move them outside.

From-SVN: r267051
2018-12-12 10:12:36 +00:00
Paul Koning c0c5112bcd * udivmodhi4.c (__udivmodhi4): Fix loop end check.
From-SVN: r266826
2018-12-05 09:25:11 -05:00
Alan Modra 1ea7ea181d [RS6000] libgcc cfi
There are a few places in libgcc assembly where we don't emit call
frame information for functions, potentially breaking unwinding from
asynchronous signal handlers.  This patch fixes them.  Although I
patch tramp.S there is no attempt made to provide CFI for the actual
trampoline on the stack.  Doing that would require generating CFI at
run time and both registering and deregistering it, which is probably
not worth doing since it would significantly slow down the call.

	* config/rs6000/morestack.S (__stack_split_initialize),
	(__morestack_get_guard, __morestack_set_guard),
	(__morestack_make_guard): Provide CFI covering these functions.
	* config/rs6000/tramp.S (__trampoline_setup): Likewise.

From-SVN: r266503
2018-11-27 12:29:56 +10:30
Xianmiao Qu ff641ae112 linux-unwind.h (sc_pt_regs): Update for kernel.
2018-11-15  Xianmiao Qu  <xianmiao_qu@c-sky.com>

	libgcc/
	* config/csky/linux-unwind.h (sc_pt_regs): Update for kernel. 
	(sc_pt_regs_lr): Update for kernel.
	(sc_pt_regs_tls): Update for kernel.

From-SVN: r266200
2018-11-16 01:26:04 +00:00