Commit Graph

165356 Commits

Author SHA1 Message Date
Jeff Law
cece89d0dd riscv (riscv_block_mvoe_straight): Use RETURN_BEGIN in call to move_by_pieces.
* config/riscv/riscv (riscv_block_mvoe_straight): Use RETURN_BEGIN
	in call to move_by_pieces.

	* config/sh/sh-mem.c (expand_block_move): Use RETURN_BEGIN in call
	to move_by_pieces.

From-SVN: r266514
2018-11-27 08:34:10 -07:00
Jeff Law
5605f2e133 lm32.c (lm32_block_move_inline): Use RETURN_BEGIN in call to move_by_pieces.
* config/lm32/lm32.c (lm32_block_move_inline): Use RETURN_BEGIN in
	call to move_by_pieces.

From-SVN: r266513
2018-11-27 08:30:40 -07:00
Jeff Law
5930367dbc mips.c (mips_block_move_straight): Use RETURN_BEGIN in call to move_by_pieces.
* config/mips/mips.c (mips_block_move_straight): Use RETURN_BEGIN
	in call to move_by_pieces.

2018-11-27  Tamar Christina  <tamar.christina@arm.com>

From-SVN: r266512
2018-11-27 08:26:44 -07:00
Jeff Law
441fd442d2 microblaze.c (microblaze_block_move_straight): Use RETURN_BEGIN in call to move_by_pieces.
* config/microblaze/microblaze.c (microblaze_block_move_straight): Use
	RETURN_BEGIN in call to move_by_pieces.
	(microblaze_expand_block_move): Likewise.

From-SVN: r266511
2018-11-27 08:22:01 -07:00
Tamar Christina
cb369975b9 Document the xorsign optab.
2018-11-27  Tamar Christina  <tamar.christina@arm.com>

	* doc/md.texi (xorsign): Document it.

From-SVN: r266510
2018-11-27 14:49:30 +00:00
Martin Liska
facf0354cf Support simd function declarations via a pre-include.
2018-11-27  Martin Liska  <mliska@suse.cz>

	* config/gnu-user.h (TARGET_F951_OPTIONS): New.
	* gcc.c (find_fortran_preinclude_file): New function
	to handle Fortran pre-include.
2018-11-27  Martin Liska  <mliska@suse.cz>

	* decl.c (gfc_match_gcc_builtin): New function.
	* gfortran.h (struct vect_builtin_tuple): New.
	(gfc_adjust_builtins): Likewise.
	* lang-specs.h (TARGET_F951_OPTIONS): New.
	(F951_OPTIONS): Use it.
	* lang.opt: Add new option -fpre-include.
	* match.h (gfc_match_gcc_builtin): Declare new function.
	* parse.c (decode_gcc_attribute): Handle builtin.
	(parse_progunit): Call gfc_adjust_builtins.
	* scanner.c (gfc_new_file): Load pre-included header file
	when provided.
	* trans-intrinsic.c (add_simd_flag_for_built_in): New.
	(gfc_adjust_builtins): Likewise.
2018-11-27  Martin Liska  <mliska@suse.cz>

	* gfortran.dg/simd-builtins-1.f90: New test.
	* gfortran.dg/simd-builtins-1.h: New test.
	* gfortran.dg/simd-builtins-2.f90: New test.
	* gfortran.dg/simd-builtins-3.f90: New test.
	* gfortran.dg/simd-builtins-3.h: New test.
	* gfortran.dg/simd-builtins-4.f: New test.
	* gfortran.dg/simd-builtins-4.h: New test.
	* gfortran.dg/simd-builtins-5.f: New test.
	* gfortran.dg/simd-builtins-6.f90: New test.

From-SVN: r266509
2018-11-27 13:06:48 +00:00
Martin Liska
2ff5ffb623 Come up with memop_ret enum instead of int endp for memory operations.
2018-11-27  Martin Liska  <mliska@suse.cz>

	* asan.c (asan_emit_stack_protection): Use new enum values
	instead of int constants.
	* builtins.c (expand_builtin_memory_copy_args): Replace int
	type with memop_ret enum type.
	(expand_builtin_mempcpy_args): Likewise.
	(expand_builtin_memcpy): Use new enum values
	instead of int constants. Likewise.
	(expand_builtin_mempcpy): Likewise.
	(expand_movstr): Likewise.
	(expand_builtin_strcpy_args): Likewise.
	(expand_builtin_stpcpy_1): Likewise.
	(expand_builtin_strncpy): Likewise.
	(expand_builtin_memset_args): Likewise.
	* expr.c (move_by_pieces_d::finish_endp): Rename to ...
	(move_by_pieces_d::finish_retmode): ... this.
	(move_by_pieces): Change last argument type to memop_ret.
	(store_by_pieces): Use new enum values
	instead of int constants.
	(emit_block_move_hints): Likewise.
	(emit_push_insn): Likewise.
	(store_expr): Likewise.
	* expr.h (store_by_pieces): Change int to newly added enum
	type.
	* rtl.h (enum memop_ret): Define.
	(move_by_pieces): Use the enum type.

