gcc.git
6 years ago[RS6000] movdi_internal64 insn lengths
Alan Modra [Thu, 29 Nov 2018 05:01:05 +0000 (15:31 +1030)]
[RS6000] movdi_internal64 insn lengths

Fixes alternatives wi<-Oj (xxlxor), wi<-wM (xxlorc) and wv<-wS
(xxsltib+extend).

* config/rs6000/rs6000.md (movdi_internal64): Correct lengths.

From-SVN: r266609

6 years ago[RS6000] CONST_DOUBLE tidy
Alan Modra [Thu, 29 Nov 2018 04:59:19 +0000 (15:29 +1030)]
[RS6000] CONST_DOUBLE tidy

Once upon a time CONST_DOUBLE was used to hold large integer constants
that didn't fit into a CONST_INT.  Now that CONST_INT is always at
least 64 bits, and the rs6000 backend uses CONST_WIDE_INT for larger
integers, there is no need for old code dealing with integers in
CONST_DOUBLE.  The rs6000 backend also doesn't create DImode subregs
of TFmode CONST_DOUBLE, as once we did.  This patch cleans up a few
leftovers from the past.

* config/rs6000/predicates.md (easy_fp_constant): Remove code
dealing with integers in const_double.  Assert on unexpected
modes.  Delete superfluous ABI_V4 test.
* config/rs6000/rs6000.c (rs6000_emit_move): Comment fixes.
Don't call easy_fp_constant for Pmode.
(rs6000_hash_constant): Remove code dealing with integers in
const_double.
(rs6000_legitimate_constant_p): Likewise.
(output_toc): Formatting, use CONST_DOUBLE_P.

From-SVN: r266608

6 years ago[RS6000] "G" and "H" constraints
Alan Modra [Thu, 29 Nov 2018 04:58:08 +0000 (15:28 +1030)]
[RS6000] "G" and "H" constraints

The patch fixes two cases where the "G" and "H" constraints were used
incorrectly.  Their purpose is calculating insn lengths.  Thus it
never makes sense to put "GH" together or with "F" in an insn
alternative.

movdi_internal32 used "GHF" in an alternative so I replaced that with
"F", and added length attributes for the insn, which were missing.
There are some formatting changes too, to make alternatives line up
with attributes.

The FMOVE128 version of mov<mode>_softfloat also had "GHF" in an
alternative, so "GH" is dropped and "F" moved to a separate
alternative in order to get insn lengths correct.  Well by correct I
mean we need to choose the maximum insn length otherwise branches
might not reach.  Note the very large length for "F".  I think it
would be better to force soft-float long double constants to memory in
64-bit mode, but that's a patch for another day.

* config/rs6000/constraints.md (G, H): Comment on purpose of
constraint.  Correct mode comments and "G" mode test.
* config/rs6000/rs6000.md (movdi_internal32): Remove "GH" from
alternative handling "F".  Add length attr.  Formatting.
(mov<mode>_softfloat <FMOVE128>): Delete "GH" from
alternative, and move "F" to separate alternative.  Correct
insn lengths.

From-SVN: r266607

6 years ago[RS6000] Bogus easy_fp_constant call
Alan Modra [Thu, 29 Nov 2018 04:56:33 +0000 (15:26 +1030)]
[RS6000] Bogus easy_fp_constant call

easy_fp_constant accepts const_double, easy_vector_constant accepts
const_vector.  Calling one from the other therefore will always return
false.  I believe the zero_constant call in easy_vector_constant will
cover the 0.0 case of easy_fp_constant.

* config/rs6000/predicates.md (easy_vector_constant): Don't call
easy_fp_constant.

From-SVN: r266606

6 years ago[RS6000] inline plt call sequences
Alan Modra [Thu, 29 Nov 2018 04:53:49 +0000 (15:23 +1030)]
[RS6000] inline plt call sequences

Finally, the point of the previous patches in this series, support for
inline PLT calls, keyed off -fno-plt.  This emits code using new
relocations that tie all insns in the sequence together, so that the
linker can edit the sequence back to a direct call should the call
target turn out to be local.  An example of ELFv2 code to call puts is
as follows:

     .reloc .,R_PPC64_PLTSEQ,puts
        std 2,24(1)
     .reloc .,R_PPC64_PLT16_HA,puts
        addis 12,2,0
     .reloc .,R_PPC64_PLT16_LO_DS,puts
        ld 12,0(12)
     .reloc .,R_PPC64_PLTSEQ,puts
        mtctr 12
     .reloc .,R_PPC64_PLTCALL,puts
        bctrl
        ld 2,24(1)

"addis 12,2,puts@plt@ha" and "ld 12,puts@plt@l(12)" are also supported
by the assembler.  gcc instead uses the explicit R_PPC64_PLT16_HA and
R_PPC64_PLT16_LO_DS relocs because when the call is to __tls_get_addr
an extra reloc is emitted at every place where one is shown above, to
specify the __tls_get_addr arg.  The linker expects the extra reloc to
come first.  .reloc enforces that ordering.

The patch also changes code emitted for longcalls if the assembler
supports the new marker relocs, so that these too can be edited.  One
side effect of longcalls using PLT16 relocs is that they can now be
resolved lazily by ld.so.

I don't support lazy inline PLT calls for ELFv1, because ELFv1 would
need barriers to reliably load both the function address and toc
pointer from the PLT.  ELFv1 -fno-plt uses the longcall sequence
instead, which isn't edited by GNU ld.

* config.in (HAVE_AS_PLTSEQ): Add.
* config/rs6000/predicates.md (indirect_call_operand): New.
* config/rs6000/rs6000-protos.h (rs6000_pltseq_template),
(rs6000_sibcall_sysv): Declare.
* config/rs6000/rs6000.c (init_cumulative_args): Set cookie
CALL_LONG for -fno-plt.
(print_operand <T, z, 0>): Handle UNSPEC_PLTSEQ.
(rs6000_indirect_call_template_1): Emit .reloc directives for
UNSPEC_PLTSEQ calls.
(rs6000_pltseq_template): New function.
(rs6000_longcall_ref): Add arg parameter.  Use PLT16 insns if
relocs supported by assembler.  Move SYMBOL_REF test to callers.
(rs6000_call_aix): Adjust rs6000_longcall_ref call.  Package
insns in UNSPEC_PLTSEQ, preserving original func_desc.
(rs6000_call_sysv): Likewise.
(rs6000_sibcall_sysv): New function.
* config/rs6000/rs6000.h (HAVE_AS_PLTSEQ): Provide default.
* config/rs6000/rs6000.md (UNSPEC_PLTSEQ, UNSPEC_PLT16_HA,
UNSPEC_PLT16_LO): New.
(pltseq_tocsave, pltseq_plt16_ha, pltseq_plt16_lo, pltseq_mtctr): New.
(call_indirect_nonlocal_sysv): Don't differentiate zero from non-zero
cookie in constraints.  Test explicitly for flags in length attr.
Handle unspec operand 1.
(call_value_indirect_nonlocal_sysv): Likewise.
(call_indirect_aix, call_value_indirect_aix): Handle unspec operand 1.
(call_indirect_elfv2, call_value_indirect_elfv2): Likewise.
(sibcall, sibcall_value): Use rs6000_sibcall_sysv.
(sibcall_indirect_nonlocal_sysv): New pattern.
(sibcall_value_indirect_nonlocal_sysv): Likewise.
(sibcall_nonlocal_sysv, sibcall_value_nonlocal_sysv): Remove indirect
call alternatives.
* configure.ac: Check for gas plt sequence marker support.
* configure: Regenerate.

