Commit Graph

166999 Commits

Author SHA1 Message Date
Thomas Koenig
9dbdefbb20 re PR fortran/71066 (ICE in set_loop_bounds, at fortran/trans-array.c:4680)
2019-02-17  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/71066
	* trans-decl.c (generate_coarray_sym_init):  For an array
	constructor in a DATA statement of a coarray variable, set the
	rank to 1 to avoid confusion later on.  If the constructor
	contains only one value, use that for initiailizig.

2019-02-17  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/71066
	* gfortran.dg/coarray_data_1.f90: New test.

From-SVN: r268960
2019-02-16 16:12:51 +00:00
Eric Botcazou
d810ce4b18 patchable_function_entry-decl.c: Add -fno-pie on SPARC.
* c-c++-common/patchable_function_entry-decl.c: Add -fno-pie on SPARC.
	* c-c++-common/patchable_function_entry-default.c: Likewise.
	* c-c++-common/patchable_function_entry-definition.c: Likewise.

From-SVN: r268958
2019-02-16 14:40:53 +00:00
Jakub Jelinek
3140b2ed03 re PR rtl-optimization/66152 (suboptimal load bytes to stack)
PR rtl-optimization/66152
	* builtins.h (c_readstr): Declare.
	* builtins.c (c_readstr): Remove forward declaration.  Add
	null_terminated_p argument, if false, read all bytes from the
	string instead of stopping after '\0'.
	* expr.c (string_cst_read_str): New function.
	(store_expr): Use string_cst_read_str instead of
	builtin_strncpy_read_str.  Try to store by pieces the whole
	exp_len first, and only if that fails, split it up into
	store by pieces followed by clear_storage.  Formatting fix.

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

From-SVN: r268957
2019-02-16 12:20:33 +01:00
Jakub Jelinek
1f1d52e33d i386.md (*movqi_internal): Remove static from buf variable.
* config/i386/i386.md (*movqi_internal): Remove static from
	buf variable.  Use output_asm_insn (buf, operands); return "";
	instead of return buf;.
	* config/i386/sse.md (<sse>_andnot<mode>3<mask_name>,
	*<code><mode>3<mask_name>, *andnot<mode>3, *andnottf3, *<code><mode>3,
	*<code>tf3, <mask_codefor><code><mode>3<mask_name>): Likewise.

From-SVN: r268956
2019-02-16 11:05:16 +01:00
GCC Administrator
bc50c4998f Daily bump.
From-SVN: r268955
2019-02-16 00:16:34 +00:00
Cherry Zhang
fba70f605e compiler,runtime: use __builtin_dwarf_cfa for getcallersp
Currently, the compiler lowers runtime.getcallersp to
    __builtin_frame_address(1). In the C side of the runtime,
    getcallersp is defined as __builtin_frame_address(0). They don't
    match. Further, neither of them actually returns the caller's SP.
    On AMD64, __builtin_frame_address(0) just returns the frame
    pointer. __builtin_frame_address(1) returns the memory content
    where the frame pointer points to, which is typically the
    caller's frame pointer but can also be garbage if the frame
    pointer is not enabled.
    
    This CL changes it to use __builtin_dwarf_cfa(), which returns
    the caller's SP at the call site. This matches the SP we get
    from unwinding the stack.
    
    Currently getcallersp is not used for anything real. It will be
    used for precise stack scan (a new version of CL 159098).
    
    Reviewed-on: https://go-review.googlesource.com/c/162905

	* go-gcc.cc (Gcc_backend::Gcc_backend): Define __builtin_dwarf_cfa
	instead of __builtin_frame_address.

From-SVN: r268952
2019-02-15 23:22:29 +00:00
Eric Botcazou
9695618899 asan_oob_test.cc: Skip OOB_int on SPARC.
* g++.dg/asan/asan_oob_test.cc: Skip OOB_int on SPARC.
	* g++.dg/asan/function-argument-3.C: Tweak for 32-bit SPARC.