From-SVN: r266508
2018-11-27 12:30:59 +00:00
Eric Botcazou
da193a2713 c-ada-spec.c: Include stringpool.h.
* c-ada-spec.c: Include stringpool.h.
	(has_static_fields): Return false for incomplete types.
	(is_tagged_type): Likewise.
	(has_nontrivial_methods): Likewise.
	(dump_ada_node) <INTEGER_TYPE>: Deal specifically with __int128.
	(struct overloaded_name_hash): New structure.
	(struct overloaded_name_hasher): Likewise.
	(overloaded_names): New global variable.
	(init_overloaded_names): New static function.
	(overloaded_name_p): New predicate.
	(dump_ada_declaration) <TYPE_DECL>: Tidy up and set TREE_VISITED
	on the TYPE_STUB_DECL of the original type of a typedef, if any.
	<FUNCTION_DECL>: Bail out for an unsupported overloaded name.
	Remove always-true condition and dump forward types.
	(dump_ada_specs): Delete overloaded_names.

From-SVN: r266506
2018-11-27 10:37:20 +00:00
Tom de Vries
6d760a0197 [libbacktrace] Don't point to released memory in backtrace_vector_release
When backtrace_vector_release is called with vec.size == 0, it releases the
memory pointed at by vec.base.

Set vec.base set to NULL if vec.size == 0 to ensure we don't point to released
memory.

Bootstrapped and reg-tested on x86_64.

2018-11-27  Tom de Vries  <tdevries@suse.de>

	* mmap.c (backtrace_vector_release): Same.
	* unittest.c (test1): Add check.

From-SVN: r266505
2018-11-27 08:26:04 +00:00
Tom de Vries
0c155f24a9 [libbacktrace] Avoid realloc with size == 0 in backtrace_vector_release
As of C17, realloc with size 0 is marked as an obsolescent feature.

Fix this in backtrace_vector_release by using free instead.

Bootstrapped and reg-tested on x86_64.

2018-11-27  Tom de Vries  <tdevries@suse.de>

	* alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
	instead of realloc.
	* Makefile.am (check_PROGRAMS): Add unittest.
	* Makefile.in: Regenerate.
	* unittest.c: New file.

From-SVN: r266504
2018-11-27 08:25:52 +00: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
Alan Modra
28a095763f [RS6000] PowerPC -mcpu=native support
The -mcpu=native support has bit-rotted a little, in particular the
fallback when the native cpu couldn't be determined.  This patch fixes
the bit-rot and reorganizes ASM_CPU_SPEC so that it should be a little
easier to keep the -mcpu=native data up to date.

The patch also changes the fix for PR63177 (-mpower9-vector being
passed by the user when the default is -mpower8) to also apply when
-mcpu=powerpc64le and -mcpu=native is given.  I'll note that the hack
for PR63177 should probably be extended to lots of other options, if
we're going to continue supporting all those sub-architecture options
(-mpower9-vector, -mpower8-vector, -mcrypto, -mdirect-move, -mhtm,
-mvsx and others) in the positive sense.  I think those should have
only been supported in their -mno- variants..

	* config/rs6000/aix71.h (ASM_SPEC): Don't select default -maix64
	cpu here.
	(ASM_CPU_SPEC): Do so here.  Rewrite using if .. else if .. specs
	form.  Error on missing -mcpu case.
	* config/rs6000/driver-rs6000.c (asm_names <_AIX>): Update NULL case.
	(asm_names <!_AIX>): Add missing cpus.  Update NULL case.  Apply
	PR63177 fix for -mcpu=power8 and -mcpu=powerpc64le.
	* config/rs6000/rs6000.h (ASM_CPU_SPEC): Rewrite using if ..
	else if .. specs form.  Error on missing -mcpu case.  Don't output
	duplicate -maltivec.  Apply PR63177 fix for -mcpu=powerpc64le.

From-SVN: r266502
2018-11-27 12:26:06 +10:30
David Malcolm
3da39f52ff Fix missing dump_impl_location_t values, using a new dump_metadata_t
The dump_* API attempts to capture emission location metadata for the
various dump messages, but looking in -fsave-optimization-record shows
that many dump messages are lacking useful impl_location values, instead
having this location within dumpfile.c:

            "impl_location": {
                "file": "../../src/gcc/dumpfile.c",
                "function": "ensure_pending_optinfo",
                "line": 1169
            },

The problem is that the auto-capturing of dump_impl_location_t is tied to
dump_location_t, and this is tied to the dump_*_loc calls.  If a message
comes from a dump_* call without a "_loc" suffix (e.g. dump_printf), the
current code synthesizes the dump_location_t within
dump_context::ensure_pending_optinfo, and thus saves the useless
impl_location seen above.

This patch fixes things by changing the dump_* API so that, rather than
taking a dump_flags_t, they take a new class dump_metadata_t, which is
constructed from a dump_flags_t, but captures the emission location.

Hence e.g.:

  dump_printf (MSG_NOTE, "some message\n");

implicitly builds a dump_metadata_t wrapping the MSG_NOTE and the
emission location.  If there are several dump_printf calls without
a dump_*_loc call, the emission location within the optinfo is that
of the first dump call within it.

The patch updates selftest::test_capture_of_dump_calls to verify
that the impl location of various dump_* calls is captured.  I also
verified things manually.