From-SVN: r266605

6 years ago[RS6000] Use standard call patterns for __tls_get_addr calls
Alan Modra [Thu, 29 Nov 2018 04:47:51 +0000 (15:17 +1030)]
[RS6000] Use standard call patterns for __tls_get_addr calls

The current code handling __tls_get_addr calls for powerpc*-linux
generates a call then overwrites the call insn with a special
tls_{gd,ld}_{aix,sysv} pattern.  It's done that way to support
!TARGET_TLS_MARKERS, where the arg setup insns need to be emitted
immediately before the branch and link.  When TARGET_TLS_MARKERS, the
arg setup insns are split from the actual call, but we then have a
non-standard call pattern that needs to be carried through to output.

This patch changes that scheme, to instead use the standard call
patterns for __tls_get_addr calls, except for the now rare
!TARGET_TLS_MARKERS case.  Doing it this way should be better for
maintenance as the !TARGET_TLS_MARKERS code can eventually disappear.
It also makes it possible to support longcalls (and in following
patches, inline plt calls) for __tls_get_addr without introducing yet
more special call patterns.

__tls_get_addr calls do however need to be different to standard
calls, because when TARGET_TLS_MARKERS the calls are decorated with an
argument specifier, eg. "bl __tls_get_addr(thread_var@tlsgd)" that
causes a reloc to be emitted by the assembler tying the call to its
arg setup insns.  I chose to smuggle the arg in the currently unused
stack size rtl.

I've also introduced rs6000_call_sysv to generate rtl for sysv calls,
as rs6000_call_aix does for aix and elfv2 calls.  This allows
rs6000_longcall_ref to be local to rs6000.c since the calls in the
expanders never did anything for darwin.

* config/rs6000/predicates.md (unspec_tls): New.
* config/rs6000/rs6000-protos.h (rs6000_call_template),
(rs6000_sibcall_template): Update prototype.
(rs6000_longcall_ref): Delete.
(rs6000_call_sysv): Declare.
* config/rs6000/rs6000.c (edit_tls_call_insn): New function.
(global_tlsarg): New variable.
(rs6000_legitimize_tls_address): Rewrite __tls_get_addr call
handling.
(print_operand): Extract UNSPEC_TLSGD address operand.
(rs6000_call_template, rs6000_sibcall_template): Remove arg
parameter, extract from second call operand instead.
(rs6000_longcall_ref): Make static, localize vars.
(rs6000_call_aix): Rename parameter to reflect new usage.  Take
tlsarg from global_tlsarg.  Don't create unused rtl or nop insns.
(rs6000_sibcall_aix): Rename parameter to reflect new usage.  Take
tlsarg from global_tlsarg.
(rs6000_call_sysv): New function.
* config/rs6000/rs6000.md: Adjust rs6000_call_template and
rs6000_sibcall_template throughout.
(tls_gd_aix, tls_gd_sysv, tls_gd_call_aix, tls_gd_call_sysv): Delete.
(tls_ld_aix, tls_ld_sysv, tls_ld_call_aix, tls_ld_call_sysv): Delete.
(tls_gdld_nomark): New insn.
(tls_gd): Swap operand order.  Simplify mode selection.
(tls_gd_high, tls_gd_low): Swap operand order.
(tls_ld): Remove const_int 0 vector element from UNSPEC_TLSLD.
Simplify mode selection.
(tls_ld_high, tls_ld_low): Similarly adjust UNSPEC_TLSLD.
(call, call_value): Don't assert for second call operand.
Use rs6000_call_sysv.

From-SVN: r266604

6 years ago[RS6000] Remove constraints on call rounded_stack_size_rtx arg
Alan Modra [Thu, 29 Nov 2018 04:46:21 +0000 (15:16 +1030)]
[RS6000] Remove constraints on call rounded_stack_size_rtx arg

This call arg is unused on rs6000.

* config/rs6000/darwin.md (call_indirect_nonlocal_darwin64),
(call_nonlocal_darwin64, call_value_indirect_nonlocal_darwin64),
(call_value_nonlocal_darwin64): Remove constraints from second call
arg, the rounded_stack_size_rtx arg.
* config/rs6000/rs6000.md (tls_gd_aix, tls_gd_sysv, tls_gd_call_aix),
(tls_gd_call_sysv, tls_ld_aix, tls_ld_sysv, tls_ld_call_aix),
(tls_ld_call_sysv, call_local32, call_local64, call_value_local32),
(call_value_local64, call_indirect_nonlocal_sysv),
(call_nonlocal_sysv, call_nonlocal_sysv_secure),
(call_value_indirect_nonlocal_sysv, call_value_nonlocal_sysv),
(call_value_nonlocal_sysv_secure, call_local_aix),
(call_value_local_aix, call_nonlocal_aix, call_value_nonlocal_aix),
(call_indirect_aix, call_value_indirect_aix, call_indirect_elfv2),
(call_value_indirect_elfv2, sibcall_local32, sibcall_local64),
(sibcall_value_local32, sibcall_value_local64, sibcall_aix),
(sibcall_value_aix): Likewise.

From-SVN: r266603

6 years ago[RS6000] Replace TLSmode with P, and correct tls call mems
Alan Modra [Thu, 29 Nov 2018 04:45:00 +0000 (15:15 +1030)]
[RS6000] Replace TLSmode with P, and correct tls call mems

There is really no need to define a TLSmode mode iterator that is
identical (since !TARGET_64BIT == TARGET_32BIT) to the much used P
mode iterator.  It's nonsense to think we might ever want to support
32-bit TLS on 64-bit or vice versa!  The patch also fixes a minor
error in the call mems.  All other direct calls use (call (mem:SI ..)).

* config/rs6000/rs6000.md (TLSmode): Delete mode iterator.  Replace
with P throughout except for call mems which should use SI.
(tls_abi_suffix, tls_sysv_suffix, tls_insn_suffix): Delete mode
attributes.  Replace with bits, mode and ptrload respectively.

From-SVN: r266602

6 years ago[RS6000] rs6000_indirect_call_template
Alan Modra [Thu, 29 Nov 2018 04:43:21 +0000 (15:13 +1030)]
[RS6000] rs6000_indirect_call_template