From-SVN: r268951
2019-02-15 23:16:25 +00:00
Eric Botcazou
34c5627c9c linux.h (ASAN_CC1_SPEC): Define.
* config/sparc/linux.h (ASAN_CC1_SPEC): Define.
	(CC1_SPEC): Use GNU_USER_TARGET_CC1_SPEC and ASAN_CC1_SPEC.
	* config/sparc/linux64.h (ASAN_CC1_SPEC): Likewise.
	(CC1_SPEC): Likewise.
	* config/sparc/sparc.c (sparc_asan_shadow_offset): Adjust for 64-bit.

From-SVN: r268950
2019-02-15 23:08:49 +00:00
Eric Botcazou
362432c00d asan.c (asan_emit_stack_protection): Use full-sized mask to align the base address on 64-bit strict-alignment platforms.
* asan.c (asan_emit_stack_protection): Use full-sized mask to align
	the base address on 64-bit strict-alignment platforms.

From-SVN: r268949
2019-02-15 21:40:24 +00:00
Ian Lance Taylor
dd66d9d71d re PR go/89368 (ICE in go/gofrontend/expressions.cc:4669 after r268923)
PR go/89368
    compiler: write barrier check nil-check policy tweak
    
    Tweak the recipe for generating writeBarrier loads to insure that the
    dereference expr is marked as not requiring a nil check (not needed
    for gccgo, but needed for gollvm).
    
    Fixes https://gcc.gnu.org/PR89368
    
    Reviewed-on: https://go-review.googlesource.com/c/162904

From-SVN: r268948
2019-02-15 21:04:58 +00:00
H.J. Lu
879f9d0b2f i386: Fix ')' in VALID_MMX_REG_MODE
Replace "(MODE == V1DImode)" with "(MODE) == V1DImode".

	* config/i386/i386.h (VALID_MMX_REG_MODE): Correct the misplaced
	')'.

From-SVN: r268947
2019-02-15 12:47:31 -08:00
Uros Bizjak
d6cfb47fd4 darwin.h (TARGET_FPMATH_DEFAULT_P): New define.
* config/i386/darwin.h (TARGET_FPMATH_DEFAULT_P): New define.

From-SVN: r268944
2019-02-15 19:02:50 +01:00
Tamar Christina
75e2abe6f9 Arm: Remove alternative from neon_softfp_fp16 directive.
There's a bit of a disconnect between the feature flags that don't test the fpu
and ones that do when the test itself also forces an architecture.  The forcing
of the architecture would change the defaults and without explicitly giving the
correct fpu again the test would fail.

I don't see a good way to solve this problem, really the feature tests should
ideally contain the extra options the test adds too, but for this specific case
it can be solved by always testing the fpu explicitly.

Committed under the GCC obvious

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp
	(check_effective_target_arm_neon_softfp_fp16_ok_nocache): Drop non-fpu
	checking alternative.

From-SVN: r268943
2019-02-15 17:17:17 +00:00
Aaron Sawdey
0a3d52ddee re PR rtl-optimization/88308 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2309)
2019-02-15  Aaron Sawdey  <acsawdey@linux.ibm.com>

	PR rtl-optimization/88308
	* shrink-wrap.c (move_insn_for_shrink_wrap): Fix LABEL_NUSES counts
	on copied instruction.

From-SVN: r268942
2019-02-15 09:41:25 -06:00
Ian Lance Taylor
a72128258b re PR go/89123 (Too many go test failures on s390x-linux)
PR go/89123
    internal/cpu, runtime: add S/390 CPU capability support
    
    Patch by Robin Dapp.
    
    Updates https://gcc.gnu.org/PR89123
    
    Reviewed-on: https://go-review.googlesource.com/c/162887

From-SVN: r268941
2019-02-15 14:51:10 +00:00
Ian Lance Taylor
7b54753033 runtime: include <syscall.h> and <sys/syscall.h> if available
Fixes Solaris build.
    
    Reviewed-on: https://go-review.googlesource.com/c/162885