gcc/ChangeLog:
	* dump-context.h (dump_context::dump_loc): Convert 1st param from
	dump_flags_t to const dump_metadata_t &.  Convert 2nd param from
	const dump_location_t & to const dump_user_location_t &.
	(dump_context::dump_loc_immediate): Convert 2nd param from
	const dump_location_t & to const dump_user_location_t &.
	(dump_context::dump_gimple_stmt): Convert 1st param from
	dump_flags_t to const dump_metadata_t &.
	(dump_context::void dump_gimple_stmt_loc): Likewise; convert
	2nd param from const dump_location_t & to
	const dump_user_location_t &.
	(dump_context::dump_gimple_expr): Convert 1st param from
	dump_flags_t to const dump_metadata_t &.
	(dump_context::dump_gimple_expr_loc): Likewise; convert
	2nd param from const dump_location_t & to
	const dump_user_location_t &.
	(dump_context::dump_generic_expr): Convert 1st param from
	dump_flags_t to const dump_metadata_t &.
	(dump_context::dump_generic_expr_loc): Likewise; convert
	2nd param from const dump_location_t & to
	const dump_user_location_t &.
	(dump_context::dump_printf_va): Convert 1st param from
	dump_flags_t to const dump_metadata_t &.
	(dump_context::dump_printf_loc_va): Likewise; convert
	2nd param from const dump_location_t & to
	const dump_user_location_t &.
	(dump_context::dump_dec): Convert 1st param from
	dump_flags_t to const dump_metadata_t &.
	(dump_context::dump_symtab_node): Likewise.
	(dump_context::begin_scope): Split out 2nd param into
	user and impl locations.
	(dump_context::ensure_pending_optinfo): Add metadata param.
	(dump_context::begin_next_optinfo): Replace dump_location_t param
	with metadata and user location.
	* dumpfile.c (dump_context::dump_loc): Convert 1st param from
	dump_flags_t to const dump_metadata_t &.  Convert 2nd param from
	const dump_location_t & to const dump_user_location_t &.
	(dump_context::dump_loc_immediate): Convert 2nd param from
	const dump_location_t & to const dump_user_location_t &.
	(dump_context::dump_gimple_stmt): Convert 1st param from
	dump_flags_t to const dump_metadata_t &.
	(dump_context::void dump_gimple_stmt_loc): Likewise; convert
	2nd param from const dump_location_t & to
	const dump_user_location_t &.
	(dump_context::dump_gimple_expr): Convert 1st param from
	dump_flags_t to const dump_metadata_t &.
	(dump_context::dump_gimple_expr_loc): Likewise; convert
	2nd param from const dump_location_t & to
	const dump_user_location_t &.
	(dump_context::dump_generic_expr): Convert 1st param from
	dump_flags_t to const dump_metadata_t &.
	(dump_context::dump_generic_expr_loc): Likewise; convert
	2nd param from const dump_location_t & to
	const dump_user_location_t &.
	(dump_context::dump_printf_va): Convert 1st param from
	dump_flags_t to const dump_metadata_t &.
	(dump_context::dump_printf_loc_va): Likewise; convert
	2nd param from const dump_location_t & to
	const dump_user_location_t &.
	(dump_context::dump_dec): Convert 1st param from
	dump_flags_t to const dump_metadata_t &.
	(dump_context::dump_symtab_node): Likewise.
	(dump_context::begin_scope): Split out 2nd param into
	user and impl locations.
	(dump_context::ensure_pending_optinfo): Add metadata param.
	(dump_context::begin_next_optinfo): Replace dump_location_t param
	with metadata and user location.
	(dump_gimple_stmt): Convert 1st param from dump_flags_t to
	const dump_metadata_t &.
	(dump_gimple_stmt_loc): Likewise; convert 2nd param from
	const dump_location_t & to const dump_user_location_t &.
	(dump_gimple_expr): Convert 1st param from dump_flags_t to
	const dump_metadata_t &.
	(dump_gimple_expr_loc): Likewise; convert 2nd param from
	const dump_location_t & to const dump_user_location_t &.
	(dump_generic_expr): Convert 1st param from dump_flags_t to
	const dump_metadata_t &.
	(dump_generic_expr_loc): Likewise; convert 2nd param from
	const dump_location_t & to const dump_user_location_t &.
	(dump_printf): Convert 1st param from dump_flags_t to
	const dump_metadata_t &.
	(dump_printf_loc): Likewise; convert 2nd param from
	const dump_location_t & to const dump_user_location_t &.
	(dump_dec): Convert 1st param from dump_flags_t to
	const dump_metadata_t &.
	(dump_symtab_node): Likewise.
	(dump_begin_scope): Split out 2nd param into user and impl
	locations.
	(selftest::assert_impl_location_eq): New function.
	(ASSERT_IMPL_LOCATION_EQ): New macro.
	(selftest::test_impl_location): Update to use
	ASSERT_IMPL_LOCATION_EQ.
	(selftest::test_capture_of_dump_calls): Convert "loc" to
	dump_user_location_t.  Add ASSERT_IMPL_LOCATION_EQ throughout,
	verifying line numbers of dump emissions.
	* dumpfile.h (class dump_metadata_t): New class.
	(dump_printf): Convert 1st param from dump_flags_t to
	const dump_metadata_t &.
	(dump_printf_loc): Likewise; convert 2nd param from
	const dump_location_t & to const dump_user_location_t &.
	(dump_generic_expr_loc): Likewise.
	(dump_generic_expr): Convert 1st param from dump_flags_t to
	const dump_metadata_t &.
	(dump_gimple_stmt_loc): Likewise; convert 2nd param from
	const dump_location_t & to const dump_user_location_t &.
	(dump_gimple_stmt): Convert 1st param from dump_flags_t to
	const dump_metadata_t &.
	(dump_gimple_expr_loc): Likewise; convert 2nd param from
	const dump_location_t & to const dump_user_location_t &.
	(dump_gimple_expr): Convert 1st param from dump_flags_t to
	const dump_metadata_t &.
	(dump_symtab_node): Likewise.
	(dump_dec): Likewise.
	(dump_begin_scope): Split out 2nd param into user and impl
	locations.
	(auto_dump_scope::auto_dump_scope): Split "loc" param into a user
	location and impl_location, and capture the impl_location.
	(AUTO_DUMP_SCOPE): Rename param from LOC to USER_LOC.
	* loop-unroll.c (report_unroll): Update for changes to
	dump_printf_loc and dump_printf.
	* opt-problem.cc (opt_problem::opt_problem): Update for change to
	dump_loc.
	* optinfo-emit-json.cc
	(selftest::test_building_json_from_dump_calls): Convert "loc" from
	dump_location_t to dump_user_location_t.
	* optinfo.cc (optinfo::emit_for_opt_problem): Update for change in
	dump_loc_immediate.
	* profile.c (compute_branch_probabilities): Update for change to
	dump_printf_loc.
	* selftest.h (ASSERT_STR_CONTAINS_AT): New macro.
	* tree-vect-slp.c (vect_print_slp_tree): Update for change to
	dump_printf_loc.