Like the last patch for external calls, now handle most assembly code
for indirect calls in one place.  The patch also merges some insns,
correcting some !rs6000_speculate_indirect_jumps cases branching to
LR, which don't require a speculation barrier.

* config/rs6000/rs6000-protos.h (rs6000_indirect_call_template),
(rs6000_indirect_sibcall_template): Declare.
* config/rs6000/rs6000.c (rs6000_indirect_call_template_1),
(rs6000_indirect_call_template, rs6000_indirect_sibcall_template):
New functions.
* config/rs6000/rs6000.md (call_indirect_nonlocal_sysv),
(call_value_indirect_nonlocal_sysv, sibcall_nonlocal_sysv),
(call_indirect_aix, call_value_indirect_aix): Use
rs6000_indirect_call_template and rs6000_indirect_sibcall_template.
call_indirect_elfv2, call_value_indirect_elfv2): Likewise, and
handle both speculation and non-speculation cases.
(call_indirect_aix_nospec, call_value_indirect_aix_nospec): Delete.
(call_indirect_elfv2_nospec, call_value_indirect_elfv2_nospec): Delete.

From-SVN: r266601

6 years ago[RS6000] rs6000_call_template for external call insn assembly output
Alan Modra [Thu, 29 Nov 2018 04:41:06 +0000 (15:11 +1030)]
[RS6000] rs6000_call_template for external call insn assembly output

This is a first step in tidying rs6000 call patterns, in preparation
to support inline plt calls.

* config/rs6000/rs6000-protos.h (rs6000_call_template): Declare.
(rs6000_sibcall_template): Declare.
(macho_call_template): Rename from output_call.
* config/rs6000/rs6000.c (rs6000_call_template_1): New function.
(rs6000_call_template, rs6000_sibcall_template): Likewise.
(macho_call_template): Rename from output_call.
* config/rs6000/rs6000.md (tls_gd_aix, tls_gd_sysv),
(tls_gd_call_aix, tls_gd_call_sysv, tls_ld_aix, tls_ld_sysv),
(tls_ld_call_aix, tls_ld_call_sysv, call_nonlocal_sysv),
(call_nonlocal_sysv_secure, call_value_nonlocal_sysv),
(call_value_nonlocal_sysv_secure, call_nonlocal_aix),
(call_value_nonlocal_aix): Use rs6000_call_template and update
occurrences of output_call to macho_call_template.
(sibcall_nonlocal_sysv, sibcall_value_nonlocal_sysv, sibcall_aix),
(sibcall_value_aix): Use rs6000_sibcall_template.

From-SVN: r266600

6 years agors6000-string.c (expand_block_clear): Change how we determine if unaligned vsx is ok.
Aaron Sawdey [Thu, 29 Nov 2018 03:56:14 +0000 (03:56 +0000)]
rs6000-string.c (expand_block_clear): Change how we determine if unaligned vsx is ok.

2018-11-28  Aaron Sawdey  <acsawdey@linux.ibm.com>

* config/rs6000/rs6000-string.c (expand_block_clear): Change how
we determine if unaligned vsx is ok.

From-SVN: r266599

6 years agoPR libstdc++/86910 fix filesystem::create_directories
Jonathan Wakely [Thu, 29 Nov 2018 00:39:37 +0000 (00:39 +0000)]
PR libstdc++/86910 fix filesystem::create_directories

Implement the proposed semantics from P1164R0, which reverts the changes
of LWG 2935. This means that failure to create a directory because a
non-directory already exists with that name will be reported as an
error.

While rewriting the function, also fix PR 87846, which is a result of
the C++17 changes to how a trailing slash on a path affects the last
component of a path.

PR libstdc++/86910
PR libstdc++/87846
* src/filesystem/ops.cc (experimental::create_directories): Report
an error when the path resolves to an existing non-directory (P1164).
* src/filesystem/std-ops.cc (create_directories): Likewise. Handle
empty filenames due to trailing slashes.
* testsuite/27_io/filesystem/operations/create_directories.cc: Test
when some component of the path exists and is not a directory. Test
trailing slashes.
* testsuite/experimental/filesystem/operations/create_directories.cc:
Likewise.

From-SVN: r266598

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

From-SVN: r266597

6 years agoPR c/88065 - ICE in -Wsizeof-pointer-memaccess on an invalid strncpy
Martin Sebor [Wed, 28 Nov 2018 23:04:09 +0000 (23:04 +0000)]
PR c/88065 - ICE in -Wsizeof-pointer-memaccess on an invalid strncpy

PR c/88065 - ICE in -Wsizeof-pointer-memaccess on an invalid strncpy
PR c/87297 - ICE on strncpy with an undeclared argument

gcc/c-family/ChangeLog:

PR c/88065
PR c/87297
* c-warn.c (sizeof_pointer_memaccess_warning): Bail if source
or destination is an error.

gcc/testsuite/ChangeLog:

PR c/88065
PR c/87297
* c-c++-common/Wsizeof-pointer-memaccess4.c: New test.

From-SVN: r266594

6 years agolibphobos: Merge common version blocks using arch_any conditions
Iain Buclaw [Wed, 28 Nov 2018 21:53:06 +0000 (21:53 +0000)]
libphobos: Merge common version blocks using arch_any conditions

This sets a precedence in upstream for merging architecture agnostic
C bindings into one block, rather than separate duplicated blocks.

A nice side-effect is it almost completes the C bindings for
s390-linux-gnu and sparc-linux-gnu, and fixes a bug on MIPS32 where
O_SYNC had the wrong value.

Backported from upstream druntime master.

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

From-SVN: r266593

6 years agoImplement P1094R2, Nested inline namespaces.
Marek Polacek [Wed, 28 Nov 2018 21:39:42 +0000 (21:39 +0000)]
Implement P1094R2, Nested inline namespaces.

* parser.c (cp_parser_namespace_definition): Parse the optional inline
keyword in a nested-namespace-definition.  Adjust push_namespace call.
Formatting fix.

* g++.dg/cpp2a/nested-inline-ns1.C: New test.
* g++.dg/cpp2a/nested-inline-ns2.C: New test.

From-SVN: r266592

6 years ago[PR c++/87531] operator= lookup in templates
Nathan Sidwell [Wed, 28 Nov 2018 21:25:06 +0000 (21:25 +0000)]
[PR c++/87531] operator= lookup in templates

https://gcc.gnu.org/ml/gcc-patches/2018-11/msg02301.html
PR c++/87531
* class.c (finish_struct): In a template, add artificial using
decl for operator=.

* g++.dg/lookup/pr87531.C: New.

From-SVN: r266590

6 years agopredict.c (determine_unlikely_bbs): Forward declare...
Jan Hubicka [Wed, 28 Nov 2018 20:48:53 +0000 (21:48 +0100)]
predict.c (determine_unlikely_bbs): Forward declare...

