Commit graph

174391 commits

Author SHA1 Message Date
Sandra Loosemore
7b72c0d4a0 Fix line terminator pattern in testcase.
I observed this testcase was failing on nios2-elf.  The more general
regexp was copied from other tests using dg-output.

2020-01-21  Sandra Loosemore  <sandra@codesourcery.com>

	gcc/testsuite/
	* g++.dg/coroutines/torture/mid-suspend-destruction-0.C: Generalize
	line terminators in patterns.
2020-01-21 11:20:45 -08:00
Richard Sandiford
63492372c4 aarch64: Use stdint types for SVE ACLE elements
I'd used mode-based element types in the SVE ACLE implementation, but
it turns out that they don't correspond to the <stdint.h> types used by
ILP32 newlib.  GCC already knows what the correct <stdint.h> types are,
I just wasn't using the right interface to find them.

A consequence of this is that ILP32 newlib code needs to cast "int *"
pointers to "int32_t *" before passing them to s32 loads and stores,
since int32_t is defined as "long int" rather than "int".  That matches
the normal C++ overloading behaviour for this target, where passing
"int *" to:

    void f(int32_t *);
    void f(int64_t *);

would be ambiguous.  It also matches the corresponding <arm_neon.h>
behaviour.

2020-01-21  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* config/aarch64/aarch64-sve-builtins.def: Use get_typenode_from_name
	to get the integer element types.

gcc/testsuite/
	* gcc.target/aarch64/sve/acle/general-c/load_1.c (f1): Cast to
	int32_t * rather than int *.
	* gcc.target/aarch64/sve/acle/general-c/load_2.c (f1): Likewise.
	* gcc.target/aarch64/sve/acle/general-c/load_gather_sv_1.c
	(f1): Likewise.
	* gcc.target/aarch64/sve/acle/general-c/load_gather_sv_2.c
	(f1): Likewise.
	* gcc.target/aarch64/sve/acle/general-c/load_gather_sv_restricted_1.c
	(f1): Likewise.
	* gcc.target/aarch64/sve/acle/general-c/load_replicate_1.c
	(f1): Likewise.
	* gcc.target/aarch64/sve/acle/general-c/store_1.c (f1): Likewise.
	* gcc.target/aarch64/sve/acle/general-c/store_2.c (f1): Likewise.
	* gcc.target/aarch64/sve/acle/general-c/store_scatter_index_1.c
	(f1): Likewise.
	* gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_2.c
	(f1): Likewise.
	* gcc.target/aarch64/sve/acle/general-c/store_scatter_offset_restricted_1.c
	(f1): Likewise.
2020-01-21 16:22:13 +00:00
Richard Sandiford
fb15e2bab5 aarch64: Fix SVE ACLE handling of SImode pointers
This long-overdue patch promotes SImode pointers to DImode addresses,
avoiding various ICEs in the existing tests.

2020-01-21  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* config/aarch64/aarch64-sve-builtins.h
	(function_expander::convert_to_pmode): Declare.
	* config/aarch64/aarch64-sve-builtins.cc
	(function_expander::convert_to_pmode): New function.
	(function_expander::get_contiguous_base): Use it.
	(function_expander::prepare_gather_address_operands): Likewise.
	* config/aarch64/aarch64-sve-builtins-sve2.cc
	(svwhilerw_svwhilewr_impl::expand): Likewise.
2020-01-21 16:22:12 +00:00
Szabolcs Nagy
c292cfe539 [AArch64] PR92424: Fix -fpatchable-function-entry=N,M with BTI
This is a workaround that emits a BTI after the function label if that
is followed by a patch area. We try to remove the BTI that follows the
patch area (this may fail e.g. if the first instruction is a PACIASP).

So before this commit -fpatchable-function-entry=3,1 with bti generates

    .section __patchable_function_entries
    .8byte .LPFE
    .text
  .LPFE:
    nop
  foo:
    nop
    nop
    bti c // or paciasp
    ...

and after this commit

    .section __patchable_function_entries
    .8byte .LPFE
    .text
  .LPFE:
    nop
  foo:
    bti c
    nop
    nop
    // may be paciasp
    ...

and with -fpatchable-function-entry=1 (M=0) the code now is

  foo:
    bti c
    .section __patchable_function_entries
    .8byte .LPFE
    .text
  .LPFE:
    nop
    // may be paciasp
    ...

There is a new bti insn in the middle of the patchable area users need
to be aware of unless M=0 (patch area is after the new bti) or M=N
(patch area is before the label, no new bti). Note: bti is not added to
all functions consistently (it can be turned off per function using a
target attribute or the compiler may detect that the function is never
called indirectly), so if bti is inserted in the middle of a patch area
then user code needs to deal with detecting it.

Tested on aarch64-none-linux-gnu.

gcc/ChangeLog:

	PR target/92424
	* config/aarch64/aarch64.c (aarch64_declare_function_name): Set
	cfun->machine->label_is_assembled.
	(aarch64_print_patchable_function_entry): New.
	(TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY): Define.
	* config/aarch64/aarch64.h (struct machine_function): New field,
	label_is_assembled.

