gcc.git
6 years agocompiler: import inlinable functions from package data
Ian Lance Taylor [Tue, 27 Nov 2018 15:51:01 +0000 (15:51 +0000)]
compiler: import inlinable functions from package data

    Start reading the export data generated by the last change in this
    series.  At this point we will inline direct calls to empty functions
    and methods defined in different packages.

    Reviewed-on: https://go-review.googlesource.com/c/150062

From-SVN: r266517

6 years agoPR preprocessor/83173: Additional check before decrementing highest_location
Mike Gulick [Tue, 27 Nov 2018 15:49:43 +0000 (15:49 +0000)]
PR preprocessor/83173: Additional check before decrementing highest_location

2018-11-27  Mike Gulick  <mgulick@mathworks.com>

PR preprocessor/83173
* files.c (_cpp_stack_include): Check if
line_table->highest_location is past current line before
decrementing.

From-SVN: r266516

6 years agore PR target/88188 (ICE in print_operand, at config/rs6000/rs6000.c)
Jakub Jelinek [Tue, 27 Nov 2018 15:40:57 +0000 (16:40 +0100)]
re PR target/88188 (ICE in print_operand, at config/rs6000/rs6000.c)

PR target/88188
* config/rs6000/rs6000.c (print_operand) <case 'D'>: Use
output_operand_lossage instead of gcc_assert.
<case 't'>: Likewise.
<case 'z'>: Likewise.
<case 'V'>: Use output_operand_lossage instead of gcc_unreachable.

* gcc.target/powerpc/pr88188.c: New test.

From-SVN: r266515

6 years agoriscv (riscv_block_mvoe_straight): Use RETURN_BEGIN in call to move_by_pieces.
Jeff Law [Tue, 27 Nov 2018 15:34:10 +0000 (08:34 -0700)]
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

6 years agolm32.c (lm32_block_move_inline): Use RETURN_BEGIN in call to move_by_pieces.
Jeff Law [Tue, 27 Nov 2018 15:30:40 +0000 (08:30 -0700)]
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

6 years agomips.c (mips_block_move_straight): Use RETURN_BEGIN in call to move_by_pieces.
Jeff Law [Tue, 27 Nov 2018 15:26:44 +0000 (08:26 -0700)]
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

6 years agomicroblaze.c (microblaze_block_move_straight): Use RETURN_BEGIN in call to move_by_pi...
Jeff Law [Tue, 27 Nov 2018 15:22:01 +0000 (08:22 -0700)]
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

6 years agoDocument the xorsign optab.
Tamar Christina [Tue, 27 Nov 2018 14:49:30 +0000 (14:49 +0000)]
Document the xorsign optab.

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

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

From-SVN: r266510

6 years agoSupport simd function declarations via a pre-include.
Martin Liska [Tue, 27 Nov 2018 13:06:48 +0000 (14:06 +0100)]
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

6 years agoCome up with memop_ret enum instead of int endp for memory operations.
Martin Liska [Tue, 27 Nov 2018 12:30:59 +0000 (13:30 +0100)]
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

6 years agoc-ada-spec.c: Include stringpool.h.
Eric Botcazou [Tue, 27 Nov 2018 10:37:20 +0000 (10:37 +0000)]
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