* predict.c (determine_unlikely_bbs): Forward declare; also determine
edges that are always known to be taken because it is only likely
edge out of given BB.
(tree_estimate_probability): Call before profile guessing to get bit
of extra precision.

* gcc.dg/predict-13.c: Update template.
* gcc.dg/predict-13b.c: New testcase.
* gcc.dg/predict-22.c: New testcase.
* gcc.dg/tree-ssa/ipa-split-4.c: Change abort to other function to
get sane profile.

From-SVN: r266587

6 years ago* lto.c (lto_read_decls): Fix handling of INTEGER_CST.
Jan Hubicka [Wed, 28 Nov 2018 20:36:13 +0000 (21:36 +0100)]
* lto.c (lto_read_decls): Fix handling of INTEGER_CST.

From-SVN: r266586

6 years agotree-ssa-ifcombine.c (update_profile_after_ifcombine): Handle profile_probability...
Jan Hubicka [Wed, 28 Nov 2018 20:34:06 +0000 (21:34 +0100)]
tree-ssa-ifcombine.c (update_profile_after_ifcombine): Handle profile_probability::always better.

* tree-ssa-ifcombine.c (update_profile_after_ifcombine): Handle
profile_probability::always better.

From-SVN: r266585

6 years agoprofile-count.h (profile_count::split): Give better result when splitting profile_pro...
Jan Hubicka [Wed, 28 Nov 2018 20:29:24 +0000 (21:29 +0100)]
profile-count.h (profile_count::split): Give better result when splitting profile_probability::always.

* profile-count.h (profile_count::split): Give better result when
splitting profile_probability::always.

From-SVN: r266584

6 years agoexcept.c (do_allocate_exception): Annotate __cxa_allocate_exception as COLD.
Jan Hubicka [Wed, 28 Nov 2018 20:25:08 +0000 (21:25 +0100)]
except.c (do_allocate_exception): Annotate __cxa_allocate_exception as COLD.

* except.c (do_allocate_exception): Annotate __cxa_allocate_exception
as COLD.

From-SVN: r266583

6 years agore PR target/88207 (gcc.target/i386/pr22076.c etc. FAIL)
Vladimir Makarov [Wed, 28 Nov 2018 20:08:03 +0000 (20:08 +0000)]
re PR target/88207 (gcc.target/i386/pr22076.c etc. FAIL)

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

PR target/88207
* ira-costs.c (scan_one_insn): Process subregs when updating costs
for pseudos and allocnos from insn.

From-SVN: r266582

6 years agoPR c++/88222 - ICE with bit-field with invalid type.
Marek Polacek [Wed, 28 Nov 2018 20:03:06 +0000 (20:03 +0000)]
PR c++/88222 - ICE with bit-field with invalid type.

* decl.c (grokdeclarator): Check if declarator is null.

* g++.dg/ext/flexary31.C: New test.

From-SVN: r266581

6 years ago* gcc.dg/recip_sqrt_mult_[12345]: Do not add -fcompare-debug on AIX.
David Edelsohn [Wed, 28 Nov 2018 18:33:46 +0000 (18:33 +0000)]
* gcc.dg/recip_sqrt_mult_[12345]: Do not add -fcompare-debug on AIX.

From-SVN: r266577

6 years agopr86900.C: XFAIL AIX.
David Edelsohn [Wed, 28 Nov 2018 18:30:41 +0000 (18:30 +0000)]
pr86900.C: XFAIL AIX.

        * g++.dg/debug/dwarf2/pr86900.C: XFAIL AIX.
        * g++.dg/opt/pr83084.C: XFAIL AIX.

From-SVN: r266576

6 years ago* config/rs6000/aix72.h: Update to match aix71.h changes.
David Edelsohn [Wed, 28 Nov 2018 18:10:21 +0000 (18:10 +0000)]
* config/rs6000/aix72.h: Update to match aix71.h changes.

From-SVN: r266574

6 years agocompiler: inline functions with assignments and return statements
Ian Lance Taylor [Wed, 28 Nov 2018 18:08:21 +0000 (18:08 +0000)]
compiler: inline functions with assignments and return statements

    Support inlining functions that contain only assignments and return
    statements, with expressions of either constants or parameters.
    Functions that contain other kinds of statements or expressions are
    not yet inlined.  With this change, about 100 functions in the
    standard library are inlinable.

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

From-SVN: r266573

6 years agoMerge libphobos upstream version 2.076.1
Iain Buclaw [Wed, 28 Nov 2018 17:54:07 +0000 (17:54 +0000)]
Merge libphobos upstream version 2.076.1

Updated the library version to 76:3:0.

libphobos/ChangeLog:

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

* Makefile.in: Rebuild.
* configure: Rebuild.
* configure.ac (DRUNTIME_SOVERSION): Remove.
(PHOBOS_SOVERSION): Remove.
(libtool_VERSION): Add.
* libdruntime/Makefile.am: Use libtool_VERSION.
* libdruntime/Makefile.in: Rebuild.
* src/Makefile.am: Use libtool_VERSION.
* src/Makefile.in: Rebuild.
* testsuite/Makefile.in: Rebuild.

From-SVN: r266572

6 years agoconstraints.md: Add "C" constraint for call insns.
Jeff Law [Wed, 28 Nov 2018 17:26:03 +0000 (10:26 -0700)]
constraints.md: Add "C" constraint for call insns.

* config/h8300/constraints.md: Add "C" constraint for call insns.
* config/h8300/h8300.md (call, call_value): Turn into a define_expand
and define_insn pair.  Move invalid call targets into a register in
the expander and fix constraints in the matching pattern.
* config/h8300/predicates.md (call_expander_operand): Renamed from
call_insn_operand.  Reject things we shouldn't be trying to handle.
(call_insn_operand): New predicate for use by the call/call_value
insns.
(small_call_insn_operand): Update appropriately.

From-SVN: r266571

6 years ago[PATCH][GCC][AARCH64] Replace calls to strtok with strtok_r in aarch64 attribute...
Sam Tebbs [Wed, 28 Nov 2018 17:08:17 +0000 (17:08 +0000)]
[PATCH][GCC][AARCH64] Replace calls to strtok with strtok_r in aarch64 attribute handling code

2018-11-28  Sam Tebbs  <sam.tebbs@arm.com>

* config/aarch64/aarch64.c (aarch64_process_target_attr): Replace
calls to strtok with strtok_r.

From-SVN: r266570

6 years agoFix undefined references in libstdc++fs.a
Jonathan Wakely [Wed, 28 Nov 2018 17:07:22 +0000 (17:07 +0000)]
Fix undefined references in libstdc++fs.a

The recent patch for PR 83306 removed the fs_err_concat functions that
were used by the experimental::filesystem::filesystem_error class as
well. This fixes it by doing the string generation directly in
filesystem_error::_M_gen_what() instead of using the removed function.