From-SVN: r268940
2019-02-15 14:25:12 +00:00
Ian Lance Taylor
d86dd2490f runtime: add type cast for non-split-stack calls to scanstackblock
Reviewed-on: https://go-review.googlesource.com/c/162884

From-SVN: r268939
2019-02-15 13:54:45 +00:00
Eric Botcazou
2dca0c882a * gcc.target/sparc/struct-ret-check-1.c: Add -fno-pie option.
From-SVN: r268934
2019-02-15 10:55:50 +00:00
Eric Botcazou
3bafb64805 patchable_function_entry-decl.c: Do not run on Visium.
* c-c++-common/patchable_function_entry-decl.c: Do not run on Visium.
	* c-c++-common/patchable_function_entry-default.c: Likewise.
	* c-c++-common/patchable_function_entry-definition.c: Likewise.
	* gcc.dg/tree-ssa/pr84859.c: Add -ftree-cselim switch.

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

From-SVN: r268931
2019-02-15 10:40:34 +00:00
Jakub Jelinek
9f53b76775 re PR other/69006 (Extraneous newline emitted between error messages in GCC 6)
PR other/69006
	PR testsuite/88920
	* lib/gcc-dg.exp: If llvm_binutils effective target, set
	allow_blank_lines to 2 during initialization.
	(dg-allow-blank-lines-in-output): Set allow_blank_lines to 1 only if
	it was previously zero.
	(gcc-dg-prune): Don't check for llvm_binutils effective target here.
	Clear allow_blank_lines afterwards whenever it was 1.
	* gdc.test/gdc-test.exp (dmd2dg): Don't call
	dg-allow-blank-lines-in-output here.
	(gdc-do-test): Set allow_blank_lines to 3 if it is 0 before running
	the tests and restore it back at the end.

From-SVN: r268930
2019-02-15 08:52:50 +01:00
Jakub Jelinek
906c376300 opts-1.c: New test.
* c-c++-common/ubsan/opts-1.c: New test.
	* c-c++-common/ubsan/opts-2.c: New test.
	* c-c++-common/ubsan/opts-3.c: New test.
	* c-c++-common/ubsan/opts-4.c: New test.

From-SVN: r268929
2019-02-15 08:51:38 +01:00
Richard Biener
4c9ed22ae0 re PR tree-optimization/89278 (ICE in gimplify_modify_expr, at gimplify.c:5821)
PR tree-optimization/89278
	* tree-loop-distribution.c: Include tree-eh.h.
	(generate_memset_builtin, generate_memcpy_builtin): Call
	rewrite_to_non_trapping_overflow on builtin->size before passing it
	to force_gimple_operand_gsi.

	* gcc.dg/pr89278.c: New test.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r268927
2019-02-15 08:39:45 +01:00
Jakub Jelinek
5f88ba10e0 re PR c/89340 (ICE in function_and_variable_visibility, at ipa-visibility.c:707)
PR c/89340
	* c-decl.c (start_function): Clear TREE_PUBLIC on nested functions
	before c_decl_attributes rather than after it.

	* gcc.dg/pr89340.c: New test.
	* gcc.dg/torture/pr57036-2.c (jpgDecode_convert): Expect a warning
	that leaf attribute on nested function is useless.

From-SVN: r268926
2019-02-15 08:38:09 +01:00
Jakub Jelinek
f521d9d8ad re PR other/89342 (ICE in maybe_default_option, at opts.c:347)
PR other/89342
	* optc-save-gen.awk: Handle optimize_fast like optimize_size or
	optimize_debug.
	* opth-gen.awk: Likewise.

	* gcc.dg/pr89342.c: New test.