gcc/testsuite/ChangeLog:

	PR target/92424
	* gcc.target/aarch64/pr92424-1.c: New test.
	* gcc.target/aarch64/pr92424-2.c: New test.
	* gcc.target/aarch64/pr92424-3.c: New test.
2020-01-21 15:54:44 +00:00
David Malcolm
65be83b5ac ipa-profile.c: reset call_sums state within ipa-profile.c (v2; PR 93315)
gcc/ChangeLog:
	PR ipa/93315
	* ipa-profile.c (ipa_profile): Delete call_sums and set it to
	NULL on exit.
2020-01-21 10:49:46 -05:00
Matthew Malcomson
3c9e580511 [AArch64] effective_target for aarch64 f64mm asm
Commit 9ceec73 introduced intrinsics for the AArch64 FP64 matrix
multiply instructions.  These require binutils support for the same
instructions.

This patch adds a DejaGNU test to ensure this binutils support is there
and uses it in the files that need this test.

Testing Done:
Checked on a cross-compiler that:
Tests running for binutils commit e264b5b7a are listed as UNSUPPORTED.
Tests running for binutils commit 26916852e all pass.

gcc/testsuite/ChangeLog:

2020-01-21  Matthew Malcomson  <matthew.malcomson@arm.com>

	* gcc.target/aarch64/sve/acle/asm/ld1ro_f16.c: Use require
	directive.
	* gcc.target/aarch64/sve/acle/asm/ld1ro_f32.c: Likewise.
	* gcc.target/aarch64/sve/acle/asm/ld1ro_f64.c: Likewise.
	* gcc.target/aarch64/sve/acle/asm/ld1ro_s16.c: Likewise.
	* gcc.target/aarch64/sve/acle/asm/ld1ro_s32.c: Likewise.
	* gcc.target/aarch64/sve/acle/asm/ld1ro_s64.c: Likewise.
	* gcc.target/aarch64/sve/acle/asm/ld1ro_s8.c: Likewise.
	* gcc.target/aarch64/sve/acle/asm/ld1ro_u16.c: Likewise.
	* gcc.target/aarch64/sve/acle/asm/ld1ro_u32.c: Likewise.
	* gcc.target/aarch64/sve/acle/asm/ld1ro_u64.c: Likewise.
	* gcc.target/aarch64/sve/acle/asm/ld1ro_u8.c: Likewise.
	* lib/target-supports.exp: Add assembly requirement directive.
2020-01-21 15:44:03 +00:00
Jan Hubicka
28307164df Fix updating of call_stmt_site_hash
This patch fixes ICE causes by call stmt site hash going out of sync.  For
speculative edges it is assumed to contain a direct call so if we are
removing it hashtable needs to be updated.  I realize that the code is ugly
but I will leave cleanup for next stage1.

Bootstrapped/regtested x86_64-linux. This patch makes it possible to build
Firefox again.

	PR lto/93318
	* cgraph.c (cgraph_edge::resolve_speculation,
	cgraph_edge::redirect_call_stmt_to_callee): Fix update of
	call_stmt_site_hash.
2020-01-21 16:33:43 +01:00
Jason Merrill
8158a46408 PR c++/91476 - anon-namespace reference temp clash between TUs.
The problem in the PR was that make_temporary_var_for_ref_to_temp ran before
determine_visibility, so when we copied the linkage of the reference
variable it had not yet been restricted by its anonymous namespace context,
so the temporary wrongly ended up with TREE_PUBLIC set.  The natural
solution is to run determine_visibility earlier.  But that needs to happen
after maybe_commonize_var increases the linkage of some local variables, and
on targets without weak symbol support, that function does different things
based on the results of check_initializer, which is what calls
make_temporary_var_for_ref_to_temp.  To break this circular dependency I'm
calling maybe_commonize_var early, and then again later if the target
doesn't support weak symbols.

It also occurred to me that make_temporary_var_for_ref_to_temp wasn't
handling DECL_VISIBILITY at all, and verified that we were doing the wrong
thing.  So I've combined the linkage-copying code from there and two other
places.

	* decl2.c (copy_linkage): Factor out of get_guard.
	* call.c (make_temporary_var_for_ref_to_temp): Use it.
	* decl.c (cp_finish_decomp): Use it.
	(cp_finish_decl): determine_visibility sooner.
2020-01-21 10:17:50 -05:00
Martin Liska
56e2cc43de
Remove dead variable.
* config/rs6000/rs6000.c (common_mode_defined): Remove
	unused variable.
2020-01-21 15:53:34 +01:00
Tobias Burnus
b31f80231d Fortran] PR93309 – permit repeated 'implicit none(external)'
PR fortran/93309
        * interface.c (gfc_procedure_use): Also check parent namespace for
        'implict none (external)'.
        * symbol.c (gfc_get_namespace): Don't set has_implicit_none_export
        to parent namespace's setting.

        PR fortran/93309
        * gfortran.dg/external_implicit_none_2.f90: New.