PR libstdc++/83306
* src/filesystem/path.cc (filesystem_error::_M_gen_what()): Create
string directly, instead of calling fs_err_concat.

From-SVN: r266569

6 years agoPR libstdc++/83511 add default argument to basic_string_view::substr
Jonathan Wakely [Wed, 28 Nov 2018 16:53:35 +0000 (16:53 +0000)]
PR libstdc++/83511 add default argument to basic_string_view::substr

PR libstdc++/83511
* include/std/string_view (basic_string_view::substr): Add default
argument to first parameter.
* include/experimental/string_view (basic_string_view::substr):
Likewise.
* testsuite/21_strings/basic_string_view/operations/substr/char/
83511.cc: New test.
* testsuite/21_strings/basic_string_view/operations/substr/wchar_t/
83511.cc: New test.
* testsuite/experimental/string_view/operations/substr/char/83511.cc:
New test.
* testsuite/experimental/string_view/operations/substr/wchar_t/83511.cc:
New test.

From-SVN: r266568

6 years agoImplement uniform container erasure for C++20.
Edward Smith-Rowland [Wed, 28 Nov 2018 16:44:25 +0000 (16:44 +0000)]
Implement uniform container erasure for C++20.

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

Implement uniform container erasure for C++20.
* include/Makefile.am: Move erase_if.h.
* include/Makefile.in: Move erase_if.h.
* include/experimental/bits/erase_if.h: Move ...
* include/bits/erase_if.h: ... here.
* include/experimental/map: Move erase_if.h.
* include/experimental/set: Move erase_if.h.
* include/experimental/unordered_map: Move erase_if.h.
* include/experimental/unordered_set: Move erase_if.h.
* include/std/deque (erase_if, erase): New functions.
* include/std/forward_list: Ditto.
* include/std/list: Ditto.
* include/std/map: Ditto.
* include/std/set: Ditto.
* include/std/string: Ditto.
* include/std/unordered_map: Ditto.
* include/std/unordered_set: Ditto.
* include/std/vector: Ditto.
* testsuite/21_strings/basic_string/erasure.cc: New test.
* testsuite/23_containers/deque/erasure.cc: New test.
* testsuite/23_containers/forward_list/erasure.cc: New test.
* testsuite/23_containers/list/erasure.cc: New test.
* testsuite/23_containers/map/erasure.cc: New test.
* testsuite/23_containers/set/erasure.cc: New test.
* testsuite/23_containers/unordered_map/erasure.cc: New test.
* testsuite/23_containers/unordered_set/erasure.cc: New test.
* testsuite/23_containers/vector/erasure.cc: New test.

From-SVN: r266567

6 years agoApply resolution for LWG DR 3096
Jonathan Wakely [Wed, 28 Nov 2018 15:36:56 +0000 (15:36 +0000)]
Apply resolution for LWG DR 3096

Add fix for "path::lexically_relative is confused by trailing slashes".

* doc/xml/manual/intro.xml: Document LWG 3096 change.
* src/filesystem/std-path.cc (path::lexically_relative(const path&)):
Treat a final empty element equivalently to a final dot element.
* testsuite/27_io/filesystem/path/generation/relative.cc: Add checks
for the examples in the DR.

From-SVN: r266566

6 years agoPR libstdc++/83306 make filesystem_error no-throw copyable
Jonathan Wakely [Wed, 28 Nov 2018 15:27:11 +0000 (15:27 +0000)]
PR libstdc++/83306 make filesystem_error no-throw copyable

The class API provides no way to modify the members, so we can share
them between copies of the same object. Copying becomes a simple
reference count update, which doesn't throw.

Also adjust the what() string to allow distinguishing between an empty
path passed to the constructor, and no path.

PR libstdc++/83306
* include/bits/fs_path.h (filesystem_error): Move data members into
pimpl class owned by shared_ptr. Remove inline definitions of member
functions.
* src/filesystem/std-path.cc (filesystem_error::_Impl): Define.
(filesystem_error): Define member functions.
* testsuite/27_io/filesystem/filesystem_error/cons.cc: New test.
* testsuite/27_io/filesystem/filesystem_error/copy.cc: New test.

From-SVN: r266565

6 years agoChanged email ID to existing one.
Sameera Deshpande [Wed, 28 Nov 2018 14:25:28 +0000 (19:55 +0530)]
Changed email ID to existing one.

From-SVN: r266563

6 years ago[libbacktrace] Fix segfault upon allocation failure
Tom de Vries [Wed, 28 Nov 2018 14:06:23 +0000 (14:06 +0000)]
[libbacktrace] Fix segfault upon allocation failure

If the allocation of abbrevs->abbrevs in read_abbrevs fails, then
abbrevs->num_abbrevs remains nonzero, and consequently free_abbrevs will
segfault when accessing abbrevs->abbrevs.

Fix this by setting abbrevs->num_abbrevs only after abbrevs->abbrevs
allocation has succeeded.

Bootstrapped and reg-tested on x86_64.

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

* dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
failure.

From-SVN: r266562

6 years agore PR tree-optimization/88223 (Wrong code for intrinsic memmove)
Richard Biener [Wed, 28 Nov 2018 13:51:42 +0000 (13:51 +0000)]
re PR tree-optimization/88223 (Wrong code for intrinsic memmove)

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

PR tree-optimization/88223
* tree-ssa-sccvn.c (vn_reference_lookup_3): When skipping
over a stored-same value may-alias store make sure to consider
partial overlaps which are valid when TBAA reasonings do not
apply and byte-granular overlaps are possible at all.

* gcc.dg/torture/pr88223.c: New testcase.

From-SVN: r266560

6 years agoUpdate C++17 library status docs
Jonathan Wakely [Wed, 28 Nov 2018 13:49:47 +0000 (13:49 +0000)]
Update C++17 library status docs