From-SVN: r268924
2019-02-15 08:17:24 +01:00
Ian Lance Taylor
8a9f2a6bbd compiler, runtime: harmonize types referenced by both C and Go
Compiling with LTO revealed a number of cases in the runtime and
    standard library where C and Go disagreed about the type of an object or
    function (or where Go and code generated by the compiler disagreed). In
    all cases the underlying representation was the same (e.g., uintptr vs.
    void*), so this wasn't causing actual problems, but it did result in a
    number of annoying warnings when compiling with LTO.
    
    Reviewed-on: https://go-review.googlesource.com/c/160700

From-SVN: r268923
2019-02-15 01:57:51 +00:00
Ian Lance Taylor
c8530c4109 re PR go/89168 (FAIL: cmd/go/internal/load)
PR go/89168
    libgo: change gotest to run examples with output
    
    Change the gotest script to act like "go test" and run examples that
    have "output" comments.  This is not done with full generality, but
    just enough to run the libgo tests.  Other packages should be tested
    with "go test" as usual.
    
    While we're here clean up some old bits of gotest, and only run
    TestXXX functions that are actually in *_test.go files.  The latter
    change should fix https://gcc.gnu.org/PR89168.
    
    Reviewed-on: https://go-review.googlesource.com/c/162139

From-SVN: r268922
2019-02-15 00:36:50 +00:00
Ian Lance Taylor
b90fff0cc0 go-backend.c (go_imported_unsafe): Update optimization_default_node.
* go-backend.c (go_imported_unsafe): Update
	optimization_default_node.

From-SVN: r268921
2019-02-15 00:29:41 +00:00
GCC Administrator
f97745dca5 Daily bump.
From-SVN: r268920
2019-02-15 00:16:44 +00:00
Uros Bizjak
8b131a8a7a i386.h (TARGET_SUBTARGET64_ISA_DEFAULT): Enable MMX, SSE and SSE2 by default.
* config/i386/i386.h (TARGET_SUBTARGET64_ISA_DEFAULT):
	Enable MMX, SSE and SSE2 by default.
	* config/i386/i386.c (ix86_option_override_internal): Do not
	explicitly set MMX, SSE and SSE2 flags for TARGET_64BIT here.

From-SVN: r268917
2019-02-15 00:54:25 +01:00
Jakub Jelinek
dddd0c7a5b re PR rtl-optimization/89354 (Combine pass yields wrong code with -O2 and -msse2 for 32bit target)
PR rtl-optimization/89354
	* combine.c (make_extraction): Punt if extraction_mode is narrower
	than len bits.

	* gcc.dg/pr89354.c: New test.

From-SVN: r268913
2019-02-15 00:10:47 +01:00
Uros Bizjak
bf36afbc8f ssse3-pabsb.c: Re-enable 64-bit form on AVX targets.
* gcc.target/i386/ssse3-pabsb.c: Re-enable 64-bit form on AVX targets.
	* gcc.target/i386/ssse3-pabsd.c: Ditto.
	* gcc.target/i386/ssse3-pabsw.c: Ditto.
	* gcc.target/i386/ssse3-palignr.c: Ditto.
	* gcc.target/i386/ssse3-phaddd.c: Ditto.
	* gcc.target/i386/ssse3-phaddsw.c: Ditto.
	* gcc.target/i386/ssse3-phaddw.c: Ditto.
	* gcc.target/i386/ssse3-phsubd.c: Ditto.
	* gcc.target/i386/ssse3-phsubsw.c: Ditto.
	* gcc.target/i386/ssse3-phsubw.c: Ditto.
	* gcc.target/i386/ssse3-pmaddubsw.c: Ditto.
	* gcc.target/i386/ssse3-pmulhrsw.c: Ditto.
	* gcc.target/i386/ssse3-pshufb.c: Ditto.
	* gcc.target/i386/ssse3-psignb.c: Ditto.
	* gcc.target/i386/ssse3-psignd.c: Ditto.
	* gcc.target/i386/ssse3-psignw.c: Ditto.

From-SVN: r268907
2019-02-14 22:54:36 +01:00
Janne Blomqvist
6608603212 PR 81552 Improve and document -flag-init-integer
Make the option handling code parse the -flag-init-integer value as a
C long type, allowing a larger range on systems where long is a larger
type than int.  Document the behavior.

