Commit Graph

165538 Commits

Author SHA1 Message Date
Michael Ploujnikov
55da34ebc2 There can be at most one .resolver clone per function
2018-11-29  Michael Ploujnikov  <michael.ploujnikov@oracle.com>

	There can be at most one .resolver clone per function
	* config/rs6000/rs6000.c (make_resolver_func): Generate
	resolver symbol with clone_function_name instead of
	clone_function_name_numbered.

From-SVN: r266617
2018-11-29 14:09:50 +00:00
Edward Smith-Rowland
a62b871d65 Fix erasure goofs.
2018-11-29  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Fix erasure goofs.
	* include/experimental/deque: Make inline.
	* include/std/deque: Include bits/stl_algo.h.
	(erase, erase_if): Make inline.
	* include/std/string: Include bits/stl_algo.h.
	* include/std/unordered_set: Add erase, erase_if!
	* include/std/vector: Include bits/stl_algo.h.
	* testsuite/21_strings/basic_string/erasure.cc:
	Add { dg-options "-std=gnu++2a" }.
	* testsuite/23_containers/deque/erasure.cc: Ditto.
	* testsuite/23_containers/forward_list/erasure.cc: Ditto.
	* testsuite/23_containers/list/erasure.cc: Ditto.
	* testsuite/23_containers/map/erasure.cc: Ditto.
	* testsuite/23_containers/set/erasure.cc: Ditto.
	* testsuite/23_containers/unordered_map/erasure.cc: Ditto.
	* testsuite/23_containers/unordered_set/erasure.cc: Ditto.
	* testsuite/23_containers/vector/erasure.cc: Ditto.

From-SVN: r266616
2018-11-29 13:43:55 +00:00
Richard Biener
154fb72b6d re PR tree-optimization/88243 (ice in vect_create_epilog_for_reduction, at tree-vect-loop.c:4689)
2018-11-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/88243
	* tree-vect-patterns.c (vect_mark_pattern_stmts): Set the def
	type of all pattern-sequence stmts to vect_internal_def.

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

From-SVN: r266615
2018-11-29 13:33:59 +00:00
Jonathan Wakely
8c9b385288 PR libstdc++/88119 use alignof in std::alignment_of, not __alignof__
Now that __alignof__ and alignof sometimes disagree it matters which one
we use. The standard says that std::alignment_of<T>::value equals
alignof(T), so we need to use that.

Change the only uses of alignment_of to use __alignof__ to avoid a
change in alignment.

	PR libstdc++/88119
	* include/ext/aligned_buffer.h (__aligned_membuf): Add comment.
	(__aligned_buffer): Use __alignof__ instead of std::alignment_of.
	* include/std/type_traits (alignment_of): Use alignof instead of
	__alignof__.
	* testsuite/20_util/alignment_of/value.cc: Fix test to check values
	match alignof not __alignof__, as required by the standard.

From-SVN: r266613
2018-11-29 12:32:57 +00:00
Andre Vieira
479db22783 [PATCH] [Arm] Fix fpu configurations for Cortex-R7 and Cortex-R8
gcc/ChangeLog:
2018-11-29  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	PR target/88224
	* config/arm/arm-cpus.in (armv7-r): Add FP16conv configurations.
	(cortex-r7, cortex-r8): Update default and add new configuration.
	* doc/invoke.texi (armv7-r): Add two new vfp options.
	(nofp.dp): Add cortex-r7 and cortex-r8 to the list of targets that
	support this option.

From-SVN: r266612
2018-11-29 10:20:13 +00:00
Jakub Jelinek
ebea4e1da0 re PR c++/87539 (internal compiler error when compiling project with Os optimization flag)
PR c++/87539
	* g++.dg/cpp0x/pr87539.C: New test.

From-SVN: r266611
2018-11-29 08:42:52 +01:00
Alan Modra
9caa6732f9 [RS6000] PR11848 rs6000_emit_move long double split
This split is disabled for power7 and up, so we don't often see its
bad effects.  However, on a powerpc-linux compiler (which defaults
to PPC750 judging from rs6000/sysv4.h) we see

	long double ld1 (void) { return 1.0L; }

compiled with -msoft-float -O2 -S resulting in

	ld1:
		li 3,0
		li 4,0
		mr 6,4
		mr 5,3
		li 4,0
		lis 3,0x3ff0
		blr

Things go awry in init-regs, with the TFmode reg being initialized to
zero on seeing the subreg from the split.  (And that initialization
itself is split by rs6000_emit_move!)  Later passes apparently don't
clean up the rubbish.

Since the split was added for Darwin (as the comment says), let's get
rid of it on other targets.

	* config/rs6000/rs6000.c (rs6000_emit_move): Disable long
	double split for targets other than Darwin.