From-SVN: r266501
2018-11-27 00:55:28 +00:00
Jozef Lawrynowicz
27c16e61cb Tweak directives in GCC tests for msp430-elf
2018-11-27  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	Tweak directives in GCC tests for msp430-elf

	gcc/ChangeLog:

	* doc/sourcebuild.texi: Document check_effective_target_int_eq_float
	and check_effective_target_ptr_eq_long.

	gcc/testsuite/ChangeLog:

	* lib/target-supports.exp
	(check_effective_target_logical_op_short_circuit): Add msp430.
	(check_effective_target_int_eq_float): New. 
	(check_effective_target_ptr_eq_long): New. 
	* c-c++-common/pr41779.c: Require int_eq_float for dg-warning tests.
	* c-c++-common/pr57371-2.c: XFAIL optimized dump scan when
	sizeof (float) != sizeof (int).
	* gcc.dg/pr84670-4.c: Require ptr_eq_long.
	* gcc.dg/pr85859.c: Likewise.
	* gcc.dg/Wno-frame-address.c: Skip for msp430-elf.
	* gcc.dg/torture/stackalign/builtin-apply-2.c: Likewise.
	* gcc.dg/ifcvt-4.c: Likewise.
	* gcc.dg/pr34856.c: Likewise.
	* gcc.dg/builtin-apply2.c: Likewise.
	* gcc.dg/tree-ssa/ssa-dse-26.c: Likewise.
	* gcc.dg/attr-alloc_size-11.c: Remove dg-warning XFAIL for msp430.
	* gcc.dg/tree-ssa/20040204-1.c: Likewise.
	* gcc.dg/compat/struct-by-value-16a_x.c: Build at -O1 for msp430
	so it fits.
	* gcc.dg/lto/20091013-1_0.c: Require ptr_eq_long.
	* gcc.dg/lto/20091013-1_1.c: Remove xfail-if for when
	sizeof(void *) != sizeof(long).
	* gcc.dg/lto/20091013-1_2.c: Likewise.
	* gcc.dg/tree-ssa/loop-1.c: Fix expected dg-final behaviour for msp430.
	* gcc.dg/tree-ssa/gen-vect-25.c: Likewise.
	* gcc.dg/tree-ssa/gen-vect-11.c: Likewise.
	* gcc.dg/tree-ssa/loop-35.c: Likewise.
	* gcc.dg/tree-ssa/pr23455.c: Likewise.
	* gcc.dg/weak/typeof-2.c: Likewise.
	* gcc.target/msp430/interrupt_fn_placement.c: Skip for 430 ISA.
	* gcc.target/msp430/pr78818-data-region.c: Fix scan-assembler text.
	* gcc.target/msp430/pr79242.c: Don't skip for -msmall.
	* gcc.target/msp430/special-regs.c: Use "__asm__" instead of "asm".