Regtested on x86_64-pc-linux-gnu, committed as obvious.

2019-02-14  Janne Blomqvist  <jb@gcc.gnu.org>

        PR fortran/81552
        * gfortran.h (gfc_option_t): Make flag_init_integer_value a long.
        * options.c (gfc_handle_option): Use strtol instead of atoi.
        * invoke.texi: Document -finit-integer behavior in more detail

From-SVN: r268906
2019-02-14 23:33:29 +02:00
Maya Rashish
2f2b8e4054 Add netbsd support for D compiler and runtime
Merges upstream druntime fb4bda91.

2019-02-14  Maya Rashish  <coypu@sdf.org>

gcc/ChangeLog:

	* config.gcc (*-*-netbsd*): Add netbsd-d.o
	* config/netbsd-d.c: New file.
	* config/t-netbsd: Add netbsd-d.o

gcc/d/ChangeLog:

	* d-system.h: NetBSD is POSIX.

libphobos/ChangeLog:

	* configure.tgt: Add netbsd/x86 as supported target.

From-SVN: r268905
2019-02-14 21:25:39 +00:00
Ian Lance Taylor
a6c723e202 re PR go/89321 (cross build with riscv64 gccgo compilation failed due to assert in constructor_expression)
PR go/89321
    compiler: copy has_padding field from converted struct
    
    Test case is https://golang.org/cl/162617.
    
    Fixes https://gcc.gnu.org/PR89321
    
    Reviewed-on: https://go-review.googlesource.com/c/162618

From-SVN: r268904
2019-02-14 21:07:13 +00:00
Steve Ellcey
cc2593977b pcs_attribute.c: New test.
2018-02-14  Steve Ellcey  <sellcey@marvell.com>

	* gcc.target/aarch64/pcs_attribute.c: New test.

From-SVN: r268903
2019-02-14 21:05:48 +00:00
Steve Ellcey
497f281c25 aarch64.c (aarch64_attribute_table): Change affects_type_identity to true for aarch64_vector_pcs.
2018-02-14  Steve Ellcey  <sellcey@marvell.com>

	* config/aarch64/aarch64.c (aarch64_attribute_table): Change
	affects_type_identity to true for aarch64_vector_pcs.
	(aarch64_comp_type_attributes): New function.
	(TARGET_COMP_TYPE_ATTRIBUTES): New macro.

From-SVN: r268902
2019-02-14 21:04:12 +00:00
Joseph Myers
86b69c6b11 * da.po: Update.
From-SVN: r268901
2019-02-14 20:50:51 +00:00
Joseph Myers
7b7a4f894e * da.po: Update.
From-SVN: r268900
2019-02-14 20:49:37 +00:00
Harald Anlauf
14b693baa2 re PR fortran/88248 ([F18] Bogus warning about obsolescent feature: Labeled DO statement)
2019-02-14  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/88248
	* symbol.c: Move check for labeled DO statement from
	gfc_define_st_label to gfc_reference_st_label.

	PR fortran/88248
	* gfortran.dg/pr88248.f90: New test.
	* gfortran.dg/f2018_obs.f90: Updated test.

From-SVN: r268895
2019-02-14 20:24:54 +00:00
Ian Lance Taylor
26a8c34ec9 compiler: check duplicate string keys in map composite literals
Updates golang/go#28104
    
    Reviewed-on: https://go-review.googlesource.com/c/161357

From-SVN: r268891
2019-02-14 19:26:20 +00:00
Tamar Christina
a930500fc4 Arm: Fix testism in pr88850 testcase.
gcc/testsuite/ChangeLog:

	* gcc.target/arm/pr88850.c: change options to additional option.