2020-01-21 13:42:11 +01:00
Richard Biener
01e9f1812c tree-optimization/92328 fix value-number with bogus type
We were actually value-numbering two entities with different type
the same rather than just having the same representation in the
hashtable.  The following fixes that by wrapping the value in a
to be inserted VIEW_CONVERT_EXPR.

2020-01-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92328
	* tree-ssa-sccvn.c (vn_reference_lookup_3): Preserve
	type when value-numbering same-sized store by inserting a
	VIEW_CONVERT_EXPR.
	(eliminate_dom_walker::eliminate_stmt): When eliminating
	a redundant store handle bit-reinterpretation of the same value.

	* gcc.dg/torture/pr92328.c: New testcase.
2020-01-21 12:54:08 +01:00
Andrew Pinski
6fc2f93373 Change recursive prepare_block_for_update to use a worklist
Reported as PR 93321, prepare_block_for_update with some huge
recusive inlining can go past the stack limit. Transforming this
recursive into worklist improves the stack usage here and we no
longer seg fault for the testcase.  Note the order we walk the siblings
change.

ChangeLog:
	PR tree-opt/93321
	* tree-into-ssa.c (prepare_block_for_update_1): Split out from ...
	(prepare_block_for_update): This.  Use a worklist instead of recursing.
2020-01-21 11:17:26 +00:00
Mihail Ionescu
f0aec86438 [PATCH, GCC/ARM] Fix clear_operation_p uninitialised variable
2020-01-21  Mihail-Calin Ionescu  <mihail.ionescu@arm.com>

	* gcc/config/arm/arm.c (clear_operation_p):
	Initialise last_regno, skip first iteration
	based on the first_set value and use ints instead
	of the unnecessary HOST_WIDE_INTs.
2020-01-21 10:11:35 +00:00
Jakub Jelinek
51e010b5f7 powerpc: Fix ICE with fp conditional move (PR target/93073)
The following testcase ICEs, because for TFmode the particular subtraction
pattern (*subtf3) is not enabled with the given options.  Using
expand_simple_binop instead of emitting the subtraction by hand just moves
the ICE one insn later, NEG of ABS is not then recognized, etc., but
ultimately the problem is that when rs6000_emit_cmove is called for floating
point operand mode (and earlier condition ensures that in that case
compare_mode is also floating point), the expander makes sure the
operand mode is SFDF, but for the comparison mode nothing checks it, yet
there is just one *fsel* pattern with 2 separate SFDF iterators.

The following patch fixes it by giving up if compare_mode is not SFmode or
DFmode.

2020-01-21  Jakub Jelinek  <jakub@redhat.com>

	PR target/93073
	* config/rs6000/rs6000.c (rs6000_emit_cmove): If using fsel, punt for
	compare_mode other than SFmode or DFmode.

	* gcc.target/powerpc/pr93073.c: New test.
2020-01-21 09:17:27 +01:00
Frederik Harwath
7d593fd672 Add runtime ISA check for amdgcn offloading
The HSA/ROCm runtime rejects binaries not built for the exact GPU device
present. So far, the libgomp amdgcn plugin does not verify that the GPU ISA
and the ISA specified at compile time match before handing over the binary to
the runtime.  In case of a mismatch, the user is confronted with an unhelpful
runtime error.

This commit implements a runtime ISA check. In case of an ISA mismatch, the
execution is aborted with a clear error message and a hint at the correct
compilation parameters for the GPU on which the execution has been attempted.

libgomp/
	* plugin/plugin-gcn.c (EF_AMDGPU_MACH): New enum.
	* (EF_AMDGPU_MACH_MASK): New constant.
	* (gcn_isa): New typedef.
	* (gcn_gfx801_s): New constant.
	* (gcn_gfx803_s): New constant.
	* (gcn_gfx900_s): New constant.
	* (gcn_gfx906_s): New constant.
	* (gcn_isa_name_len): New constant.
	* (elf_gcn_isa_field): New function.
	* (isa_hsa_name): New function.
	* (isa_gcc_name): New function.
	* (isa_code): New function.
	* (struct agent_info): Add field "device_isa" and remove field
	"gfx900_p".
	* (GOMP_OFFLOAD_init_device): Adapt agent init to "agent_info"
	field changes, fail if device has unknown ISA.
	* (parse_target_attributes): Replace "gfx900_p" by "device_isa".
	* (isa_matches_agent): New function ...
	* (create_and_finalize_hsa_program): ... used from here to check
	that the GPU ISA and the code-object ISA match.
2020-01-21 07:41:45 +01:00
Bin Cheng
b313d3c49c Fix false warning messages about missing return in coroutine.
The patch sets current_function_returns_value flag in templates for
all co_return/co_yield/co_await cases, as well as for ramp function.

gcc/cp/ChangeLog
    * coroutines.cc (finish_co_await_expr): Set return value flag.
    (finish_co_yield_expr, morph_fn_to_coro): Ditto.

gcc/testsuite/ChangeLog
    * g++.dg/coroutines/co-return-warning-1.C: New test.