From-SVN: r266500
2018-11-27 00:17:42 +00:00
GCC Administrator
660254d3e8 Daily bump.
From-SVN: r266499
2018-11-27 00:16:32 +00:00
Alan Modra
6204523475 [RS6000] rs6000/sysv4.h using gnu-user.h
This patch removes some duplication in rs6000/sysv4.h of macros found
in gnu-user.h that we want for linux.  Including gnu-user.h will mean
powerpc doesn't miss updates to that file.

	* config.gcc (powerpc*-*-freebsd*, powerpc-*-netbsd*),
	(powerpc-*-eabisimaltivec*, powerpc-*-eabisim*, powerpc-*-elf*),
	(powerpc-*-eabialtivec*, powerpc-*-eabi*, powerpc-*-rtems*),
	(powerpc-wrs-vxworks*, powerpc-*-lynxos*, powerpcle-*-elf*),
	(powerpcle-*-eabisim*, powerpcle-*-eabi*): Add gnu-user.h to tm_file.
	* config/rs6000/freebsd.h (CPLUSPLUS_CPP_SPEC),
	(LINK_GCC_C_SEQUENCE_SPEC): Undef.
	(ASM_APP_ON, ASM_APP_OFF): Don't define.
	* config/rs6000/freebsd64.h (ASM_APP_ON, ASM_APP_OFF): Don't define.
	* config/rs6000/lynx.h (ASM_APP_ON, ASM_APP_OFF): Don't define.
	* config/rs6000/linux64.h (LINK_GCC_C_SEQUENCE_SPEC): Define.
	* config/rs6000/netbsd.h (CPLUSPLUS_CPP_SPEC),
	(LINK_GCC_C_SEQUENCE_SPEC): Undef.
	* config/rs6000/rtems.h (LINK_GCC_C_SEQUENCE_SPEC): Define.
	* config/rs6000/sysv4.h (GNU_USER_TARGET_CRTI): Redefine.
	(GNU_USER_TARGET_CRTN): Redefine.
	(CC1_SPEC): Use GNU_USER_TARGET_CC1_SPEC.
	(LIB_LINUX_SPEC): Use GNU_USER_TARGET_LIB_SPEC.
	(CRTOFFLOADBEGIN, CRTOFFLOADEND): Don't define.
	(STARTFILE_LINUX_SPEC): Define as GNU_USER_TARGET_STARTFILE_SPEC.
	(ENDFILE_LINUX_SPEC): Define as GNU_USER_TARGET_ENDFILE_SPEC.
	(UCLIBC_DYNAMIC_LINKER, CHOOSE_DYNAMIC_LINKER): Don't define.
	(LINK_EH_SPEC): Don't define.

From-SVN: r266496
2018-11-27 10:36:45 +10:30
Ian Lance Taylor
0abbc8f15e syscall: always define WEXITED and WNOWAIT on GNU/Linux
Fixes https://gcc.gnu.org/PR88135
    
    Reviewed-on: https://go-review.googlesource.com/c/150897

From-SVN: r266495
2018-11-26 23:58:34 +00:00
Martin Sebor
67b9fab0e6 PR 87756 - missing unterminated argument warning using address of a constant character
gcc/ChangeLog:

	PR 87756
	* expr.c (string_constant): Handle top-level decls of all character
	types and subobjects of narrow character type.

gcc/testsuite/ChangeLog:

        PR 87756
	* gcc.dg/warn-sprintf-no-nul-2.c: Move incomplete tests from here...
	* gcc.dg/warn-sprintf-no-nul-3.c: ...to here and complete them.

From-SVN: r266494
2018-11-26 16:55:36 -07:00
Alan Modra
426a04b84f [RS6000] Use config/linux.h for powerpc*-*-linux*
Using the macros in config/linux.h rather than duplicating them helps
stop future bitrot, and repairs existing bitrot (4 choices for libc in
linux.h, fewer in the rs6000 files not that it matters much).  Also
fixes the fact that __gnu_linux__ was always defined rather than just
when glibc was the libc of choice.

	* config.gcc (powerpc*-*-linux*): Add linux.h to tm_file.
	* config/rs6000/linux.h (TARGET_OS_CPP_BUILTINS): Use
	GNU_USER_TARGET_OS_CPP_BUILTINS.
	(RS6000_ABI_NAME): Define.
	* config/rs6000/linux64.h (TARGET_OS_CPP_BUILTINS): Use
	GNU_USER_TARGET_OS_CPP_BUILTINS.
	(MUSL_DYNAMIC_LINKER32): Undef before defining.
	(UCLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER64): Don't define.
	(CHOOSE_DYNAMIC_LINKER): Don't define.
	(GNU_USER_DYNAMIC_LINKER32, GNU_USER_DYNAMIC_LINKER64): Don't define.
	* config/rs6000/sysv4.h (MUSL_DYNAMIC_LINKER): Undef before defining.
	(CHOOSE_DYNAMIC_LINKER, GNU_USER_DYNAMIC_LINKER): Only define when
	not already defined.
	(CPP_OS_LINUX_SPEC): Remove defines and asserts handled by
	TARGET_OS_CPP_BUILTINS.

From-SVN: r266493
2018-11-27 10:23:56 +10:30
Marek Polacek
2426ee774b PR c++/88120 - ICE when calling save_expr in a template.
* typeck.c (cp_build_binary_op): Call cp_save_expr instead of
	save_expr.

	* g++.dg/cpp0x/pr88120.C: New test.

From-SVN: r266492
2018-11-26 23:26:40 +00:00
Iain Buclaw
80de5ef9c1 Add filters for D language sources to contrib/update-copyright.py
2018-11-26  Iain Buclaw  <ibuclaw@gdcproject.org>

	* update-copyright.py (TestsuiteFilter): Skip .d tests.
	(LibPhobosFilter): Add filter for upstream D sources.
	(GCCCopyright): Add D Language Foundation as external author.
	(GCCCmdLine): Add libphobos.