6 years ago[libbacktrace] Don't point to released memory in backtrace_vector_release
Tom de Vries [Tue, 27 Nov 2018 08:26:04 +0000 (08:26 +0000)]
[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

6 years ago[libbacktrace] Avoid realloc with size == 0 in backtrace_vector_release
Tom de Vries [Tue, 27 Nov 2018 08:25:52 +0000 (08:25 +0000)]
[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

6 years ago[RS6000] libgcc cfi
Alan Modra [Tue, 27 Nov 2018 01:59:56 +0000 (12:29 +1030)]
[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

6 years ago[RS6000] PowerPC -mcpu=native support
Alan Modra [Tue, 27 Nov 2018 01:56:06 +0000 (12:26 +1030)]
[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

6 years agoFix missing dump_impl_location_t values, using a new dump_metadata_t
David Malcolm [Tue, 27 Nov 2018 00:55:28 +0000 (00:55 +0000)]
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

6 years agoTweak directives in GCC tests for msp430-elf
Jozef Lawrynowicz [Tue, 27 Nov 2018 00:17:42 +0000 (00:17 +0000)]
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

6 years agoDaily bump.
GCC Administrator [Tue, 27 Nov 2018 00:16:32 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r266499

6 years ago[RS6000] rs6000/sysv4.h using gnu-user.h
Alan Modra [Tue, 27 Nov 2018 00:06:45 +0000 (10:36 +1030)]
[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

6 years agosyscall: always define WEXITED and WNOWAIT on GNU/Linux
Ian Lance Taylor [Mon, 26 Nov 2018 23:58:34 +0000 (23:58 +0000)]
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

6 years agoPR 87756 - missing unterminated argument warning using address of a constant character
Martin Sebor [Mon, 26 Nov 2018 23:55:36 +0000 (16:55 -0700)]
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

6 years ago[RS6000] Use config/linux.h for powerpc*-*-linux*
Alan Modra [Mon, 26 Nov 2018 23:53:56 +0000 (10:23 +1030)]
[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

6 years agoPR c++/88120 - ICE when calling save_expr in a template.
Marek Polacek [Mon, 26 Nov 2018 23:26:40 +0000 (23:26 +0000)]
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

6 years agoAdd filters for D language sources to contrib/update-copyright.py
Iain Buclaw [Mon, 26 Nov 2018 21:59:04 +0000 (21:59 +0000)]
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

6 years agocompiler: initial support for exporting function bodies
Ian Lance Taylor [Mon, 26 Nov 2018 21:44:20 +0000 (21:44 +0000)]
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

6 years agoFix tests for 16-bit int.
Jozef Lawrynowicz [Mon, 26 Nov 2018 21:39:51 +0000 (21:39 +0000)]
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

6 years agosourcebuild.texi: Document check_effective_target_newlib_nano_io.
Jozef Lawrynowicz [Mon, 26 Nov 2018 21:35:43 +0000 (21:35 +0000)]
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

6 years agore PR target/88195 (misleading error message for unsupported builtin)
Jakub Jelinek [Mon, 26 Nov 2018 21:26:19 +0000 (22:26 +0100)]
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

6 years agore PR testsuite/88090 (obj-c++.dg/attributes/method-nonnull-1.mm FAILs)
Jakub Jelinek [Mon, 26 Nov 2018 21:25:22 +0000 (22:25 +0100)]
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

6 years agore PR c++/86900 (-gdwarf-5 -O2 -ffunction-sections = assembler error)
Jakub Jelinek [Mon, 26 Nov 2018 21:24:00 +0000 (22:24 +0100)]
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

6 years agore PR preprocessor/58397 (Please add host_hooks for NetBSD to make precompiled header...
Maya Rashish [Mon, 26 Nov 2018 21:21:16 +0000 (21:21 +0000)]
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

6 years agosourcebuild.texi: Document check_effective_target_size20plus.
Jozef Lawrynowicz [Mon, 26 Nov 2018 21:14:47 +0000 (21:14 +0000)]
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

6 years agoMakefile.am (AUTOMAKE_OPTIONS): Drop dejagnu.
Jakub Jelinek [Mon, 26 Nov 2018 21:03:41 +0000 (22:03 +0100)]
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

6 years agors6000-string.c (expand_cmp_vec_sequence): Rename and modify expand_strncmp_vec_sequence.
Aaron Sawdey [Mon, 26 Nov 2018 20:59:06 +0000 (20:59 +0000)]
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

6 years agore PR target/88178 (ICE in dbx_reg_number, at dwarf2out.c:13659)
Uros Bizjak [Mon, 26 Nov 2018 20:50:57 +0000 (21:50 +0100)]
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

6 years agore PR c/57182 (Documentation implies -fprofile-arcs required to create .text.unlikely...
Sandra Loosemore [Mon, 26 Nov 2018 18:22:19 +0000 (13:22 -0500)]
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

6 years ago[AArch64][committed] Fix typo in aarch64_mangle_type
Kyrylo Tkachov [Mon, 26 Nov 2018 17:51:58 +0000 (17:51 +0000)]
[AArch64][committed] Fix typo in aarch64_mangle_type

* config/aarch64/aarch64.c (aarch64_mangle_type): Fix typo in comment.

From-SVN: r266472

6 years ago[arm][1/3] Rename mul64 attr to widen_mul64
Kyrylo Tkachov [Mon, 26 Nov 2018 17:50:03 +0000 (17:50 +0000)]
[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

6 years agolibphobos: Fix backtraces in Fibers on AArch64.
Iain Buclaw [Mon, 26 Nov 2018 17:27:34 +0000 (17:27 +0000)]
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

6 years agore PR tree-optimization/88182 (ICE in vectorizable_reduction, at tree-vect-loop.c...
Richard Biener [Mon, 26 Nov 2018 15:37:35 +0000 (15:37 +0000)]
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

6 years agoS/390: Document z14/arch12 -march option.
Andreas Krebbel [Mon, 26 Nov 2018 15:01:03 +0000 (15:01 +0000)]
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

6 years agore PR ada/88191 (ada bootstrap failure on alpha-linux-gnu ("SIGSYS" not declared...
Matthias Klose [Mon, 26 Nov 2018 13:30:50 +0000 (13:30 +0000)]
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

6 years agotest-long-names.c: Fix build with -Wformat-security.
Matthias Klose [Mon, 26 Nov 2018 11:50:31 +0000 (11:50 +0000)]
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

6 years agoOnly use __float128 in test if available
Jonathan Wakely [Mon, 26 Nov 2018 11:12:11 +0000 (11:12 +0000)]
Only use __float128 in test if available

* testsuite/26_numerics/complex/requirements/more_constexpr.cc: Fix
failure on targets without __float128.

From-SVN: r266450

6 years agore PR c/57166 (Manual no longer documents -Wmissing-noreturn alias for -Wsuggest...
Sandra Loosemore [Mon, 26 Nov 2018 03:44:38 +0000 (22:44 -0500)]
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

6 years agore PR web/79738 (Documentation for __attribute__((const)) slightly misleading)
Sandra Loosemore [Mon, 26 Nov 2018 01:38:00 +0000 (20:38 -0500)]
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

6 years agoDaily bump.
GCC Administrator [Mon, 26 Nov 2018 00:16:38 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r266444

6 years ago[RS6000] Delete OBJECT_PEF and TARGET_MACOS
Alan Modra [Sun, 25 Nov 2018 22:16:27 +0000 (08:46 +1030)]
[RS6000] Delete OBJECT_PEF and TARGET_MACOS

Nothing references these macros.

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

From-SVN: r266441

6 years agore PR other/54265 (Documentation of "preferred attribute syntax for Types" contradict...
Sandra Loosemore [Sun, 25 Nov 2018 21:10:34 +0000 (16:10 -0500)]
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

6 years ago* config/pdp11/pdp11.h (TARGET_HAS_NO_HW_DIVIDE): Define.
Paul Koning [Sun, 25 Nov 2018 17:39:27 +0000 (12:39 -0500)]
* config/pdp11/pdp11.h (TARGET_HAS_NO_HW_DIVIDE): Define.

From-SVN: r266439

6 years agoDisable gdc execution tests without libphobos
Rainer Orth [Sun, 25 Nov 2018 15:59:44 +0000 (15:59 +0000)]
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

6 years agore PR bootstrap/88157 (ICE when building libgo encoding/gob.lo starting with r266385)
Vladimir Makarov [Sun, 25 Nov 2018 05:46:44 +0000 (05:46 +0000)]
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

6 years agoDaily bump.
GCC Administrator [Sun, 25 Nov 2018 00:16:29 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r266434

6 years agore PR d/87866 (gdc fails to compile minimal test)
Iain Buclaw [Sat, 24 Nov 2018 09:51:03 +0000 (09:51 +0000)]
re PR d/87866 (gdc fails to compile minimal test)

gcc/d/ChangeLog:

2018-11-24  Iain Buclaw  <ibuclaw@gdcproject.org>

PR d/87866
* d-incpath.cc (add_globalpaths): Use lrealpath to get canonical name.
(add_filepaths): Likewise.

From-SVN: r266429

6 years agore PR fortran/88143 (ICE in resolve_variable at gcc/fortran/resolve.c:5413 since...
Paul Thomas [Sat, 24 Nov 2018 09:10:00 +0000 (09:10 +0000)]
re PR fortran/88143 (ICE in resolve_variable at gcc/fortran/resolve.c:5413 since r253077)

2018-11-24  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/88143
* resolve.c (resolve_variable): Check for associate names with
NULL target.

2018-11-24  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/88143
* gfortran.dg/associate_46.f90: New test.

From-SVN: r266428

6 years ago2018-11-24 Paul Thomas <pault@gcc.gnu.org>
Paul Thomas [Sat, 24 Nov 2018 09:07:23 +0000 (09:07 +0000)]
2018-11-24  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/888143
* resolve.c (resolve_variable): Check for associate names with
NULL target.

2018-11-24  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/888143
* gfortran.dg/associate_46.f90: New test.

From-SVN: r266427

6 years agore PR rtl-optimization/87468 (ice "wrong amount of branch edges after conditional...
Jeff Law [Sat, 24 Nov 2018 06:51:26 +0000 (23:51 -0700)]
re PR rtl-optimization/87468 (ice "wrong amount of branch edges after conditional jump in bb")

PR rtl-optimization/87468
* tree-ssa-threadupdate.c (create_block_for_threading): Clear
EDGE_IGNORE on all outgoing edges of the duplicate block.

From-SVN: r266426

6 years agoDaily bump.
GCC Administrator [Sat, 24 Nov 2018 00:16:40 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r266425

6 years agore PR bootstrap/88157 (ICE when building libgo encoding/gob.lo starting with r266385)
Vladimir Makarov [Fri, 23 Nov 2018 22:00:43 +0000 (22:00 +0000)]
re PR bootstrap/88157 (ICE when building libgo encoding/gob.lo starting with r266385)

2018-11-23  Vladimir Makarov  <vmakarov@redhat.com>

PR bootstrap/88157
* ira-costs.c (record_operand_costs): Use bigger hard reg class if
its mode does not fit to the original class.

From-SVN: r266422

6 years agopr70669.c: Use unary minus instead of addition.
Vladimir Makarov [Fri, 23 Nov 2018 21:42:52 +0000 (21:42 +0000)]
pr70669.c: Use unary minus instead of addition.

2018-11-23  Vladimir Makarov  <vmakarov@redhat.com>

* gcc.target/powerpc/pr70669.c: Use unary minus instead of
addition.

From-SVN: r266421

6 years agore PR tree-optimization/87756 (missing unterminated argument warning using address...
Jakub Jelinek [Fri, 23 Nov 2018 21:13:44 +0000 (22:13 +0100)]
re PR tree-optimization/87756 (missing unterminated argument warning using address of a constant character)

PR tree-optimization/87756
* gcc.dg/builtin-memchr-2.c: Scan the gimple dump instead of
optimized.
* gcc.dg/builtin-memchr-3.c: Likewise.

From-SVN: r266420

6 years agoMake recursion_check work for multiple threads
Janne Blomqvist [Fri, 23 Nov 2018 20:42:03 +0000 (22:42 +0200)]
Make recursion_check work for multiple threads

With multiple threads, using an unprotected static variable to check
whether recursion has occured isn't valid, as one thread might have
modified the variable, thus causing another thread to incorrectly
conclude that recursion has occured.  This patch avoids this problem
by using a thread-specific variable for the recursion check.

Regtested on x86_64-pc-linux-gnu.

libgfortran/ChangeLog:

2018-11-23  Janne Blomqvist  <jb@gcc.gnu.org>

* runtime/error.c (MAGIC): Remove.
(recursion_key): New variable.
(recursion_check): Use thread-specific variable for recursion
check if threads are active.
(constructor_recursion_check): New function.
(destructor_recursion_check): New funcion.

From-SVN: r266419

6 years agoPR tree-optimization/87756 - missing unterminated argument warning using address...
Martin Sebor [Fri, 23 Nov 2018 18:45:45 +0000 (18:45 +0000)]
PR tree-optimization/87756 - missing unterminated argument warning using address of a constant character

gcc/ChangeLog:

PR tree-optimization/87756
* expr.c (string_constant): Synthesize a string literal from
the address of a constant character.
* tree.c (build_string_literal): Add an argument.
* tree.h (build_string_literal): Same.

gcc/testsuite/ChangeLog:

PR tree-optimization/87756
* gcc.dg/builtin-memchr-2.c: New test.
* gcc.dg/builtin-memchr-3.c: Same.
* gcc.dg/warn-sprintf-no-nul-2.c: Same.

From-SVN: r266418

6 years agoPR testsuite/88098 - FAIL: gcc.dg/Wbuiltin-declaration-mismatch-4.c
Martin Sebor [Fri, 23 Nov 2018 18:23:31 +0000 (18:23 +0000)]
PR testsuite/88098 - FAIL: gcc.dg/Wbuiltin-declaration-mismatch-4.c

gcc/c/ChangeLog:

PR testsuite/88098
* c-typeck.c (convert_arguments): Call builtin_decl_explicit instead.
(maybe_warn_builtin_no_proto_arg): Handle short enum to int promotion.

gcc/testsuite/ChangeLog:

PR testsuite/88098
* gcc.dg/Wbuiltin-declaration-mismatch-4.c: Adjust.
* gcc.dg/Wbuiltin-declaration-mismatch-5.c: New test.
* gcc.dg/torture/pr67222.c: Adjust.

From-SVN: r266417

6 years agoImplement P0415 More constexpr for std::complex.
Edward Smith-Rowland [Fri, 23 Nov 2018 18:17:04 +0000 (18:17 +0000)]
Implement P0415 More constexpr for std::complex.

2018-11-23  Edward Smith-Rowland  <3dw4rd@verizon.net>

Implement P0415 More constexpr for std::complex.
* include/std/complex (conj(complex<Tp>), norm(complex<Tp>)): Constexpr;
(real(Tp), imag(Tp)): Constexpr;
(operator@=(Tp), operator@=(complex<Tp>)): Constexpr;
(operator@(Tp,complex<Tp>), operator@(complex<Tp>,Tp)
operator@(complex<Tp>,complex<Tp>)): Constexpr.
* testsuite/26_numerics/complex/comparison_operators/
more_constexpr.cc: New test.
* testsuite/26_numerics/complex/operators/more_constexpr.cc: New test.
* testsuite/26_numerics/complex/requirements/
more_constexpr.cc: New test.
* testsuite/26_numerics/complex/value_operations/
more_constexpr.cc: New test.
* testsuite/26_numerics/headers/complex/synopsis.cc:
Add _GLIBCXX20_CONSTEXPR to applicable operators; Add missing proj().
* testsuite/26_numerics/headers/complex/synopsis.cc:
Add _GLIBCXX20_CONSTEXPR to relevant decls.

From-SVN: r266416

6 years ago[aarch64] Add CPU support for Ampere Computing's eMAG.
Christoph Muellner [Fri, 23 Nov 2018 17:52:19 +0000 (17:52 +0000)]
[aarch64] Add CPU support for Ampere Computing's eMAG.

2018-11-23  Christoph Muellner <christoph.muellner@theobroma-system.com>

* config/aarch64/aarch64-cores.def: Define emag.
* config/aarch64/aarch64-tune.md: Regenerated with emag.
* config/aarch64/aarch64.c (emag_tunings): New struct.
* doc/invoke.texi: Document mtune value.

From-SVN: r266415

6 years ago[aarch64] Update xgene1 tuning struct.
Christoph Muellner [Fri, 23 Nov 2018 17:49:44 +0000 (17:49 +0000)]
[aarch64] Update xgene1 tuning struct.

2018-11-23  Christoph Muellner  <christoph.muellner@theobroma-systems.com>
    Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

* config/aarch64/aarch64.c (xgene1_tunings): Optimize Xgene1 tunings
for GCC 9.

Co-Authored-By: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
From-SVN: r266414

6 years ago[aarch64] Add xgene1 prefetch tunings.
Christoph Muellner [Fri, 23 Nov 2018 17:49:40 +0000 (17:49 +0000)]
[aarch64] Add xgene1 prefetch tunings.

2018-11-23  Christoph Muellner  <christoph.muellner@theobroma-systems.com>
            Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

* config/aarch64/aarch64.c (xgene1_tunings): Add Xgene1 specific
prefetch tunings.

Co-Authored-By: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
From-SVN: r266413

6 years ago[aarch64] Update xgene1_addrcost_table.
Christoph Muellner [Fri, 23 Nov 2018 17:49:26 +0000 (17:49 +0000)]
[aarch64] Update xgene1_addrcost_table.

2018-11-23  Christoph Muellner  <christoph.muellner@theobroma-systems.com>
            Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

* config/aarch64/aarch64.c (xgene1_addrcost_table): Correct the post modify
costs.

Co-Authored-By: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
From-SVN: r266412

6 years ago[aarch64/arm] Updating the cost table for xgene1.
Christoph Muellner [Fri, 23 Nov 2018 17:49:19 +0000 (17:49 +0000)]
[aarch64/arm] Updating the cost table for xgene1.

2018-11-23  Christoph Muellner <christoph.muellner@theobroma-system.com>

* config/arm/aarch-cost-tables.h (xgene1_extra_costs): Update the cost table
for Xgene1.

From-SVN: r266411

6 years agoPR libstdc++/65229 fix pretty printer for std::bitset<0>
Martin Sebor [Fri, 23 Nov 2018 16:12:03 +0000 (16:12 +0000)]
PR libstdc++/65229 fix pretty printer for std::bitset<0>

2018-11-23  Martin Sebor  <msebor@redhat.com>
    Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/65229
* python/libstdcxx/v6/printers.py (StdBitsetPrinter): Handle
exception thrown for std::bitset<0>.
* testsuite/libstdc++-prettyprinters/simple.cc: Test std::bitset<0>.

Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>
From-SVN: r266409

6 years agoPR libstdc++/87308 adjust regex used in std::any pretty printer
Jonathan Wakely [Fri, 23 Nov 2018 15:48:56 +0000 (15:48 +0000)]
PR libstdc++/87308 adjust regex used in std::any pretty printer

The pretty printer for std::any fails when the contained value is a
locally-defined type, because the name in the debuginfo has
cv-qualifiers and ptr-declarators in different positions. The unexpected
format confuses the printer. This makes the printer's regex handle
either format.

This isn't a complete fix because looking up the contained type fails
when there are two types with the same name (defined in different local
scopes). This applies to all closure types defined in a given function,
as they all appear as "func()::lambda" in the debuginfo names.

PR libstdc++/87308 (partial)
* python/libstdcxx/v6/printers.py (StdExpAnyPrinter): Adjust regex to
work around PR 88166.
* testsuite/libstdc++-prettyprinters/cxx17.cc: Test std::any
containing a local type.

From-SVN: r266408

6 years agore PR tree-optimization/88149 (ICE in vect_transform_stmt since r265959)
Richard Biener [Fri, 23 Nov 2018 12:53:39 +0000 (12:53 +0000)]
re PR tree-optimization/88149 (ICE in vect_transform_stmt since r265959)

2018-11-23  Richard Biener  <rguenther@suse.de>

PR tree-optimization/88149
* tree-vect-slp.c (vect_slp_analyze_node_operations): Detect
the case where there are two different def types for the
same operand at different operand position in the same stmt.

* g++.dg/torture/pr88149.C: New testcase.

From-SVN: r266406

6 years ago[PATCH, ARM] Clean up arm backend using the @ construct for MD patterns
Mihail Ionescu [Fri, 23 Nov 2018 10:48:52 +0000 (10:48 +0000)]
[PATCH, ARM] Clean up arm backend using the @ construct for MD patterns

This patch removes some of the machine mode checks from the arm backend when
emitting instructions by using the '@' construct (Parameterized Names[2]). It
is based on the previous AArch64 patch[1].

[1] https://gcc.gnu.org/ml/gcc-patches/2018-07/msg00673.html
[2] https://gcc.gnu.org/onlinedocs/gccint/Parameterized-Names.html#Parameterized-Names

2018-23-11  Mihail Ionescu  <mihail.ionescu@arm.com>

* config/arm/arm.c (arm_expand_compare_and_swap): Simplify and call
gen_atomic_compare_swap_1.
(arm_evpc_neon_vuzp): Likewise gen_neon_vuzp_internal.
(arm_evpc_neon_vtrn): Likewise gen_neon_vtrn_internal.
(arm_evpc_neon_vext): Likewise gen_neon_vext_internal.
(arm_evpc_neon_vzip): Likewise gen_neon_vzip_internal.
(arm_evpc_neon_vrev): Replace the function pointer and simplify the mode
checks.
* config/arm/arm.md (neon_vext<mode>),
(neon_vrev64<mode>, neon_vrev32<mode>),
(neon_vrev16<mode>, neon_vtrn<mode>_internal),
(neon_vzip<mode>_internal, neon_vuzp<mode>_internal): Add an '@'character
before the pattern name.
* config/arm/sync.md:
(atomic_compare_and_swap<CCSI:arch><NARROW:mode>_1),
(atomic_compare_and_swap<CCSI:arch><SIDI:mode>_1): Likewise.

From-SVN: r266404

6 years agore PR tree-optimization/86614 (duplicate -Warray-bounds for a strncpy call with...
Jakub Jelinek [Fri, 23 Nov 2018 09:12:16 +0000 (10:12 +0100)]
re PR tree-optimization/86614 (duplicate -Warray-bounds for a strncpy  call with out-of-bounds offset)

PR tree-optimization/86614
* gimple-ssa-warn-restrict.c (maybe_diag_offset_bounds): Return early
if TREE_NO_WARNING is set on ref.ref.

* c-c++-common/Warray-bounds-2.c (wrap_strncpy_dstarray_diff_neg,
call_strncpy_dstarray_diff_neg): Don't expect late -Warray-bounds
warnings, just early ones from FE.  Remove dg-prune-output.
* c-c++-common/Warray-bounds-6.c: New test.

From-SVN: r266403

6 years agore PR c/53608 (Documentation could be clearer about designated initializers of unions)
Sandra Loosemore [Fri, 23 Nov 2018 05:18:19 +0000 (00:18 -0500)]
re PR c/53608 (Documentation could be clearer about designated initializers of unions)

2018-11-22  Sandra Loosemore  <sandra@codesourcery.com>
    Alan Coopersmith  <alan.coopersmith@oracle.com>

PR c/53608

gcc/
* doc/extend.texi (Designated Inits): Clarify handling of multiple
initializers for unions.

Co-Authored-By: Alan Coopersmith <alan.coopersmith@oracle.com>
From-SVN: r266402

6 years agoDaily bump.
GCC Administrator [Fri, 23 Nov 2018 00:16:37 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r266400

6 years agolang.opt (fpad-source): New option.
Jakub Jelinek [Fri, 23 Nov 2018 00:11:11 +0000 (01:11 +0100)]
lang.opt (fpad-source): New option.

* lang.opt (fpad-source): New option.
* scanner.c (load_line): Don't pad fixed form lines if
!flag_pad_source.
* invoke.texi (-fno-pad-source): Document.

* gfortran.dg/pad_source_1.f: New test.
* gfortran.dg/pad_source_2.f: New test.
* gfortran.dg/pad_source_3.f: New test.
* gfortran.dg/pad_source_4.f: New test.
* gfortran.dg/pad_source_5.f: New test.

From-SVN: r266397

6 years agore PR lto/88142 (ICE in lto_warn at ipa-devirt.c:1020 since r265519)
Jan Hubicka [Thu, 22 Nov 2018 23:10:57 +0000 (00:10 +0100)]
re PR lto/88142 (ICE in lto_warn at ipa-devirt.c:1020 since r265519)

PR lto/88142
* ipa-devirt.c (type_variants_equivalent_p): Drop warn and warned
parameters; do not warn here.
(odr_subtypes_equivalent_p): Likewise.
(warn_odr): Fix typo.
(warn_types_mismatch): Do not output confused warnings on integer types.
(odr_types_equivalent_p): Update.

* g++.dg/lto/odr-5_0.C: New testcase.
* g++.dg/lto/odr-5_1.C: New testcase.

From-SVN: r266396

6 years agolto.c (cmp_type_location): Remove.
Jan Hubicka [Thu, 22 Nov 2018 23:00:43 +0000 (00:00 +0100)]
lto.c (cmp_type_location): Remove.

* lto.c (cmp_type_location): Remove.
(lto_read_decls): Do not allocate odr_types.

From-SVN: r266395

6 years agoi386.c (ix86_option_override_internal, [...]): Formatting fixes.
Jakub Jelinek [Thu, 22 Nov 2018 21:35:24 +0000 (22:35 +0100)]
i386.c (ix86_option_override_internal, [...]): Formatting fixes.

* config/i386/i386.c (ix86_option_override_internal,
ix86_can_inline_p, classify_argument, construct_container,
ix86_expand_prologue, ix86_expand_split_stack_prologue,
ix86_expand_carry_flag_compare, expand_set_or_movmem_via_loop,
expand_setmem_epilogue_via_loop, promote_duplicated_reg,
ix86_expand_set_or_movmem, ix86_init_builtins_va_builtins_abi):
Formatting fixes.

From-SVN: r266391

6 years agoi386.c (ix86_option_override_internal): For stack_protector_guard related options...
Jakub Jelinek [Thu, 22 Nov 2018 21:34:49 +0000 (22:34 +0100)]
i386.c (ix86_option_override_internal): For stack_protector_guard related options...

* config/i386/i386.c (ix86_option_override_internal): For
stack_protector_guard related options, use opts_set->x_ instead
of global_options_set. and prefix options with opts->x_ .  Move
defaults for offset and reg into else block.

From-SVN: r266390

6 years agoi386.c (ix86_check_avx_upper_register): Return true for all SSE registers with mode...
Uros Bizjak [Thu, 22 Nov 2018 21:25:37 +0000 (22:25 +0100)]
i386.c (ix86_check_avx_upper_register): Return true for all SSE registers with mode bitsize > 128.

* config/i386/i386.c (ix86_check_avx_upper_register):
Return true for all SSE registers with mode bitsize > 128.

From-SVN: r266389

6 years agoodr-2_0.C: Drop dg-lto-options.
Jan Hubicka [Thu, 22 Nov 2018 20:26:21 +0000 (21:26 +0100)]
odr-2_0.C: Drop dg-lto-options.

* g++.dg/lto/odr-2_0.C: Drop dg-lto-options.
* g++.dg/lto/odr-3_0.C: Likewise; harden for optimizing compilatoin.

From-SVN: r266388

6 years agore PR tree-optimization/85794 ([AArch64] ICE in expand_vector_condition in GIMPLE...
Jakub Jelinek [Thu, 22 Nov 2018 19:58:50 +0000 (20:58 +0100)]
re PR tree-optimization/85794 ([AArch64] ICE in expand_vector_condition in GIMPLE pass: veclower2)

PR tree-optimization/85794
* gcc.dg/vect/O3-pr85794.c: New test.

From-SVN: r266387

6 years agoImprove relocation
Marc Glisse [Thu, 22 Nov 2018 18:10:05 +0000 (19:10 +0100)]
Improve relocation

2018-11-22  Marc Glisse  <marc.glisse@inria.fr>

PR libstdc++/87106
* include/bits/stl_algobase.h: Include <type_traits>.
(__niter_base): Add noexcept specification.
* include/bits/stl_deque.h: Include <bits/stl_uninitialized.h>.
(__is_trivially_relocatable): Specialize for deque.
* include/bits/stl_iterator.h: Include <type_traits>.
(__niter_base): Add noexcept specification.
* include/bits/stl_uninitialized.h (__is_trivially_relocatable):
Add parameter for meta-programming.
(__relocate_a_1, __relocate_a): Add noexcept specification.
* include/bits/stl_vector.h (__use_relocate): Test __relocate_a.

From-SVN: r266386

6 years agore PR rtl-optimization/87718 (FAIL: gcc.target/i386/avx512dq-concatv2si-1.c)
Vladimir Makarov [Thu, 22 Nov 2018 17:25:57 +0000 (17:25 +0000)]
re PR rtl-optimization/87718 (FAIL: gcc.target/i386/avx512dq-concatv2si-1.c)

2018-11-22  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/87718
* ira-costs.c: Remove trailing white-spaces.
(record_operand_costs): Add a special treatment for moves
involving a hard register.

2018-11-22  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/87718
* gcc.target/i386/pr82361-1.c: Check only the first operand of
moves.

From-SVN: r266385

6 years agoi386.c (ix86_avx_emit_vzeroupper): Remove.
Uros Bizjak [Thu, 22 Nov 2018 15:39:35 +0000 (16:39 +0100)]
i386.c (ix86_avx_emit_vzeroupper): Remove.

* config/i386/i386.c (ix86_avx_emit_vzeroupper): Remove.
(ix86_emit_mode_set) <case AVX_U128>: Emit vzeroupper here.

From-SVN: r266382

6 years agoFix option values for -march.
Martin Liska [Thu, 22 Nov 2018 15:09:55 +0000 (16:09 +0100)]
Fix option values for -march.

2018-11-22  Martin Liska  <mliska@suse.cz>

* common/config/i386/i386-common.c (processor_names): Add
static assert and add missing "znver2".
(ix86_get_valid_option_values): Add checking assert for null
values and add "native" value if feasible.
* config/i386/i386.h: Do not declare size of processor_names.
* common/config/i386/i386-common.c:
* config/i386/i386.c: Add static assert for size
of processor_cost_table.

From-SVN: r266381

6 years agoPR85434: Prevent spilling of stack protector guard's address on ARM
Thomas Preud'homme [Thu, 22 Nov 2018 14:46:17 +0000 (14:46 +0000)]
PR85434: Prevent spilling of stack protector guard's address on ARM

In case of high register pressure in PIC mode, address of the stack
protector's guard can be spilled on ARM targets as shown in PR85434,
thus allowing an attacker to control what the canary would be compared
against. ARM does lack stack_protect_set and stack_protect_test insn
patterns, defining them does not help as the address is expanded
regularly and the patterns only deal with the copy and test of the
guard with the canary.

This problem does not occur for x86 targets because the PIC access and
the test can be done in the same instruction. Aarch64 is exempt too
because PIC access insn pattern are mov of UNSPEC which prevents it from
the second access in the epilogue being CSEd in cse_local pass with the
first access in the prologue.

The approach followed here is to create new "combined" set and test
standard pattern names that take the unexpanded guard and do the set or
test. This allows the target to use an opaque pattern (eg. using UNSPEC)
to hide the individual instructions being generated to the compiler and
split the pattern into generic load, compare and branch instruction
after register allocator, therefore avoiding any spilling. This is here
implemented for the ARM targets. For targets not implementing these new
standard pattern names, the existing stack_protect_set and
stack_protect_test pattern names are used.

To be able to split PIC access after register allocation, the functions
had to be augmented to force a new PIC register load and to control
which register it loads into. This is because sharing the PIC register
between prologue and epilogue could lead to spilling due to CSE again
which an attacker could use to control what the canary gets compared
against.

2018-11-22  Thomas Preud'homme  <thomas.preudhomme@linaro.org>

    gcc/
    PR target/85434
    * target-insns.def (stack_protect_combined_set): Define new standard
    pattern name.
    (stack_protect_combined_test): Likewise.
    * cfgexpand.c (stack_protect_prologue): Try new
    stack_protect_combined_set pattern first.
    * function.c (stack_protect_epilogue): Try new
    stack_protect_combined_test pattern first.
    * config/arm/arm.c (require_pic_register): Add pic_reg and compute_now
    parameters to control which register to use as PIC register and force
    reloading PIC register respectively.  Insert in the stream of insns if
    possible.
    (legitimize_pic_address): Expose above new parameters in prototype and
    adapt recursive calls accordingly.  Use pic_reg if non null instead of
    cached one.
    (arm_load_pic_register): Add pic_reg parameter and use it if non null.
    (arm_legitimize_address): Adapt to new legitimize_pic_address
    prototype.
    (thumb_legitimize_address): Likewise.
    (arm_emit_call_insn): Adapt to require_pic_register prototype change.
    (arm_expand_prologue): Adapt to arm_load_pic_register prototype change.
    (thumb1_expand_prologue): Likewise.
    * config/arm/arm-protos.h (legitimize_pic_address): Adapt to prototype
    change.
    (arm_load_pic_register): Likewise.
    * config/arm/predicated.md (guard_addr_operand): New predicate.
    (guard_operand): New predicate.
    * config/arm/arm.md (movsi expander): Adapt to legitimize_pic_address
    prototype change.
    (builtin_setjmp_receiver expander): Adapt to thumb1_expand_prologue
    prototype change.
    (stack_protect_combined_set): New expander..
    (stack_protect_combined_set_insn): New insn_and_split pattern.
    (stack_protect_set_insn): New insn pattern.
    (stack_protect_combined_test): New expander.
    (stack_protect_combined_test_insn): New insn_and_split pattern.
    (arm_stack_protect_test_insn): New insn pattern.
    * config/arm/thumb1.md (thumb1_stack_protect_test_insn): New insn pattern.
    * config/arm/unspecs.md (UNSPEC_SP_SET): New unspec.
    (UNSPEC_SP_TEST): Likewise.
    * doc/md.texi (stack_protect_combined_set): Document new standard
    pattern name.
    (stack_protect_set): Clarify that the operand for guard's address is
    legal.
    (stack_protect_combined_test): Document new standard pattern name.
    (stack_protect_test): Clarify that the operand for guard's address is
    legal.

    gcc/testsuite/
    PR target/85434
    * gcc.target/arm/pr85434.c: New test.

From-SVN: r266379

6 years agore PR tree-optimization/88148 (ICE in tree_nop_conversion_p at gcc/tree.c:12550 since...
Richard Biener [Thu, 22 Nov 2018 14:08:44 +0000 (14:08 +0000)]
re PR tree-optimization/88148 (ICE in tree_nop_conversion_p at gcc/tree.c:12550 since r264273)

2018-11-22  Richard Biener  <rguenther@suse.de>

PR tree-optimization/88148
* tree-ssa-loop-niter.c (simplify_replace_tree): Get optional
valueization callback parameter and handle it.
* tree-ssa-loop-niter.h (simplify_replace_tree): Export.
* tree-ssa-sccvn.c (process_bb): Eliminate in loop niter trees.

* gfortran.dg/pr88148.f90: New testcase.

From-SVN: r266378

6 years agoAdd new maintainer script for PRs that can be closed.
Martin Liska [Thu, 22 Nov 2018 14:05:54 +0000 (15:05 +0100)]
Add new maintainer script for PRs that can be closed.

2018-11-22  Martin Liska  <mliska@suse.cz>

* bugzilla-close-candidate.py: New file.

From-SVN: r266377

6 years agoPR libstdc++/87520 Always pass type-punned type_info reference
Jonathan Wakely [Thu, 22 Nov 2018 13:42:39 +0000 (13:42 +0000)]
PR libstdc++/87520 Always pass type-punned type_info reference

The implementations of std::make_shared for -frtti and -fno-rtti are not
compatible, because they pass different arguments to
_Sp_counted_ptr_inplace::_M_get_deleter and so can't interoperate.
Either the argument doesn't match the expected value, and so the
shared_ptr::_M_ptr member is never set, or the type-punned reference is
treated as a real std::type_info object and gets dereferenced.

This patch removes the differences between -frtti and -fno-rtti, so that
typeid is never used, and the type-punned reference is used in both
cases. For backwards compatibility with existing code that passes
typeid(_Sp_make_shared_tag) that still needs to be handled, but only
after checking that the argument is not the type-punned reference (so
it's safe to treat as a real std::type_info object). The reference is
bound to an object of literal type, so that it doesn't need a guard
variable to make its initialization thread-safe.

This patch also fixes 87520 by ensuring that the type-punned reference
is bound to "a region of storage of suitable size and alignment to
contain an object of the reference's type" (as per the proposed
resolution of Core DR 453).

If all objects are built with the fixed version of GCC then -frtti and
-fno-rtti can be mixed freely and std::make_shared will work correctly.
If some objects are built with unfixed GCC versions then problems can
still arise, depending on which template instantiations are kept by the
linker.

PR libstdc++/85930
PR libstdc++/87520
* include/bits/shared_ptr_base.h (_Sp_make_shared_tag::_S_ti)
[__cpp_rtti]: Define even when RTTI is enabled. Use array of
sizeof(type_info) so that type-punned reference binds to an object
of the correct size as well as correct alignment.
(_Sp_counted_ptr_inplace::_M_get_deleter) [__cpp_rtti]: Check for
_S_ti() reference even when RTTI is enabled.
(__shared_ptr(_Sp_make_shared_tag, const _Alloc&, _Args&&...))
[__cpp_rtti]: Pass _S_ti() instead of typeid(_Sp_make_shared_tag).

From-SVN: r266376

6 years agoUpdate changelog entry.
Martin Liska [Thu, 22 Nov 2018 10:44:40 +0000 (10:44 +0000)]
Update changelog entry.

From-SVN: r266374

6 years ago* g++.dg/lto/odr-2_0.C: Remove extra brace
Andreas Schwab [Thu, 22 Nov 2018 10:42:19 +0000 (10:42 +0000)]
* g++.dg/lto/odr-2_0.C: Remove extra brace

From-SVN: r266373

6 years agore PR c++/87229 (ICE: tree code 'call_expr' is not supported in LTO streams)
Richard Biener [Thu, 22 Nov 2018 09:54:14 +0000 (09:54 +0000)]
re PR c++/87229 (ICE: tree code 'call_expr' is not supported in LTO streams)

2018-11-22  Richard Biener  <rguenther@suse.de>

PR lto/87229
PR lto/88112
* lto-streamer-out.c (lto_is_streamable): Allow CALL_EXPRs
which can appear in size expressions.
* tree-streamer-in.c (unpack_ts_base_value_fields): Stream
CALL_EXPR_BY_DESCRIPTOR.
(streamer_read_tree_bitfields): Stream CALL_EXPR_IFN.
* tree-streamer-out.c (pack_ts_base_value_fields): Stream
CALL_EXPR_BY_DESCRIPTOR.
(streamer_write_tree_bitfields): Stream CALL_EXPR_IFN.

Revert
PR lto/87229
* tree.c (free_lang_data_in_one_sizepos): Free non-gimple-val
sizepos values.

From-SVN: r266372

6 years agore PR tree-optimization/88069 (ICE in check_loop_closed_ssa_def, at tree-ssa-loop...
Richard Biener [Thu, 22 Nov 2018 09:50:58 +0000 (09:50 +0000)]
re PR tree-optimization/88069 (ICE in check_loop_closed_ssa_def, at tree-ssa-loop-manip.c:709)

2018-11-22  Richard Biener  <rguenther@suse.de>

PR tree-optimization/88069
* tree-ssa-sccvn.c (visit_phi): Tweak previous fix to not
apply to default defs.

From-SVN: r266371

6 years agore PR target/85644 (-fstack-protector generates invalid read to %fs:0x0 on mac)
Jakub Jelinek [Thu, 22 Nov 2018 09:48:43 +0000 (10:48 +0100)]
re PR target/85644 (-fstack-protector generates invalid read to %fs:0x0 on mac)

PR target/85644
PR target/86832
* config/i386/i386.c (ix86_option_override_internal): Default
ix86_stack_protector_guard to SSP_TLS only if TARGET_THREAD_SSP_OFFSET
is defined.
* config/i386/i386.md (stack_protect_set, stack_protect_set_<mode>,
stack_protect_test, stack_protect_test_<mode>): Use empty condition
instead of TARGET_SSP_TLS_GUARD.

From-SVN: r266370

6 years agore PR c++/87386 (Error message for static_assert show wrong range)
Jakub Jelinek [Thu, 22 Nov 2018 09:26:29 +0000 (10:26 +0100)]
re PR c++/87386 (Error message for static_assert show wrong range)

PR c++/87386
* parser.c (cp_parser_operator): Use str.get_value () instead of just
str in USERDEF_LITERAL_VALUE and USERDEF_LITERAL_SUFFIX_ID arguments.

From-SVN: r266369

6 years agoDo not mix -fsanitize=thread and -mabi=ms (PR sanitizer/88017).
Martin Liska [Thu, 22 Nov 2018 09:13:19 +0000 (10:13 +0100)]
Do not mix -fsanitize=thread and -mabi=ms (PR sanitizer/88017).

2018-11-22  Martin Liska  <mliska@suse.cz>

PR sanitizer/88017
* config/i386/i386.c (ix86_option_override_internal):
2018-11-22  Martin Liska  <mliska@suse.cz>

PR sanitizer/88017
* gcc.dg/tsan/pr88017.c: New test.

From-SVN: r266368