2020-01-21 12:16:16 +08:00
Kito Cheng
e0a5b313c1 RISC-V: Disallow regrenme if the TO register never used before for interrupt functions
gcc/ChangeLog

	PR target/93304
	* config/riscv/riscv-protos.h (riscv_hard_regno_rename_ok): New.
	* config/riscv/riscv.c (riscv_hard_regno_rename_ok): New.
	* config/riscv/riscv.h (HARD_REGNO_RENAME_OK): Defined.

gcc/testsuite/ChangeLog

	PR target/93304
	* gcc.target/riscv/pr93304.c: New test.
2020-01-21 10:40:47 +08:00
GCC Administrator
2df76cd689 Daily bump. 2020-01-21 00:16:31 +00:00
Jonathan Wakely
c784f16204 libstdc++: Fix recent documentation changes
* doc/xml/faq.xml: Fix grammar.
	* doc/xml/manual/appendix_contributing.xml: Improve instructions.
	* doc/xml/manual/spine.xml: Update copyright years.
	* doc/html/*: Regenerate.
2020-01-20 21:45:52 +00:00
Joseph Myers
bc559d6a01 Update GCC zh_TW.po.
* zh_TW.po: Update.
2020-01-20 18:56:48 +00:00
Andrew Stubbs
09e0ad6253 Update OpenACC tests for amdgcn
2020-01-20  Andrew Stubbs  <ams@codesourcery.com>

	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Skip test on gcn.
	* testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c (main):
	Adjust test dimensions for amdgcn.
	* testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c (main): Adjust
	gang/worker/vector expectations dynamically.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c
	(main): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c (main): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c (main): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c (main): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c (main): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-red-wv-1.c (main): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-v-1.c (main): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-w-1.c (main): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c (main): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c
	(acc_gang): Recognise acc_device_radeon.
	(acc_worker): Likewise.
	(acc_vector): Likewise.
	(main): Set expectations for amdgcn.
	* testsuite/libgomp.oacc-c-c++-common/routine-gwv-1.c
	(main): Adjust gang/worker/vector expectations dynamically.
	* testsuite/libgomp.oacc-c-c++-common/routine-v-1.c (main): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/routine-w-1.c (main): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/routine-wv-1.c (main): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c: Set expectations
	for amdgcn.
2020-01-20 16:51:06 +00:00
Wilco Dijkstra
3a43459715 [AArch64] Set jump-align=4 for neoversen1
Testing shows the setting of 32:16 for jump alignment has a significant
codesize cost, however it doesn't make a difference in performance.
So set jump-align to 4 to get 1.6% codesize improvement.

gcc/
	* config/aarch64/aarch64.c (neoversen1_tunings): Set jump_align to 4.
2020-01-20 14:29:40 +00:00
Andrew Pinski
45d06a4045 Fix PR 93242: patchable-function-entry broken on MIPS
On MIPS, .set noreorder/reorder needs to emitted around
the nop.  The template for the nop instruction uses %(/%) to
do that.  But default_print_patchable_function_entry uses
fprintf rather than output_asm_insn to output the instruction.

This fixes the problem by using output_asm_insn to emit the nop
instruction.

ChangeLog:

PR middle-end/93242
* targhooks.c (default_print_patchable_function_entry): Use
output_asm_insn to emit the nop instruction.
2020-01-20 14:22:42 +00:00
Martin Sebor
414231ba78 PR testsuite/92829 - several -Wstringop-overflow test case failures on powerpc64
* g++.dg/warn/Wstringop-overflow-4.C: Adjust test to avoid failures
	due to an aparrent VRP limtation.
	* gcc.dg/Wstringop-overflow-25.c: Same.
2020-01-20 14:53:33 +01:00
Fangrui Song
a5d8a40617 Align __patchable_function_entries to POINTER_SIZE [PR93194]
2020-01-20  Fangrui Song  <maskray@google.com>

gcc/
	PR middle-end/93194
	* targhooks.c (default_print_patchable_function_entry): Align to
	POINTER_SIZE.
2020-01-20 13:47:51 +00:00
Nathan Sidwell
ad1a3914ae [PR 80005] Fix __has_include
__has_include is funky in that it is macro-like from the POV of #ifdef and
friends, but lexes its parenthesize argument #include-like.  We were
failing the second part of that, because we used a forwarding macro to an
internal name, and hence always lexed the argument in macro-parameter
context.  We componded that by not setting the right flag when lexing, so
it didn't even know.  Mostly users got lucky.

This reimplements the handline.
1) Remove the forwarding, but declare object-like macros that
expand to themselves.  This satisfies the #ifdef requirement

2) Correctly set angled_brackets when lexing the parameter.  This tells
the lexer (a) <...> is a header name and (b) "..." is too (not a string).

3) Remove the in__has_include lexer state, just tell find_file that that's
what's happenning, so it doesn't emit an error.

We lose the (undocumented) ability to #undef __has_include.  That may well
have been an accident of implementation.  There are no tests for it.

We gain __has_include behaviour for all users of the preprocessors -- not
just the C-family ones that defined a forwarding macro.

	libcpp/
	PR preprocessor/80005
	* include/cpplib.h (BT_HAS_ATTRIBUTE): Fix comment.
	* internal.h (struct lexer_state): Delete in__has_include field.
	(struct spec_nodes): Rename n__has_include{,_next}__ fields.
	(_cpp_defined_macro_p): New.
	(_cpp_find_file): Add has_include parm.
	* directives.c (lex_macro_node): Combine defined,
	__has_inline{,_next} checking.
	(do_ifdef, do_ifndef): Use _cpp_defined_macro_p.
	(_cpp_init_directives): Refactor.
	* expr.c (parse_defined): Use _cpp_defined_macro_p.
	(eval_token): Adjust parse_has_include calls.
	(parse_has_include): Add OP parameter.  Reimplement.
	* files.c (_cpp_find_file): Add HAS_INCLUDE parm.  Use it to
	inhibit error message.
	(_cpp_stack_include): Adjust _cpp_find_file call.
	(_cpp_fake_include, _cpp_compare_file_date): Likewise.
	(open_file_failed): Remove in__has_include check.
	(_cpp_has_header): Adjust _cpp_find_file call.
	* identifiers.c (_cpp_init_hashtable): Don't init
	__has_include{,_next} here ...
	* init.c (cpp_init_builtins): ... init them here.  Define as
	macros.
	(cpp_read_main_file): Adjust _cpp_find_file call.
	* pch.c (cpp_read_state): Adjust __has_include{,_next} access.
	* traditional.c (_cpp_scan_out_locgical_line): Likewise.

	gcc/c-family/
	PR preprocessor/80005
	* c-cppbuiltins.c (c_cpp_builtins): Don't define __has_include{,_next}.

	gcc/testsuite/
	PR preprocessor/80005
	* g++.dg/cpp1y/feat-cxx14.C: Adjust.
	* g++.dg/cpp1z/feat-cxx17.C: Adjust.
	* g++.dg/cpp2a/feat-cxx2a.C: Adjust.
	* g++.dg/cpp/pr80005.C: New.
2020-01-20 05:39:59 -08:00
Mark Eggleston
e82ba180d6 [PATCH] PR Fortran/93263 Correct test case
Should've have checked for the existance of a non static integer
using scan-tree-dump instead of scan-tree-dump-not. A cut and paste
error.
2020-01-20 13:23:20 +00:00
H.J. Lu
1a2b60b581 x32: Add x32 support to -mtls-dialect=gnu2
To add x32 support to -mtls-dialect=gnu2, we need to replace DI with
P in GNU2 TLS patterns.  Since DEST set by tls_dynamic_gnu2_64 is in
ptr_mode, PLUS in GNU2 TLS address computation must be done in ptr_mode
to support -maddress-mode=long.  Also replace the "{q}" suffix on lea
with "%z0" to support both 32-bit and 64-bit destination register.

Tested on Linux/x86-64.

gcc/

	PR target/93319
	* config/i386/i386.c (legitimize_tls_address): Pass Pmode to
	gen_tls_dynamic_gnu2_64.  Compute GNU2 TLS address in ptr_mode.
	* config/i386/i386.md (tls_dynamic_gnu2_64): Renamed to ...
	(@tls_dynamic_gnu2_64_<mode>): This.  Replace DI with P.
	(*tls_dynamic_gnu2_lea_64): Renamed to ...
	(*tls_dynamic_gnu2_lea_64_<mode>): This.  Replace DI with P.
	Remove the {q} suffix from lea.
	(*tls_dynamic_gnu2_call_64): Renamed to ...
	(*tls_dynamic_gnu2_call_64_<mode>): This.  Replace DI with P.
	(*tls_dynamic_gnu2_combine_64): Renamed to ...
	(*tls_dynamic_gnu2_combine_64_<mode>): This.  Replace DI with P.
	Pass Pmode to gen_tls_dynamic_gnu2_64.

gcc/testsuite/

	PR target/93319
	* gcc.target/i386/pr93319-1a.c: New test.
	* gcc.target/i386/pr93319-1b.c: Likewise.
	* gcc.target/i386/pr93319-1c.c: Likewise.
	* gcc.target/i386/pr93319-1d.c: Likewise.
2020-01-20 05:14:16 -08:00
Wilco Dijkstra
35e58efb7a [AArch64] Set SLOW_BYTE_ACCESS
Contrary to all documentation, SLOW_BYTE_ACCESS simply means accessing
bitfields by their declared type, which results in better codegeneration.

gcc/
	* config/aarch64/aarch64.h (SLOW_BYTE_ACCESS): Set to 1.
2020-01-20 13:09:15 +00:00
Richard Sandiford
7387153ca1 aarch64: Remove parameter name and ATTRIBUTE_UNUSED
2020-01-20  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* config/aarch64/aarch64-sve-builtins-base.cc
	(svld1ro_impl::memory_vector_mode): Remove parameter name.
2020-01-20 13:07:27 +00:00
Richard Biener
991b91497f debug/92763 keep DIEs that might be used in DW_TAG_inlined_subroutine
We were pruning type-local subroutine DIEs if their context is unused
despite us later needing those DIEs as abstract origins for inlines.
The patch makes code already present for -fvar-tracking-assignments
unconditional.

2020-01-20  Richard Biener  <rguenther@suse.de>

	PR debug/92763
	* dwarf2out.c (prune_unused_types): Unconditionally mark
	called function DIEs.

	* g++.dg/debug/pr92763.C: New testcase.
2020-01-20 12:56:43 +01:00
Richard Earnshaw
24b178184f contrib: New remotes structure for vendor and personal refs
The initial structure for vendor and personal branches makes use of
the default remote (normally origin) for the upstream
repository).  Unfortunately, this causes some confusion, especially for
personal branches because a push will not push to the correct upstream
location.  This can be 'fixed' by adding a push refspec for the remote,
but that has the unfortunate consequence of breaking the push.default
behaviour for git push, and it becomes too easy to accidentally commit
something unintended to the main parts of the repository.

To work around this, this patch changes the configuration to use
separate 'remotes' for these additional refs, with one remote for the
personal space and another remote for each vendor's space.  The
personal space is called after the user's preferred branch-space
prefix (default 'me'), the vendor spaces are called
vendors/<vendor-name>.

As far as possible, I've made the script automatically restructure any
existing fetch or push lines that earlier versions of the scripts may
have created - the gcc-git-customization.sh script will convert all
vendor refs that it can find, so it is not necessary to re-add any
vendors you've already added.

You might, however, want to run
  git remote prune <origin>
after running to clean up any stale upstream-refs that might still be
in your local repo, and then
  git fetch vendors/<vendor>
or
  git fetch <me>
to re-populate the remotes/ structures.

Also, for any branch you already have that tracks a personal or vendor
branch upstream, you might need to run
  git config branch.<name>.remote <new-remote>

so that merges and pushes go to the right place (I haven't attempted
to automate this last part).

For vendors, the new structure means that

  git checkout -b <vendor>/<branch> remotes/vendors/<vendor>/<branch>

will correctly set up a remote tracking branch.

Please be aware that if you have multiple personal branches set up, then

  git push <me>

will still consider all of them for pushing.  If you only want to push
one branch, then either write
  git push <me> HEAD
or
  git push <me> <me>/branch
as appropriate.

And don't forget '-n' (--dry-run) to see what would be done if this
were not a dry run.

Finally, now that the vendors spaces are isolated from each other and
from the other spaces, I've added an option "--enable-push" to
git-fetch-vendor.sh.  If passed, then a "push" spec will be added for
that vendor to enable pushing to the upstream.  If you re-run the
script for the same vendor without the option, the push spec will be
removed.

	* gcc-git-customization.sh: Check that user-supplied remote
	name exists before continuting.  Use a separate remotes for the
	personal commit area.  Convert existing personal and vendor
	fetch rules to new layout.
	* git-fetch-vendor.sh: New vendor layout.  Add --enable-push
	option.
2020-01-20 10:37:29 +00:00
Paolo Carlini
0757f0bbf3 Add testcase of PR c++/92536, already fixed.
PR c++/92536
	* g++.dg/cpp1z/pr92536.C: New.
2020-01-20 11:17:19 +01:00
Martin Liska
92ce93c743
Record outer non-cleanup region in TREE EH.
PR tree-optimization/93199
	* tree-eh.c (struct leh_state): Add
	new field outer_non_cleanup.
	(cleanup_is_dead_in): Pass leh_state instead
	of eh_region.  Add a checking that state->outer_non_cleanup
	points to outer non-clean up region.
	(lower_try_finally): Record outer_non_cleanup
	for this_state.
	(lower_catch): Likewise.
	(lower_eh_filter): Likewise.
	(lower_eh_must_not_throw): Likewise.
	(lower_cleanup): Likewise.
2020-01-20 11:10:30 +01:00
Richard Biener
9c4f0d3118 tree-optimization/93094 pass down VECTORIZED_CALL to versioning
When versioning is run the IL is already mangled and finding
a VECTORIZED_CALL IFN can fail.

2020-01-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/93094
	* tree-vectorizer.h (vect_loop_versioning): Adjust.
	(vect_transform_loop): Likewise.
	* tree-vectorizer.c (try_vectorize_loop_1): Pass down
	loop_vectorized_call to vect_transform_loop.
	* tree-vect-loop.c (vect_transform_loop): Pass down
	loop_vectorized_call to vect_loop_versioning.
	* tree-vect-loop-manip.c (vect_loop_versioning): Use
	the earlier discovered loop_vectorized_call.

	* gcc.dg/vect/pr93094.c: New testcase.
2020-01-20 09:48:42 +01:00
Eric S. Raymond
f4d83eba60 Clean up references to Subversion in documentation sources.
Clean up references to SVN in in the GCC docs, redirecting to Git
documentation as appropriate.

Where references to "the source code repository" rather than a
specific VCS make sense, I have used them. You might, after
all, change VCSes again someday.

I have not modified either generated HTML files nor maintainer scripts.
These changes should be complete with repect to the documentation tree.

2020-01-19  Eric S. Raymond <esr@thyrsus.com>

	gcc/
	* doc/contribute.texi: Update for SVN -> Git transition.
	* doc/install.texi: Likewise.

	libstdc++-v3
	* doc/xml/faq.xml: Update for SVN -> Git transition.
	* doc/xml/manual/appendix_contributing.xml: Likewise.
	* doc/xml/manual/status_cxx1998.xml: Likewise.
	* doc/xml/manual/status_cxx2011.xml: Likewise.
	* doc/xml/manual/status_cxx2014.xml: Likewise.
	* doc/xml/manual/status_cxx2017.xml: Likewise.
	* doc/xml/manual/status_cxx2020.xml: Likewise.
	* doc/xml/manual/status_cxxtr1.xml: Likewise.
	* doc/xml/manual/status_cxxtr24733.xml: Likewise.
2020-01-19 17:12:29 -08:00
David Malcolm
8863f61c9c analyzer: ensure that all DejaGnu tests have unique names
gcc/testsuite/ChangeLog:
	* gcc.dg/analyzer/CVE-2005-1689-dedupe-issue.c: Ensure that all
	test names are unique.
	* gcc.dg/analyzer/attribute-nonnull.c: Likewise.
	* gcc.dg/analyzer/conditionals-notrans.c: Likewise.
	* gcc.dg/analyzer/data-model-1.c: Likewise.
	* gcc.dg/analyzer/data-model-18.c: Likewise.
	* gcc.dg/analyzer/data-model-8.c: Likewise.
	* gcc.dg/analyzer/data-model-9.c: Likewise.
	* gcc.dg/analyzer/file-1.c: Likewise.
	* gcc.dg/analyzer/file-paths-1.c: Likewise.
	* gcc.dg/analyzer/loop-2.c: Likewise.
	* gcc.dg/analyzer/loop-2a.c: Likewise.
	* gcc.dg/analyzer/loop-4.c: Likewise.
	* gcc.dg/analyzer/loop.c: Likewise.
	* gcc.dg/analyzer/malloc-1.c: Likewise.
	* gcc.dg/analyzer/malloc-2.c: Likewise.
	* gcc.dg/analyzer/malloc-ipa-10.c: Likewise.
	* gcc.dg/analyzer/malloc-ipa-2.c: Likewise.
	* gcc.dg/analyzer/malloc-macro-separate-events.c: Likewise.
	* gcc.dg/analyzer/malloc-paths-1.c: Likewise.
	* gcc.dg/analyzer/malloc-paths-2.c: Likewise.
	* gcc.dg/analyzer/malloc-paths-3.c: Likewise.
	* gcc.dg/analyzer/malloc-paths-4.c: Likewise.
	* gcc.dg/analyzer/malloc-paths-5.c: Likewise.
	* gcc.dg/analyzer/malloc-paths-7.c: Likewise.
	* gcc.dg/analyzer/malloc-paths-9.c: Likewise.
	* gcc.dg/analyzer/operations.c: Likewise.
	* gcc.dg/analyzer/params.c: Likewise.
	* gcc.dg/analyzer/pattern-test-1.c: Likewise.
	* gcc.dg/analyzer/pattern-test-2.c: Likewise.
	* gcc.dg/analyzer/sensitive-1.c: Likewise.
	* gcc.dg/analyzer/switch.c: Likewise.
	* gcc.dg/analyzer/taint-1.c: Likewise.
	* gcc.dg/analyzer/unknown-fns.c: Likewise.
2020-01-19 19:21:13 -05:00
GCC Administrator
bec2387682 Daily bump. 2020-01-20 00:16:31 +00:00
Hans-Peter Nilsson
3684bbb022 testsuite: effective_target_march_option: support checking for -march=*
* lib/target-supports.exp (effective_target_march_option): New.

I see no (other) way to, depending on the absence of an option,
add an option for a specific target.

For gcc.dg/torture/pr26515.c and cris-elf, you get an error for
supplying multiple (different) -march=... options (where that
error is desirable), like testing cris-elf with
RUNTESTFLAGS=--target_board=cris-sim/arch=v8, where otherwise
-march=v10 and -march=v8 will both be given, and the test would
fail.

For historians, this was accidentally misordered and committed after
the (first) patch using march_option.  Oops.
2020-01-19 20:38:06 +01:00
Hans-Peter Nilsson
0042bafd4b testsuite: Make use of effective-target march_option for cris
* gcc.dg/torture/pr26515.c (cris*-*-*): Conditionalize
	-march=v10 option on target ! march_option.
	* gcc.target/cris/asm-v10.S, gcc.target/cris/inasm-v10.c,
	gcc.target/cris/sync-1-v10.c: Similar.
2020-01-19 20:29:52 +01:00
Jason Merrill
bcfc2227c5 PR c++/33799 - destroy return value, take 2.
This patch differs from the reverted patch for 33799 in that it adds the
CLEANUP_STMT for the return value at the end of the function, and only if
we've seen a cleanup that might throw, so it should not affect most C++11
code.

	* cp-tree.h (current_retval_sentinel): New macro.
	(struct language_function): Add throwing_cleanup bitfield.
	* decl.c (cxx_maybe_build_cleanup): Set it.
	* except.c (maybe_set_retval_sentinel)
	(maybe_splice_retval_cleanup): New functions.
	* parser.c (cp_parser_compound_statement): Call
	maybe_splice_retval_cleanup.
	* typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
2020-01-19 13:56:22 -05:00
Jason Merrill
303484a735 Simplify lambda parsing.
Since we removed the special parsing for C++11 lambdas, it's just been an
open-coded copy of cp_parser_function_body.  So let's call it instead.  This
avoids the need to change this code in my revised 33799 patch.

	* parser.c (cp_parser_lambda_body): Use cp_parser_function_body.
2020-01-19 13:56:22 -05:00
Jan Hubicka
bf6fc129c0 Implement speculative call verifier
this patch implements verifier and fixes one bug where speculative calls
produced by ipa-devirt ended up having num_speculative_call_targets = 0
instead of 1.

	* cgraph.c (cgraph_edge::make_speculative): Increase number of
	speculative targets.
	(verify_speculative_call): New function
	(cgraph_node::verify_node): Use it.
	* ipa-profile.c (ipa_profile): Fix formating; do not set number of
	speculations.
2020-01-19 16:41:11 +01:00
Jan Hubicka
118aa5e31c Fix ICE in speculative_call_info
this fixes two issues with the new multi-target speculation code which reproduce
on Firefox.  I can now build firefox with FDO locally but on Mozilla build bots
it still fails with ICE in speculative_call_info.

One problem is that speuclative code compares call_stmt and lto_stmt_uid in
a way that may get unwanted effect when these gets out of sync.  It does not
make sense to have both non-zero so I added code clearing it and sanity check
that it is kept this way.

Other problem is cgraph_edge::make_direct not working well with multiple
targets.  In this case it removed one speuclative target and the indirect call
leaving other targets in the tree.

This is fixed by iterating across all targets and removing all except the good
one (if it exists).

	PR lto/93318
	* cgraph.c (cgraph_edge::resolve_speculation): Fix foramting.
	(cgraph_edge::make_direct): Remove all indirect targets.
	(cgraph_edge::redirect_call_stmt_to_callee): Use make_direct..
	(cgraph_node::verify_node): Verify that only one call_stmt or
	lto_stmt_uid is set.
	* cgraphclones.c (cgraph_edge::clone): Set only one call_stmt or
	lto_stmt_uid.
	* lto-cgraph.c (lto_output_edge): Simplify streaming of stmt.
	(lto_output_ref): Simplify streaming of stmt.
	* lto-streamer-in.c (fixup_call_stmt_edges_1): Clear lto_stmt_uid.
2020-01-19 13:49:38 +01:00
Thomas König
52354dadb8 Check for illegal reference in function. 2020-01-19 10:23:18 +01:00
GCC Administrator
2589beb1d1 Daily bump. 2020-01-19 00:16:30 +00:00
Jakub Jelinek
dba33cb727 c++: Fix coroutines.cc build for nvptx-none target
When building offloading cross-compiler from x86_64-linux to nvptx-none, the
build fails with:
../../gcc/cp/coroutines.cc: In function 'tree_node* get_fn_local_identifier(tree, const char*)':
../../gcc/cp/coroutines.cc:2255:12: error: expected ';' before 'char'
 2255 |   sep = "$"
      |            ^
      |            ;
......
 2262 |   char *an;
      |   ~~~~

2020-01-18  Jakub Jelinek  <jakub@redhat.com>

	* coroutines.cc (get_fn_local_identifier): Fix NO_DOT_IN_LABEL
	but non-NO_DOLLAR_IN_LABEL case build.
2020-01-18 19:22:21 +01:00
Hans-Peter Nilsson
463f649944 libgcc: cris: config/cris/arit.c (DS): Apply attribute __fallthrough__.
* config/cris/arit.c (DS): Apply attribute fallthrough.

Without this, there are, for each compilation of arit.c, 30ish
occurrences of "this statement may fall through
[-Wimplicit-fallthrough=]", for lines that look like
    case 32: DS; case 31: DS; case 30: DS; case 29: DS;
2020-01-18 16:38:56 +01:00
John David Anglin
84479e3a4c Fix compilation of crtstuff.c when DEFAULT_USE_CXA_ATEXIT is false
PR libgcc/92988
	* crtstuff.c (__do_global_dtors_aux): Only call __cxa_finalize if
	DEFAULT_USE_CXA_ATEXIT is true.
2020-01-18 10:30:29 -05:00
Tamar Christina
93bb79abfc AArch64: Fix unused variable warning breaking bootstrap.
This marks the parameter &fi as unused so it doesn't
cause a boostrap failure.

committed under the obvious rule.

gcc/ChangeLog:

	* config/aarch64/aarch64-sve-builtins-base.cc (memory_vector_mode):
	Mark parameter unused.
2020-01-18 14:04:58 +00:00