From-SVN: r266491
2018-11-26 21:59:04 +00:00
Ian Lance Taylor
1e4cc1d4b0 compiler: initial support for exporting function bodies
Create a framework for putting function bodies in export data.  At
    present only empty functions will be put there, and they will be
    ignored on import.  Later patches will get this to the point of
    supporting inlining of (some) functions defined in other packages.
    
    Reviewed-on: https://go-review.googlesource.com/c/150061

From-SVN: r266490
2018-11-26 21:44:20 +00:00
Jozef Lawrynowicz
50e99db391 Fix tests for 16-bit int.
2018-11-26  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	Fix tests for 16-bit int.

	gcc/testsuite/ChangeLog:

	* c-c++-common/Warray-bounds-3.c (test_strcpy_bounds): Use long instead
	of int if __SIZEOF_INT__ == 2.
	* c-c++-common/Wrestrict.c: Test memcpy range with smaller length when
	__SIZEOF_SIZE_T < 4.
	* c-c++-common/rotate-8.c: Define smaller "large" constant when
	__SIZEOF_INT__ == 2.
	* gcc.dg/pr53037-1.c: Add dg-require-effective-target int32.
	* gcc.dg/pr53037-2.c: Likewise.
	* gcc.dg/pr53037-3.c: Likewise.
	* gcc.dg/pr85512.c: Likewise.
	* gcc.dg/pr59963-2.c: Add dg-warning for int16.
	* gcc.dg/sancov/cmp0.c: Explicitly use __INT32_TYPE__ instead of int.
	* gcc.dg/tree-ssa/addadd.c: Fix dg-final directives for int16.
	* gcc.dg/tree-ssa/pr79327-2.c: Likewise.
	* gcc.dg/tree-ssa/builtin-sprintf-2.c: Filter out invalid tests for
	int16.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-10.c: Update sizes in dg-warning
	directives for int16.

From-SVN: r266489
2018-11-26 21:39:51 +00:00
Jozef Lawrynowicz
571bbd0d48 sourcebuild.texi: Document check_effective_target_newlib_nano_io.
2018-11-26  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	gcc/ChangeLog:

	* doc/sourcebuild.texi: Document check_effective_target_newlib_nano_io.

	gcc/testsuite/ChangeLog:

	* lib/target-supports.exp (check_effective_target_newlib_nano_io): New. 
	* gcc.c-torture/execute/920501-8.c: Register undefined linker symbol
	_printf_float for newlib_nano_io target.
	* gcc.c-torture/execute/930513-1.c: Likewise.
	* gcc.dg/torture/builtin-sprintf.c: Likewise.
	* gcc.c-torture/execute/ieee/920810-1.x: New.

From-SVN: r266488
2018-11-26 21:35:43 +00:00
Jakub Jelinek
8b1f4e1f8a re PR target/88195 (misleading error message for unsupported builtin)
PR target/88195
	* config/i386/i386.c (def_builtin2): If tcode == VOID_FTYPE_UINT64
	and !TARGET_64BIT, return NULL_TREE.

	* gcc.target/i386/pr88195.c: New test.

From-SVN: r266487
2018-11-26 22:26:19 +01:00
Jakub Jelinek
60d4173b75 re PR testsuite/88090 (obj-c++.dg/attributes/method-nonnull-1.mm FAILs)
PR testsuite/88090
	* obj-c++.dg/attributes/method-nonnull-1.mm (my_size_t): New typedef.
	(MyArray::removeObjectAtIndex): Use my_size_t instead of size_t and
	expect it in diagnostics.

From-SVN: r266486
2018-11-26 22:25:22 +01:00
Jakub Jelinek
14fac4364c re PR c++/86900 (-gdwarf-5 -O2 -ffunction-sections = assembler error)
PR c++/86900
	* dwarf2out.c (secname_for_decl): For functions with
	DECL_SECTION_NAME if in_cold_section_p, try to return
	current_function_section's name if it is a named section.

	* g++.dg/debug/dwarf2/pr86900.C: New test.

From-SVN: r266485
2018-11-26 22:24:00 +01:00
Maya Rashish
3cf50fcdac re PR preprocessor/58397 (Please add host_hooks for NetBSD to make precompiled headers work)
PR target/58397
	* config.host (*-*-netbsd*): Use x-netbsd and host-netbsd.o.
	* config/x-netbsd: New file.
	* config/host-netbsd: New file.

From-SVN: r266484
2018-11-26 14:21:16 -07:00
Jozef Lawrynowicz
f4a14e09ee sourcebuild.texi: Document check_effective_target_size20plus.
2018-11-26  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	gcc/ChangeLog:

	* doc/sourcebuild.texi: Document check_effective_target_size20plus.
	Clarify documentation for check_effective_target_size32plus.

	gcc/testsuite/ChangeLog:

	* gcc.c-torture/compile/20151204.c: Add dg-require-effective-target
	size20plus.
	* gcc.dg/pr34225.c: Likewise.
	* gcc.dg/pr40971.c: Likewise.
	* gcc.dg/pr69071.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-10.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-2.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-3.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-5.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-6.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-7.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-8.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-9.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-11.c: Add dg-require-effective-target
	size32plus.
	* gcc.dg/Walloc-size-larger-than-4.c: Likewise.
	* gcc.dg/Walloc-size-larger-than-5.c: Likewise.
	* gcc.dg/Walloc-size-larger-than-6.c: Likewise.
	* gcc.dg/Walloc-size-larger-than-7.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-1.c: Likewise.
	* gcc.dg/tree-ssa/loop-interchange-1b.c: Likewise.
	* lib/target-supports.exp (check_effective_target_size20plus): New.
	(check_effective_target_size32plus): Update comment.