From-SVN: r268887
2019-02-14 18:29:06 +00:00
Rainer Orth
0b6e3127e8 Provide __start_minfo/__stop_minfo for linkers that don't (PR d/87864)
libphobos:
	PR d/87864
	* configure.ac (DRTSTUFF_SPEC): New variable.
	Substitute it.
	* libdruntime/m4/druntime/os.m4 (DRUNTIME_OS_MINFO_BRACKETING):
	New automake conditional.
	* configure: Regenerate.
	* libdruntime/gcc/drtstuff.c: New file.
	* libdruntime/Makefile.am [!DRUNTIME_OS_MINFO_BRACKETING]
	(DRTSTUFF, toolexeclib_DATA): New variables.
	(gcc/drtbegin.lo, gcc/drtend.lo): New rules.
	(libgdruntime_la_LDFLAGS): Use -Wc instead of -Xcompiler.
	Add -dstartfiles -B../src -Bgcc.
	(libgdruntime_la_DEPENDENCIES): New variable.
	(unittest_static_LDFLAGS): Use -Wc instead of -Xcompiler.
	(libgdruntime_t_la_LDFLAGS): Likewise.
	(unittest_LDFLAGS): Likewise.
	* src/Makefile.am (libgphobos_la_LDFLAGS): Use -Wc instead of
	-Xcompiler.
	Add -dstartfiles -B../libdruntime/gcc.
	(unittest_static_LDFLAGS): Use -Wc instead of -Xcompiler.
	(libgphobos_t_la_LDFLAGS): Likewise.
	(unittest_LDFLAGS): Likewise.
	* libdruntime/Makefile.in, src/Makefile.in: Regenerate.
	* Makefile.in, testsuite/Makefile.in: Regenerate.
	* libdruntime/rt/sections_elf_shared.d (Minfo_Bracketing): Don't
	assert.
	* libdruntime/gcc/config.d.in (Minfo_Bracketing): Remove.
	* src/drtstuff.spec: New file.
	* src/libgphobos.spec.in (DRTSTUFF_SPEC): Substitute.
	(*lib): Only pass SPEC_PHOBOS_DEPS without -debuglib, -defaultlib,
	-nophoboslib.
	* testsuite/testsuite_flags.in <--gdcldflags> (GDCLDFLAGS): Add
	-B${BUILD_DIR}/libdruntime/gcc.

	gcc/d:
	PR d/87864
	* lang.opt (dstartfiles): New option.
	* d-spec.cc (need_spec): New variable.
	(lang_specific_driver) <OPT_dstartfiles>: Enable need_spec.
	(lang_specific_pre_link): Also load libgphobos.spec if need_spec.

	gcc/testsuite:
	PR d/87864
	* lib/gdc.exp (gdc_link_flags): Add path to drtbegin.o/drtend.o if
	present.