From-SVN: r266610
2018-11-29 15:33:01 +10:30
Alan Modra
aa74f2217d [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
2018-11-29 15:31:05 +10:30
Alan Modra
5678e339bb [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
2018-11-29 15:29:19 +10:30
Alan Modra
8529a062e9 [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
2018-11-29 15:28:08 +10:30
Alan Modra
abf07e52b2 [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
2018-11-29 15:26:33 +10:30
Alan Modra
3f79c0ad26 [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
2018-11-29 15:23:49 +10:30
Alan Modra
ece3bca2bd [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
2018-11-29 15:17:51 +10:30
Alan Modra
7a24893b2e [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
2018-11-29 15:16:21 +10:30
Alan Modra
493bb3d0d1 [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
2018-11-29 15:15:00 +10:30
Alan Modra
ce83eeda06 [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
2018-11-29 15:13:21 +10:30
Alan Modra
75a0b80599 [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
2018-11-29 15:11:06 +10:30
Aaron Sawdey
645eee7431 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
2018-11-28 21:56:14 -06:00
Jonathan Wakely
ffe2c05539 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
2018-11-29 00:39:37 +00:00
GCC Administrator
2182a27d85 Daily bump.
From-SVN: r266597
2018-11-29 00:16:15 +00:00
Martin Sebor
04864ec855 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
2018-11-28 16:04:09 -07:00
Iain Buclaw
1568425022 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
2018-11-28 21:53:06 +00:00
Marek Polacek
3b9a9fe89f 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
2018-11-28 21:39:42 +00:00
Nathan Sidwell
d794ab85f7 [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
2018-11-28 21:25:06 +00:00
Jan Hubicka
410902c31c 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
2018-11-28 20:48:53 +00:00
Jan Hubicka
ad42aa96b6 * lto.c (lto_read_decls): Fix handling of INTEGER_CST.
From-SVN: r266586
2018-11-28 20:36:13 +00:00
Jan Hubicka
9c7a7155ec 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
2018-11-28 20:34:06 +00:00
Jan Hubicka
f0dbeec7c5 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
2018-11-28 20:29:24 +00:00
Jan Hubicka
c3cc0122ca 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
2018-11-28 20:25:08 +00:00
Vladimir Makarov
6d078c9ad5 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
2018-11-28 20:08:03 +00:00
Marek Polacek
bdd0bd5c96 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
2018-11-28 20:03:06 +00:00
David Edelsohn
9638e3ef16 * gcc.dg/recip_sqrt_mult_[12345]: Do not add -fcompare-debug on AIX.
From-SVN: r266577
2018-11-28 13:33:46 -05:00
David Edelsohn
45eea9f6ed pr86900.C: XFAIL AIX.
* g++.dg/debug/dwarf2/pr86900.C: XFAIL AIX.
        * g++.dg/opt/pr83084.C: XFAIL AIX.

From-SVN: r266576
2018-11-28 13:30:41 -05:00
David Edelsohn
bd2010acc2 * config/rs6000/aix72.h: Update to match aix71.h changes.
From-SVN: r266574
2018-11-28 13:10:21 -05:00
Ian Lance Taylor
5456f30d92 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
2018-11-28 18:08:21 +00:00
Iain Buclaw
85041a5b77 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
2018-11-28 17:54:07 +00:00
Jeff Law
735352d2ee 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
2018-11-28 10:26:03 -07:00
Sam Tebbs
7185a4ebc2 [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
2018-11-28 17:08:17 +00:00
Jonathan Wakely
345d2d0349 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
2018-11-28 17:07:22 +00:00
Jonathan Wakely
0a1369fa95 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
2018-11-28 16:53:35 +00:00
Edward Smith-Rowland
188588e443 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
2018-11-28 16:44:25 +00:00
Jonathan Wakely
bd6ccc290a 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
2018-11-28 15:36:56 +00:00
Jonathan Wakely
24d9b090fb 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
2018-11-28 15:27:11 +00:00
Sameera Deshpande
2b4be50093 Changed email ID to existing one.
From-SVN: r266563
2018-11-28 19:55:28 +05:30
Tom de Vries
18c742b5f0 [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
2018-11-28 14:06:23 +00:00
Richard Biener
2bf8ae1b3d 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
2018-11-28 13:51:42 +00:00
Jonathan Wakely
5916922e34 Update C++17 library status docs
* doc/xml/manual/status_cxx2017.xml: Update C++17 status.
	* doc/html/*: Regenerate.

From-SVN: r266559
2018-11-28 13:49:47 +00:00
Richard Biener
a257ad4668 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
2018-11-28 13:04:27 +00:00
Alan Modra
20f65b5607 [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
2018-11-28 23:24:44 +10:30
Jakub Jelinek
dc7ca39465 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
2018-11-28 12:08:58 +01:00