From-SVN: r266483
2018-11-26 21:14:47 +00:00
Jakub Jelinek
ffcf3b79c2 Makefile.am (AUTOMAKE_OPTIONS): Drop dejagnu.
* testsuite/Makefile.am (AUTOMAKE_OPTIONS): Drop dejagnu.
	(RUNTEST): Don't define.
	(RUNTESTDEFAULTFLAGS): Add.
	(check-DEJAGNU, site.exp, distclean-DEJAGNU): New goals.
	(distclean-am): Depend on distclean-DEJAGNU.
	(check-am): If -j% option is present in MFLAGS and if
	`getconf _NPROCESSORS_ONLN` is more than 8, export OMP_NUM_THREADS=8.
	(.PHONY): Add check-DEJAGNU and distclean-DEJAGNU.
	* testsuite/Makefile.in: Regenerated.

From-SVN: r266482
2018-11-26 22:03:41 +01:00
Aaron Sawdey
37ae4739bc rs6000-string.c (expand_cmp_vec_sequence): Rename and modify expand_strncmp_vec_sequence.
2018-11-26  Aaron Sawdey  <acsawdey@linux.ibm.com>

	* config/rs6000/rs6000-string.c (expand_cmp_vec_sequence): Rename
	and modify expand_strncmp_vec_sequence.
	(emit_final_compare_vec): Rename and modify emit_final_str_compare_vec.
	(generate_6432_conversion): New function.
	(expand_block_compare): Add support for vsx.
	(expand_block_compare_gpr): New function.
	* config/rs6000/rs6000.opt (rs6000_block_compare_inline_limit): Increase
	default limit to 63 because of more compact vsx code.

From-SVN: r266481
2018-11-26 14:59:06 -06:00
Uros Bizjak
02ef9b0c2d re PR target/88178 (ICE in dbx_reg_number, at dwarf2out.c:13659)
PR target/88178
	* config/i386/i386.c (dbx_register_map): Use IGNORED_DWARF_REGNUM
	for registers for which no debug information can be generated.
	Use INVALID_REGNUM for non-existent registers.
	(dbx64_register_map): Ditto.
	(svr4_dbx_register_map): Ditto.

testsuite/ChangeLog:

	PR target/88178
	* gcc.target/pr88178.c: New test.

From-SVN: r266480
2018-11-26 21:50:57 +01:00
Sandra Loosemore
73d062d118 re PR c/57182 (Documentation implies -fprofile-arcs required to create .text.unlikely sections)
2018-11-26  Sandra Loosemore  <sandra@codesourcery.com>

	PR c/57182

	gcc/
	* doc/invoke.texi (Optimize Options): Document that
	-freorder-functions also uses "hot" and "cold" attributes.

From-SVN: r266473
2018-11-26 13:22:19 -05:00
Kyrylo Tkachov
17f8ace20e [AArch64][committed] Fix typo in aarch64_mangle_type
* config/aarch64/aarch64.c (aarch64_mangle_type): Fix typo in comment.

From-SVN: r266472
2018-11-26 17:51:58 +00:00
Kyrylo Tkachov
f51c724c7e [arm][1/3] Rename mul64 attr to widen_mul64
The mul64 attribute in types.md causes some confusion as it is used to represent
aarch32 instructions that do widening multiplication to generate 32->64 bit results.
But these types are shared with aarch64, which has native 64-bit multiplication operations.

Those are currently not properly represented, which I will fix in follow-up patches.
For now, this patch renames the mul64 attribute to widen_mul64 to more clearly communicate its meaning.

It mechanically updates all users of that name in config/arm/ (there are no users in config/aarch64).
There is thus no change in behaviour.

	* config/arm/types.md (mul64): Rename to...
	(widen_mul64): ... This.
	* config/arm/arm-generic.md: Rename mul64 to widen_mul64.
	* config/arm/cortex-a15.md: Likewise.
	* config/arm/cortex-a5.md: Likewise.
	* config/arm/cortex-a53.md: Likewise.
	* config/arm/cortex-a57.md: Likewise.
	* config/arm/cortex-a7.md: Likewise.
	* config/arm/cortex-m4.md: Likewise.
	* config/arm/exynos-m1.md: Likewise.
	* config/arm/marvell-pj4.md: Likewise.
	* config/arm/xgene1.md: Likewise.

From-SVN: r266471
2018-11-26 17:50:03 +00:00
Iain Buclaw
e20145f12c libphobos: Fix backtraces in Fibers on AArch64.
When throwing an Exception in the Fiber the backtrace generation
crashes.  This happens because backtrace does not func the stack bottom.
Using '.cfi_undefined x30' tells the debug info that the value in the lr
is unknown, which seems to be the nicest way to stop the unwinder.
Setting x30 to 0 is another option, however it still creates one invalid
frame in gdb, so the .cfi variant is used here instead.

Backport from upstream druntime 2.083.

Reviewed-on: https://github.com/dlang/druntime/pull/2308