From-SVN: r268886
2019-02-14 17:47:49 +00:00
Jonathan Wakely
323694e9a2 Update libstdc++ documentation for C++2a implementation status
* doc/xml/manual/status_cxx2020.xml: Update P0887R1 status.
	* doc/html/*: Regenerate.

From-SVN: r268885
2019-02-14 17:46:26 +00:00
Tamar Christina
2a26aed6ad Arm: Add HF modes to ANY iterators
The iterator ANY64 are used in various general split patterns and is supposed
to contain all 64 bit modes.

For some reason the pattern has HI but not HF.  This adds HF so that general
64 bit splits are generated for these modes as well.  These are required
by various split patterns that expect them to be there.

gcc/ChangeLog:

	PR target/88850
	* config/arm/iterators.md (ANY64): Add V4HF.

gcc/testsuite/ChangeLog:

	PR target/88850
	* gcc.target/arm/pr88850-2.c: New test.
	* lib/target-supports.exp
	(check_effective_target_arm_neon_softfp_fp16_ok_nocache,
	check_effective_target_arm_neon_softfp_fp16_ok,
	add_options_for_arm_neon_softfp_fp16): New.

From-SVN: r268884
2019-02-14 17:17:20 +00:00
Jonathan Wakely
bb2a18a3a8 Update libstdc++ documentation for implementation status
* doc/xml/manual/status_cxx2017.xml: Add P0063R3 to status table.
	* doc/html/*: Regenerate.

From-SVN: r268883
2019-02-14 15:12:57 +00:00
Jonathan Wakely
b7dbc6723a DR 2586 fix value category in uses-allocator checks
Because uses-allocator construction is invariably done with a const
lvalue the __uses_alloc helper should use a const lvalue for the
is_constructible checks. Otherwise, it can detect that the type can be
constructed from an rvalue, and then an error happens when a const
lvalue is passed to the constructor instead.

Prior to LWG DR 2586 scoped_allocator_adaptor incorrectly used an rvalue
type in the is_constructible check and then used a non-const lvalue for
the actual construction. The other components using uses-allocator
construction (tuple and polymorphic_allocator) have always done so with
a const lvalue allocator, although the use of __use_alloc in our
implementation meant they behaved the same as scoped_allocator_adaptor
and incorrectly used rvalues for the is_constructible checks.

In C++20 the P0591R4 changes mean that all uses-allocator construction
is defined in terms of the new uses_allocator_construction_args
functions, which always use a const lvalue allocator.

The changes in this patch ensure that the __use_alloc helper correctly
matches the requirements in the standard, consistently using a const
lvalue allocator for the is_constructible checks and the actual
constructor arguments.

	* doc/xml/manual/intro.xml: Document LWG 2586 status.
	* include/bits/uses_allocator.h (__uses_alloc): Use const lvalue
	allocator type in is_constructible checks.
	* testsuite/20_util/scoped_allocator/69293_neg.cc: Adjust dg-error.
	* testsuite/20_util/scoped_allocator/dr2586.cc: New test.
	* testsuite/20_util/tuple/cons/allocators.cc: Add test using
	problematic type from LWG 2586 discussion.
	* testsuite/20_util/uses_allocator/69293_neg.cc: Adjust dg-error.
	* testsuite/20_util/uses_allocator/cons_neg.cc: Likewise.

From-SVN: r268882
2019-02-14 15:08:33 +00:00
Matthew Malcomson
6461bdc48f When this testcase was introduced it failed to account for the possibility of...
When this testcase was introduced it failed to account for the possibility of
targets that do not support arm mode or that do not support the ldrd/strd
instructions.

This patch accounts for both of these by adding some
dg-require-effective-target lines to the testcase.

This patch also adds a new effective-target procedure to check a target
supports ldrd/strd.

This patch also adds a new effective-target procedure to check a target
supports arm ldrd/strd.
The check uses the 'r' constraint to ensure SP is not used so that it will work
for thumb mode code generation as well as arm mode.

Tested by running this testcase with cross compilers using "-march=armv5t",
"-mcpu=cortex-m3", "-mcpu-arm7tdmi", "-mcpu=cortex-a9 -march=armv5t" for both
arm-none-eabi and arm-none-linux-gnueabihf.
Also ran this testcase with `make check` natively.

gcc/testsuite/ChangeLog:

2019-02-14  Matthew Malcomson  <matthew.malcomson@arm.com>

	* gcc.dg/rtl/arm/ldrd-peepholes.c: Restrict testcase.
	* lib/target-supports.exp: Add procedure to check for ldrd.

From-SVN: r268881
2019-02-14 14:51:46 +00:00
Jan Hubicka
ae2341c94d re PR lto/88677 (Divergence in -O2 and -O2 -flto early opts)
PR lto/88677
Fix PR number.

From-SVN: r268880
2019-02-14 14:49:03 +00:00
Jonathan Wakely
a61ae535c3 Add std::timespec and std::timespec_get for C++17
* configure.ac: Check for C11 timespec_get function.
	* crossconfig.m4 (freebsd, linux, gnu, cygwin, solaris, netbsd)
	(openbsd): Likewise
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* include/c_global/ctime (timespec, timespec_get): Add to namespace
	std for C++17 and up.

From-SVN: r268879
2019-02-14 14:10:25 +00:00