* doc/xml/manual/status_cxx2017.xml: Update C++17 status.
* doc/html/*: Regenerate.

From-SVN: r266559

6 years agore PR tree-optimization/88217 (Compile time and memory hog w/ -O2 -fstrict-enums...
Richard Biener [Wed, 28 Nov 2018 13:04:27 +0000 (13:04 +0000)]
re PR tree-optimization/88217 (Compile time and memory hog w/ -O2 -fstrict-enums -fno-tree-forwprop -fno-tree-fre)

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

PR tree-optimization/88217
* vr-values.c (vr_values::extract_range_from_phi_node): Make
sure to handle results > +INF and < -INF correctly when
trying to drop down to +INF - 1 or -INF + 1.

* g++.dg/pr88217.C: New testcase.

From-SVN: r266557

6 years ago[RS6000] Bootstrap failure compiling xcoffout.c
Alan Modra [Wed, 28 Nov 2018 12:54:44 +0000 (23:24 +1030)]
[RS6000] Bootstrap failure compiling xcoffout.c

git commit 41f70262f (svn rev 264868) exposed a signed/unsigned
comparison.  Fixed by matching the type of the local var to that of
the tree field.

* xcoffout.c (do_block): Signed/unsigned warning fix.

From-SVN: r266555

6 years agore PR testsuite/85368 (phi-opt-11 test fails on IBM Z)
Jakub Jelinek [Wed, 28 Nov 2018 11:08:58 +0000 (12:08 +0100)]
re PR testsuite/85368 (phi-opt-11 test fails on IBM Z)

PR testsuite/85368
* gcc.dg/tree-ssa/phi-opt-11.c: For branch_cost targets, expect 0 ifs
rather than 0 or 2 depending on logical_op_short_circuit.

From-SVN: r266552

6 years agore PR tree-optimization/79351 (Invalid tree PRE optimization around compound literal)
Richard Biener [Wed, 28 Nov 2018 11:01:06 +0000 (11:01 +0000)]
re PR tree-optimization/79351 (Invalid tree PRE optimization around compound literal)

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

PR tree-optimization/79351
* tree-ssa-sccvn.c (vn_reference_lookup_3): For assignments from
empty CONSTRUCTORs ensure the store is at a constant position.

* gcc.dg/torture/pr79351.c: New testcase.

From-SVN: r266551

6 years agore PR fortran/88229 (ICE tree check: expected integer_cst, have nop_expr in get_len...
Richard Biener [Wed, 28 Nov 2018 10:59:12 +0000 (10:59 +0000)]
re PR fortran/88229 (ICE tree check: expected integer_cst, have nop_expr in get_len, at tree.h:5608)

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

PR tree-optimization/88229
* tree-ssa.c (non_rewritable_mem_ref_base): Check DECL_SIZE_UNIT
is an INTEGER_CST before accessing it so.

From-SVN: r266550

6 years ago[PATCH][GCC][DOC] Remove obsolete arm and aarch64 CPU names from invoke.texi
Sam Tebbs [Wed, 28 Nov 2018 10:31:13 +0000 (10:31 +0000)]
[PATCH][GCC][DOC] Remove obsolete arm and aarch64 CPU names from invoke.texi

gcc/ChangeLog:

2018-11-28  Sam Tebbs  <sam.tebbs@arm.com>

* doc/invoke.texi (-mtune=): Remove obsolete CPU names.

From-SVN: r266549

6 years agore PR target/88189 (ix86_expand_sse_movcc and blend for scalars)
Jakub Jelinek [Wed, 28 Nov 2018 08:54:31 +0000 (09:54 +0100)]
re PR target/88189 (ix86_expand_sse_movcc and blend for scalars)

PR target/88189
* config/i386/i386.c (ix86_expand_sse_movcc): Handle DFmode and
SFmode using sse4_1_blendvs[sd] with TARGET_SSE4_1.  Formatting fixes.
* config/i386/sse.md (sse4_1_blendv<ssemodesuffix>): New pattern.

* gcc.target/i386/sse4_1-pr88189-1.c: New test.
* gcc.target/i386/sse4_1-pr88189-2.c: New test.
* gcc.target/i386/avx-pr88189-1.c: New test.
* gcc.target/i386/avx-pr88189-2.c: New test.

From-SVN: r266548

6 years agore PR c++/87476 (char-array initialized from wide-string)
Jakub Jelinek [Wed, 28 Nov 2018 08:50:53 +0000 (09:50 +0100)]
re PR c++/87476 (char-array initialized from wide-string)

PR c++/87476
* typeck2.c (digest_init_r): Re-add handing of signed/unsigned char
strings and add it to the initialization of wide array from non-wide
string diagnostics too.

* g++.dg/cpp0x/pr87476-1.C: New test.
* g++.dg/cpp0x/pr87476-2.C: New test.

From-SVN: r266547

6 years agore PR sanitizer/88215 (UBSAN: Internal compiler error with attribute(unused))
Jakub Jelinek [Wed, 28 Nov 2018 08:49:08 +0000 (09:49 +0100)]
re PR sanitizer/88215 (UBSAN: Internal compiler error with attribute(unused))

PR c++/88215
* c-ubsan.c: Include langhooks.h.
(ubsan_instrument_division): Change gcc_assert that main variants
of op0 and op1 types are equal to gcc_checking_assert that the
main variants are compatible types.

* c-c++-common/ubsan/pr88215.c: New test.

From-SVN: r266546

6 years agore PR tree-optimization/88182 (ICE in vectorizable_reduction, at tree-vect-loop.c...
Richard Biener [Wed, 28 Nov 2018 08:29:16 +0000 (08:29 +0000)]
re PR tree-optimization/88182 (ICE in vectorizable_reduction, at tree-vect-loop.c:6465)

2018-10-19  Richard Biener  <rguenther@suse.de>

PR tree-optimization/88182
* g++.dg/gomp/pr88182.C: Move from libgomp and use -fopenmp-simd.

* testsuite/libgomp.c++/pr88182.C: Move to g++.dg/gomp.

From-SVN: r266545

6 years agoAdd myself to MAINTAINERS
Johannes Pfau [Wed, 28 Nov 2018 08:21:15 +0000 (08:21 +0000)]
Add myself to MAINTAINERS

2018-11-28  Johannes Pfau  <johannespfau@gmail.com>

* MAINTAINERS (Write After Approval): Add myself.

From-SVN: r266544

6 years agoDaily bump.
GCC Administrator [Wed, 28 Nov 2018 00:16:22 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r266540

6 years agore PR c++/88187 (ICE on (invalid) C++ code when compiled with -std=c++17: Segmentatio...
Jakub Jelinek [Tue, 27 Nov 2018 23:52:26 +0000 (00:52 +0100)]
re PR c++/88187 (ICE on (invalid) C++ code when compiled with -std=c++17: Segmentation fault)

PR c++/88187
* decl.c (grokdeclarator): Don't diagnose deduction guide errors
if !funcdecl_p.

* g++.dg/other/pr88187.C: New test.

From-SVN: r266537

6 years agocompiler: tweaks for importing inline function bodies
Ian Lance Taylor [Tue, 27 Nov 2018 23:46:38 +0000 (23:46 +0000)]
compiler: tweaks for importing inline function bodies

    Track whether we've seen an error when importing a function; we will
    use error tracking to avoid knock-on errors.

    Stop importing identifiers at a ')'.

    Provide a way to adjust the indentation level while importing.

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

From-SVN: r266536

6 years agoClean up temporary files created by std::filesystem testsuite
Jonathan Wakely [Tue, 27 Nov 2018 23:35:17 +0000 (23:35 +0000)]
Clean up temporary files created by std::filesystem testsuite

* testsuite/27_io/filesystem/operations/canonical.cc: Remove
directory created by test.
* testsuite/27_io/filesystem/operations/symlink_status.cc: Remove
symlink created by test.

From-SVN: r266535

6 years agocompiler: record final type for numeric expressions
Ian Lance Taylor [Tue, 27 Nov 2018 23:29:15 +0000 (23:29 +0000)]
compiler: record final type for numeric expressions

    Inlinable function bodies are generated after the determine_types pass,
    so we know the type for all constants.  Rather than try to determine
    it again when inlining, record the type in the export data, using a
    $convert expression.  Reduce the number of explicit $convert
    expressions by recording a type context with the expected type in
    cases where that type is known.

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

From-SVN: r266534

6 years agoPR libstdc++/67843 set shared_ptr lock policy at build-time
Jonathan Wakely [Tue, 27 Nov 2018 23:25:56 +0000 (23:25 +0000)]
PR libstdc++/67843 set shared_ptr lock policy at build-time

This resolves a longstanding issue where the lock policy for shared_ptr
reference counting depends on compilation options when the header is
included, so that different -march options can cause ABI changes. For
example, objects compiled with -march=armv7 will use atomics to
synchronize reference counts, and objects compiled with -march=armv5t
will use a mutex. That means the shared_ptr control block will have a
different layout in different objects, causing ODR violations and
undefined behaviour. This was the root cause of PR libstdc++/42734 as
well as PR libstdc++/67843.

The solution is to decide on the lock policy at build time, when
libstdc++ is configured. The configure script checks for the
availability of the necessary atomic built-ins for the target and fixes
that choice permanently. Different -march flags used to compile user
code will not cause changes to the lock policy. This results in an ABI
change for certain compilations, but only where there was already an ABI
incompatibility between the libstdc++.so library and objects built with
an incompatible -march option. In general, this means a more stable ABI
that isn't silently altered when -march flags make addition atomic ops
available.

To force a target to use "atomic" or "mutex" the new configure option
--with-libstdcxx-lock-policy can be used.

In order to turn ODR violations into linker errors, the uses of
shared_ptr in filesystem directory iterators have been replaced
with __shared_ptr, and explicit instantiations are declared. This
ensures that object files using those types cannot link to libstdc++
libs unless they use the same lock policy.

PR libstdc++/67843
* acinclude.m4 (GLIBCXX_ENABLE_LOCK_POLICY): Add new macro
that defines _GLIBCXX_HAVE_ATOMIC_LOCK_POLICY.
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Use GLIBCXX_ENABLE_LOCK_POLICY.
* doc/xml/manual/configure.xml: Document new configure option.
* include/bits/fs_dir.h (directory_iterator): Use __shared_ptr
instead of shared_ptr.
(recursive_directory_iterator): Likewise.
(__shared_ptr<_Dir>): Add explicit instantiation declaration.
(__shared_ptr<recursive_directory_iterator::_Dir_stack>): Likewise.
* include/bits/shared_ptr_base.h (__allocate_shared, __make_shared):
Add default template argument for _Lock_policy template parameter.
* include/ext/concurrence.h (__default_lock_policy): Check macro
_GLIBCXX_HAVE_ATOMIC_LOCK_POLICY instead of checking if the current
target supports the builtins for compare-and-swap.
* src/filesystem/std-dir.cc (__shared_ptr<_Dir>): Add explicit
instantiation definition.
(__shared_ptr<recursive_directory_iterator::_Dir_stack>): Likewise.
(directory_iterator, recursive_directory_iterator): Use __make_shared
instead of make_shared.

From-SVN: r266533

6 years agocompiler: add result parameter names for inlinable functions
Ian Lance Taylor [Tue, 27 Nov 2018 21:40:56 +0000 (21:40 +0000)]
compiler: add result parameter names for inlinable functions

    An inlinable function body may need to refer to result parameters, so
    each result parameter needs a name.  We already give them all names in
    start_function (via create_result_variables).  Change the export data
    so that for an inlinable function we use those names for the function
    declaration's result parameters.

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

From-SVN: r266532

6 years agocompiler: add types used by inline functions to export data
Ian Lance Taylor [Tue, 27 Nov 2018 21:37:42 +0000 (21:37 +0000)]
compiler: add types used by inline functions to export data

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

From-SVN: r266531

6 years agocompiler: finalize types parsed for inline functions
Ian Lance Taylor [Tue, 27 Nov 2018 21:34:44 +0000 (21:34 +0000)]
compiler: finalize types parsed for inline functions

    When we inline functions, we may parse types that we have not seen
    before inlining.  Inlining runs after the finalize_methods pass, so
    those types will not be finalized, meaning that we don't have an
    accurate list of which methods they support.  Explicitly finalize them
    when we parse them.

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

From-SVN: r266530

6 years agocompiler: add '$' to names in expression export data
Ian Lance Taylor [Tue, 27 Nov 2018 21:25:58 +0000 (21:25 +0000)]
compiler: add '$' to names in expression export data

    For inlined function bodies we're going to need to refer to variables,
    so change the existing export data to add a '$' to names that look
    like identifiers: true, false, nil, convert.

    While we're here drop an unnecessary space character after operators.

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

From-SVN: r266529

6 years agore PR libstdc++/88199 (memory leak on unordered container move assignment)
François Dumont [Tue, 27 Nov 2018 21:21:51 +0000 (21:21 +0000)]
re PR libstdc++/88199 (memory leak on unordered container move assignment)

2018-11-27  François Dumont  <fdumont@gcc.gnu.org>

PR libstdc++/88199
* include/bits/hashtable.h (_Hashtable<>::_M_assign_elements): New.
(_Hashtable<>::operator=(const _Hashtable&)): Use latter.
(_Hashtable<>::_M_move_assign(_Hashtable&&, false_type)): Likewise.
* testsuite/23_containers/unordered_set/allocator/move_assign.cc
(test03): New.

From-SVN: r266528

6 years agore PR c++/88181 (ICE: verify_type failed (error: type variant differs by TYPE_PACKED))
Jakub Jelinek [Tue, 27 Nov 2018 21:04:41 +0000 (22:04 +0100)]
re PR c++/88181 (ICE: verify_type failed (error: type variant differs by TYPE_PACKED))

PR c++/88181
* class.c (fixup_attribute_variants): Also propagate TYPE_PACKED
to variants.

* g++.dg/debug/pr88181.C: New test.

From-SVN: r266527

6 years agocompiler: change expression importing to use Import_expression
Ian Lance Taylor [Tue, 27 Nov 2018 20:07:15 +0000 (20:07 +0000)]
compiler: change expression importing to use Import_expression

    Change expression importing to use a new abstract interface class
    Import_expression, so that we can more easily import expressions from
    inlinable function bodies.  This is a refactoring with no affect on
    compiler behavior.

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

From-SVN: r266526

6 years agocompiler: pass a Location to import_expression
Ian Lance Taylor [Tue, 27 Nov 2018 19:57:45 +0000 (19:57 +0000)]
compiler: pass a Location to import_expression

    Separate the Location that import_expression uses when creating a new
    Expression from the Location used to report an error.  This is a step
    toward importing expressions for inlined functions.  This is a pure
    refactoring that does not affect compiler behavior.

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

From-SVN: r266525

6 years agore PR middle-end/87157 (gcc.dg/vect/costmodel/ppc/costmodel-vect-33.c fails starting...
Jakub Jelinek [Tue, 27 Nov 2018 19:23:39 +0000 (20:23 +0100)]
re PR middle-end/87157 (gcc.dg/vect/costmodel/ppc/costmodel-vect-33.c fails starting with r263981)

PR middle-end/87157
* gcc.dg/vect/costmodel/ppc/costmodel-vect-33.c (main1): Add noipa
attribute.

From-SVN: r266524

6 years agocompiler: change Expression export to use Export_function_body
Ian Lance Taylor [Tue, 27 Nov 2018 18:55:56 +0000 (18:55 +0000)]
compiler: change Expression export to use Export_function_body

    In preparation for writing expressions to inline function bodies,
    change the existing expression export code to use Export_function_body
    rather than Export.  Adjust existing expression exporters accordingly.

    This is a refactoring that doesn't affect compiler output.

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

From-SVN: r266523

6 years agoPR 87756 - missing unterminated argument warning using address of a constant character
Martin Sebor [Tue, 27 Nov 2018 17:07:24 +0000 (17:07 +0000)]
PR 87756 - missing unterminated argument warning using address of a constant character

PR 87756 - missing unterminated argument warning using address of a constant character
PR 88211 - missing warning on printf %ls and unterminated wide member array
PR 88226 - missing warning on fprintf, fputs, and puts with an unterminated array

gcc/ChangeLog:

* gcc.dg/tree-ssa/builtin-fprintf-warn-1.c: Update/remove xfails.
* gcc.dg/tree-ssa/builtin-printf-warn-1.c: Same.
* gcc.dg/tree-ssa/user-printf-warn-1.c: Same.

From-SVN: r266522

6 years agogcov: do not ICE on NULL string in JSON export.
Martin Liska [Tue, 27 Nov 2018 16:30:27 +0000 (17:30 +0100)]
gcov: do not ICE on NULL string in JSON export.

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

* gcov.c (generate_results): Append current_working_directory
only when exists.

From-SVN: r266521

6 years agoPR preprocessor/83173: Enhance -fdump-internal-locations output
Mike Gulick [Tue, 27 Nov 2018 16:04:31 +0000 (16:04 +0000)]
PR preprocessor/83173: Enhance -fdump-internal-locations output

gcc/ChangeLog:
2018-11-27  Mike Gulick  <mgulick@mathworks.com>

PR preprocessor/83173
* input.c (dump_location_info): Dump reason and included_from
fields from line_map_ordinary struct.  Fix indentation when
location > 5 digits.
* diagnostic-show-locus.c (num_digits, num_digits): Move to
diagnostic.c to allow it to be utilized by input.c.
* diagnostic.c (num_digits, selftest::test_num_digits): Moved
here.
(selftest::diagnostic_c_tests): Run selftest::test_num_digits.
* diagnostic.h (num_digits): Add extern definition.

libcpp/ChangeLog:
2018-11-27  Mike Gulick  <mgulick@mathworks.com>

PR preprocessor/83173
* location-example.txt: Update example -fdump-internal-locations
output.

From-SVN: r266520

6 years agoMIPS: Add `-mfix-r5900' option for the R5900 short loop erratum
Fredrik Noring [Tue, 27 Nov 2018 16:01:10 +0000 (16:01 +0000)]
MIPS: Add `-mfix-r5900' option for the R5900 short loop erratum

The short loop bug under certain conditions causes loops to
execute only once or twice, due to a hardware bug in the R5900 chip.

`-march=r5900' already enables the R5900 short loop workaround.
However, the R5900 ISA and most other MIPS ISAs are mutually
exclusive since R5900-specific instructions are generated as well.

The `-mfix-r5900' option can be used in combination with e.g.
`-mips2' or `-mips3' to generate generic MIPS binaries that also
work with the R5900 target.  The workaround is implemented by GAS
rather than by GCC.

The following small `shortloop.c' file has been used as a test
with GCC 8.2.0:

void shortloop(void)
{
    __asm__ __volatile__ (
" li $3, 300\n"
"loop:\n"
" addi $3, -1\n"
" addi $4, -1\n"
" bne $3, $0, loop\n"
" li $4, 3\n"
::);
}

The following six combinations have been tested:

% mipsr5900el-unknown-linux-gnu-gcc -O1 -c shortloop.c
% mipsr5900el-unknown-linux-gnu-gcc -O1 -c shortloop.c -mfix-r5900
% mipsr5900el-unknown-linux-gnu-gcc -O1 -c shortloop.c -mno-fix-r5900

% mipsr4000el-unknown-linux-gnu-gcc -O1 -c shortloop.c
% mipsr4000el-unknown-linux-gnu-gcc -O1 -c shortloop.c -mfix-r5900
% mipsr4000el-unknown-linux-gnu-gcc -O1 -c shortloop.c -mno-fix-r5900

The R5900 short loop erratum is corrected in exactly three cases:

1. for the target `mipsr5900el' by default;

2. for the target `mipsr5900el' with `-mfix-r5900';

3. for any other MIPS target (e.g. `mipsr4000el') with `-mfix-r5900'.

In all other cases the correction is not made.

2018-11-27  Fredrik Noring  <noring@nocrew.org>

gcc/
* config/mips/mips.c (mips_reorg_process_insns)
(mips_option_override): Handle `-mfix-r5900'.
* config/mips/mips.h (ASM_SPEC): Add `mfix-r5900' and
`mno-fix-r5900'.
* config/mips/mips.opt (mfix-r5900): New option.
* doc/invoke.texi: Document the `r5900' processor name, and
`-mfix-r5900' and `-mno-fix-r5900' options.

From-SVN: r266519

6 years agoPR preprocessor/83173: New test
Mike Gulick [Tue, 27 Nov 2018 15:53:51 +0000 (15:53 +0000)]
PR preprocessor/83173: New test

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

PR preprocessor/83173
* gcc.dg/plugin/location-overflow-test-pr83173.c: New test.
* gcc.dg/plugin/location-overflow-test-pr83173.h: Header for
pr83173.c.
* gcc.dg/plugin/location-overflow-test-pr83173-1.h: Header for
pr83173.c.
* gcc.dg/plugin/location-overflow-test-pr83173-2.h: Header for
pr83173.c.
* gcc.dg/plugin/location_overflow_plugin.c: Use PLUGIN_PRAGMAS
instead of PLUGIN_START_UNIT.
* gcc.dg/plugin/plugin.exp: Enable new test.

From-SVN: r266518

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