From-SVN: r266470
2018-11-26 17:27:34 +00:00
Richard Biener
ef6e6914c8 re PR tree-optimization/88182 (ICE in vectorizable_reduction, at tree-vect-loop.c:6465)
2018-11-26  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/88182
	* tree-vect-loop.c (vectorizable_reduction): Pick up single
	correct reduc_def_info.
	* tree-vect-slp.c (vect_analyze_slp_instance): Set
	STMT_VINFO_REDUC_DEF of the first stmt.

	libgomp/
	* testsuite/libgomp.c++/pr88182.C: New testcase.

From-SVN: r266467
2018-11-26 15:37:35 +00:00
Andreas Krebbel
c393c7482f S/390: Document z14/arch12 -march option.
gcc/ChangeLog:

2018-11-26  Andreas Krebbel  <krebbel@linux.ibm.com>

	* doc/invoke.texi: Document z14/arch12 -march option.

From-SVN: r266462
2018-11-26 15:01:03 +00:00
Matthias Klose
7548e49631 re PR ada/88191 (ada bootstrap failure on alpha-linux-gnu ("SIGSYS" not declared in "Linux"))
2018-11-26  Matthias Klose <doko@ubuntu.com>

        PR ada/88191
        * libgnarl/s-linux__alpha.ads: Define SIGSYS.

From-SVN: r266459
2018-11-26 13:30:50 +00:00
Matthias Klose
14c5a314c8 test-long-names.c: Fix build with -Wformat-security.
2018-11-26  Matthias Klose  <doko@ubuntu.com>

        * jit.dg/test-long-names.c: Fix build with -Wformat-security.

From-SVN: r266454
2018-11-26 11:50:31 +00:00
Jonathan Wakely
f4d3e3cca5 Only use __float128 in test if available
* testsuite/26_numerics/complex/requirements/more_constexpr.cc: Fix
	failure on targets without __float128.

From-SVN: r266450
2018-11-26 11:12:11 +00:00
Sandra Loosemore
2d30555621 re PR c/57166 (Manual no longer documents -Wmissing-noreturn alias for -Wsuggest-attribute=noreturn)
2018-11-25  Sandra Loosemore  <sandra@codesourcery.com>

	PR c/57166

	gcc/
	* doc/invoke.texi (Option Summary): Add -Wmissing-noreturn.
	(Warning Options): Likewise.

From-SVN: r266446
2018-11-25 22:44:38 -05:00
Sandra Loosemore
721b7fd257 re PR web/79738 (Documentation for __attribute__((const)) slightly misleading)
2018-11-25  Sandra Loosemore  <sandra@codesourcery.com>

	PR web/79738

	gcc/
	* doc/extend.texi (Common Function Attributes): Clarify that
	functions with "const" attribute can read const global variables.

From-SVN: r266445
2018-11-25 20:38:00 -05:00
GCC Administrator
47e53bb646 Daily bump.
From-SVN: r266444
2018-11-26 00:16:38 +00:00
Alan Modra
ea3166ba16 [RS6000] Delete OBJECT_PEF and TARGET_MACOS
Nothing references these macros.

	* config/rs6000/rs6000.h (OBJECT_PEF, TARGET_MACOS): Delete.

From-SVN: r266441
2018-11-26 08:46:27 +10:30
Sandra Loosemore
8f76a0895a re PR other/54265 (Documentation of "preferred attribute syntax for Types" contradicts examples in info.)
2018-11-25  Sandra Loosemore  <sandra@codesourcery.com>

	PR other/54265

	gcc/
	* doc/extend.texi (Common Variable Attributes): Use preferred
	placement of type attributes in examples, plus whitespace fixes.
	(Type Attributes): Clarify why placement of attributes
	immediately after struct/union/enum keyword is preferred.
	(Common Type Attributes): Use preferred placement of type
	attributes in examples, plus more whitespace fixes.

From-SVN: r266440
2018-11-25 16:10:34 -05:00
Paul Koning
537db3a2bc * config/pdp11/pdp11.h (TARGET_HAS_NO_HW_DIVIDE): Define.
From-SVN: r266439
2018-11-25 12:39:27 -05:00
Rainer Orth
6d9434e595 Disable gdc execution tests without libphobos
gcc/testsuite:
	* lib/target-supports.exp (check_compile): Handle D.
	(check_effective_target_d_runtime): New proc.
	* lib/gdc-dg.exp (gdc-dg-test): Demote link and run tests to
	compile unless d_runtime.
	* gdc.dg/runnable.d: Skip unless d_runtime.
	* gdc.dg/lto/lto.exp: Require d_runtime to run tests.

	gcc:
	* doc/sourcebuild.texi (Effective-Target Keywords, Environment
	attributes): Document d_runtime.

From-SVN: r266438
2018-11-25 15:59:44 +00:00
Vladimir Makarov
12422bc85c re PR bootstrap/88157 (ICE when building libgo encoding/gob.lo starting with r266385)
2018-11-25  Vladimir Makarov  <vmakarov@redhat.com>

	PR bootstrap/88157
	* ira-costs.c (record_operand_costs): Initiate register move cost
	for mode.

From-SVN: r266435
2018-11-25 05:46:44 +00:00
GCC Administrator
30bf4f8e5c Daily bump.
From-SVN: r266434
2018-11-25 00:16:29 +00:00