Commit graph

174272 commits

Author SHA1 Message Date
Marek Polacek
15ed55eabb PR c++/93324 - ICE with -Wall on constexpr if.
This is a crash with constexpr if, when trying to see if the call in
the if-statement is std::is_constant_evaluated.

cp_get_callee_fndecl_nofold can return NULL_TREE and fndecl_built_in_p
doesn't expect to get a null tree, so check FNDECL first.
2020-01-22 11:44:13 -05:00
Patrick Palka
bf91504dc2 Fix a couple of memory leaks in the C++ frontend
The leak in get_mapped_args is due to auto_vec not properly supporting
destructible elements in that auto_vec's destructor doesn't call the
destructors of its elements.

gcc/cp/ChangeLog:

	* constraint.cc (get_mapped_args): Avoid using auto_vec
	as a vector element.  Release the vectors inside the lists
	vector.
	* parser.c (cp_literal_operator_id): Free the buffer.
2020-01-22 11:13:02 -05:00
Richard Sandiford
7c46e71d01 cfgexpand: Update partition size when merging variables
cfgexpand sorts variables by decreasing size, so when merging a later
variable into an earlier one, there's usually no need to update the
merged size.

But for poly_int sizes, the sort function just uses a lexicographical
comparison of the coefficients, so e.g. 2X+2 comes before 0X+32.
Which is bigger depends on the runtime value of X.

This patch therefore takes the upper bound of the two sizes, which
is conservatively correct for variable-length vectors and a no-op
on other targets.

It's probably a bad idea to merge fixed-length and variable-length
variables in practice, but that's really an optimisation decision.
I think we should have this patch as a correctness fix either way.

This is easiest to test using the ACLE, but in principle it could happen
for autovectorised code too, e.g. when using OpenMP vector variables.
It's therefore a regression from GCC 8.

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

gcc/
	* cfgexpand.c (union_stack_vars): Update the size.

gcc/testsuite/
	* gcc.target/aarch64/sve/acle/general/stack_vars_1.c: New test.
2020-01-22 14:33:19 +00:00
Martin Liska
7491c17fe0
Fix TOP N counter update.
PR tree-optimization/92924
	* libgcov-profiler.c (__gcov_topn_values_profiler_body): First
	try to find an existing value, then find an empty slot
	if not found.
2020-01-22 13:40:12 +01:00
Richard Sandiford
9c4fb56578 Skip gcc.target/aarch64/sve/tls_preserve* for emultls targets
These tests are supposed to be testing the tlsdesc handling and
so don't apply to emultls targets.

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

gcc/testsuite/
	* gcc.target/aarch64/sve/tls_preserve_1.c: Require tls_native.
	* gcc.target/aarch64/sve/tls_preserve_2.c: Likewise.
	* gcc.target/aarch64/sve/tls_preserve_3.c: Likewise.
2020-01-22 12:24:02 +00:00
Richard Sandiford
998faa15e9 Fix gcc.target/aarch64/sve/sel_3.c for big-endian targets
A pasto in this test meant that we needed extra reverse instructions
for big-endian targets.

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

gcc/testsuite/
	* gcc.target/aarch64/sve/sel_3.c (permute_vnx4sf): Take __SVFloat32_t
	rather than __SVFloat16_t
2020-01-22 12:24:01 +00:00
Richard Sandiford
cb17653866 Extend r279588 to g++.dg/ext/sve-sizeless-1.C
In r279588 I'd for some reason only patched g++.dg/ext/sve-sizeless-2.C,
even though g++.dg/ext/sve-sizeless-1.C has the same problem.

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

gcc/testsuite/
	* g++.dg/ext/sve-sizeless-1.C: Don't expect an error for alias
	templates.
2020-01-22 12:24:00 +00:00
Richard Biener
2b85c08822 tree-optimization/93381 fix integer offsetting in points-to analysis
We were incorrectly assuming a merge operation is conservative enough
for not explicitely handled operations but we also need to consider
offsetting within fields when field-sensitive analysis applies.

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

	PR tree-optimization/93381
	* tree-ssa-structalias.c (find_func_aliases): Assume offsetting
	throughout, handle all conversions the same.

	* gcc.dg/torture/pr93381.c: New testcase.
2020-01-22 12:38:12 +01:00
Jakub Jelinek
d80f0a8dc9 aarch64: Fix aarch64_expand_subvti constant handling [PR93335]
The two patterns that call aarch64_expand_subvti ensure that {low,high}_in1
is a register, while {low,high}_in2 can be a register or immediate.
subdi3_compare1_imm uses the aarch64_plus_immediate predicate for its last
two operands (the value and negated value), but aarch64_expand_subvti calls
it whenever low_in2 is a CONST_INT, which leads to ICEs during vregs pass,
as the emitted insn is not recognized as valid subdi3_compare1_imm.
The following patch fixes that by only using subdi3_compare1_imm if it is ok
to do so, and otherwise force the constant into register and use the
non-immediate version - subdi3_compare1.
Furthermore, previously the code was calling force_reg on high_in2 only if
low_in2 is CONST_INT, on the (reasonable) assumption is that only if low_in2
is a CONST_INT, high_in2 can be non-REG, but with the above changes even in
the else we might have CONST_INT and force_reg doesn't do anything if the
operand is already a REG, so this patch calls it unconditionally.

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

	PR target/93335
	* config/aarch64/aarch64.c (aarch64_expand_subvti): Only use
	gen_subdi3_compare1_imm if low_in2 satisfies aarch64_plus_immediate
	predicate, not whenever it is CONST_INT.  Otherwise, force_reg it.
	Call force_reg on high_in2 unconditionally.

	* gcc.c-torture/compile/pr93335.c: New test.
2020-01-22 12:28:16 +01:00
Martin Liska
5f32f9cf13
Smart relaxation of TOP N counter.
PR tree-optimization/92924
	* profile.c (compute_value_histograms): Divide
	all counter values.
	PR tree-optimization/92924
	* libgcov-driver.c (prune_topn_counter): New.
	(prune_counters): Likewise.
	(dump_one_gcov): Prune a run-time counter.
	* libgcov-profiler.c (__gcov_topn_values_profiler_body):
	For a known value, add GCOV_TOPN_VALUES to value.
	Otherwise, decrement all counters by one.
2020-01-22 12:08:11 +01:00
Richard Earnshaw
f96af171be contrib: script to create a new vendor branch
This script is intended to create a new vendor branch.  Doing so is
not completely obvious if you are not familiar with the upstream
structure, so this takes the pain out of getting it right.

It doesn't check out the branch locally, but does set everything up so
that, if you have push enabled for your vendor branches, then

  git push vendors/<vendor> <branch>

will work as expected.

Run the script as

  contrib/git-add-vendor-branch.sh <vendor>/<branch> <start-point>

the <vendor> space must have previously been set up in the way
git-fetch-vendor.sh expects.

    * git-add-vendor-branch.sh: New file.
2020-01-22 10:06:50 +00:00
Jakub Jelinek
c892d8f58f i386: Fix up -fdollars-in-identifiers with identifiers starting with $ in -masm=att [PR91298]
In AT&T syntax leading $ is special, so if we have identifiers that start
with dollar, we usually fail to assemble it (or assemble incorrectly).
As mentioned in the PR, what works is wrapping the identifiers inside of
parens, like:
	movl	$($a), %eax
	leaq	($a)(,%rdi,4), %rax
	movl	($a)(%rip), %eax
	movl	($a)+16(%rip), %eax
	.globl	$a
	.type	$a, @object
	.size	$a, 72
$a:
	.string	"$a"
	.quad	($a)
(this is x86_64 -fno-pic -O2).  In some places ($a) is not accepted,
like as .globl operand, in .type, .size, so the patch overrides
ASM_OUTPUT_SYMBOL_REF rather than e.g. ASM_OUTPUT_LABELREF.
I didn't want to duplicate what assemble_name is doing (following
transparent aliases), so split assemble_name into two parts; just
mere looking at the first character of a name before calling assemble_name
wouldn't be good enough, a transparent alias could lead from a name
not starting with $ to one starting with it and vice versa.

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

	PR target/91298
	* output.h (assemble_name_resolve): Declare.
	* varasm.c (assemble_name_resolve): New function.
	(assemble_name): Use it.
	* config/i386/i386.h (ASM_OUTPUT_SYMBOL_REF): Define.

	* gcc.target/i386/pr91298-1.c: New test.
	* gcc.target/i386/pr91298-2.c: New test.
2020-01-22 10:22:16 +01:00
Jakub Jelinek
44a9d801a7 openmp: Fix up !$omp target parallel handling
The PR93329 fix revealed we ICE on !$omp target parallel, this change fixes
that.

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

	* parse.c (parse_omp_structured_block): Handle ST_OMP_TARGET_PARALLEL.
	* trans-openmp.c (gfc_trans_omp_target)
	<case EXEC_OMP_TARGET_PARALLEL>: Call pushlevel first.

	* gfortran.dg/gomp/target-parallel1.f90: New test.
	* gfortran.dg/goacc/pr93329.f90: Enable commented out target parallel
	test.
2020-01-22 09:54:59 +01:00
Jakub Jelinek
a38979d9d7 openmp: Teach omp_code_to_statement about rest of OpenMP statements
The omp_code_to_statement function added with the initial OpenACC support
only handled small subset of the OpenMP statements, leading to ICE if
any other OpenMP directive appeared inside of OpenACC directive.

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

	PR fortran/93329
	* openmp.c (omp_code_to_statement): Handle remaining EXEC_OMP_*
	cases.

	* gfortran.dg/goacc/pr93329.f90: New test.
2020-01-22 09:50:53 +01:00
Ian Lance Taylor
5a8ea16592 libgo: update to Go1.14beta1
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/214297
2020-01-21 23:53:22 -08:00
JunMa
6ac6529e15 Add error check on return value of build_co_await
gcc/cp/ChangeLog
	* coroutines.cc (finish_co_await_expr): Add error check on return
	value of build_co_await.
	(finish_co_yield_expr): Ditto.
2020-01-22 14:36:13 +08:00
JunMa
c75199b716 Add error messages for missing methods of awaitable class
gcc/cp/ChangeLog
         * coroutines.cc (lookup_awaitable_member): Lookup an awaitable member.
         (lookup_promise_method): Emit diagnostic when get NULL_TREE back only.
         (build_co_await): Use lookup_awaitable_member instead of lookup_member.

gcc/testsuite/ChangeLog
         * g++.dg/coroutines/coro1-missing-await-method.C: New test.
2020-01-22 14:35:09 +08:00
Joseph Myers
1050283158 Update update_web_docs_svn references in sourcebuild.texi.
These needed updating after the replacement of update_web_docs_svn by
update_web_docs_git.

	* doc/sourcebuild.texi (Texinfo Manuals, Front End): Refer to
	update_web_docs_git instead of update_web_docs_svn.
2020-01-22 01:36:55 +00:00
Andrew Pinski
87ca615aa6 Fix target/93119 (aarch64): ICE with traditional TLS support on ILP32
The problem here was g:23b88fda665d2f995c was not a complete fix
for supporting tranditional TLS on ILP32.

So the problem here is a couple of things, first __tls_get_addr
call will return a C pointer value so we need to use ptr_mode
when we are creating the call.  Then we need to convert
back that register to the correct mode, either zero extending
it or just creating a move instruction.
Also symbol_ref can either be in SImode or DImode.  So we need to
allow both modes.

Built and tested on aarch64-linux-gnu with no regressions.
Also built a full toolchain (including glibc) defaulting to traditional
TLS that targets ilp32 and lp64.

ChangeLog:
PR target/93119
* config/aarch64/aarch64.md (tlsgd_small_<mode>): Have operand 0
as PTR mode. Have operand 1 as being modeless, it can be P mode.
(*tlsgd_small_<mode>): Likewise.
* config/aarch64/aarch64.c (aarch64_load_symref_appropriately)
<case SYMBOL_SMALL_TLSGD>: Call gen_tlsgd_small_* with a ptr_mode
register.  Convert that register back to dest using convert_mode.
2020-01-22 01:31:54 +00:00
Joseph Myers
ac68e287fc Fix ICE with cast of division by zero (PR c/93348).
Bug 93348 reports an ICE on certain cases of casts of expressions that
may appear only in unevaluated parts of integer constant expressions,
arising from the generation of nested C_MAYBE_CONST_EXPRs.  This patch
fixes it by adding a call to remove_c_maybe_const_expr in the
integer-operands case, as is done in other similar cases.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

	PR c/93348
gcc/c:
	* c-typeck.c (build_c_cast): Call remove_c_maybe_const_expr on
	argument with integer operands.

gcc/testsuite:
	* gcc.c-torture/compile/pr93348-1.c: New test.
2020-01-22 01:23:42 +00:00
GCC Administrator
4e9b9a6cb5 Daily bump. 2020-01-22 00:16:34 +00:00
David Malcolm
4f01e57786 analyzer: fix qsort issue with array_region keys (PR 93352)
PR analyzer/93352 reports a qsort failure
  "comparator not anti-symmetric: -2147483648, -2147483648)"
within the analyzer on code involving an array access of [0x7fffffff + 1].

The issue is that array_region (which uses int for keys into known
values in the array) uses subtraction to implement int_cmp for sorting
the keys, which isn't going to work for boundary values.

Potentially a wider type should be used, but for now this patch fixes
the ICE by using explicit comparisons rather than subtraction to
implement the qsort callback.

gcc/analyzer/ChangeLog:
	PR analyzer/93352
	* region-model.cc (int_cmp): Rename to...
	(array_region::key_cmp): ...this, using key_t rather than int.
	Rewrite in terms of comparisons rather than subtraction to
	ensure qsort is anti-symmetric when handling extreme values.
	(array_region::walk_for_canonicalization): Update for above
	renaming.
	* region-model.h (array_region::key_cmp): New decl.

gcc/testsuite/ChangeLog:
	PR analyzer/93352
	* gcc.dg/analyzer/pr93352.c: New test.
2020-01-21 18:58:31 -05:00
Jason Merrill
c77074d056 PR c++/40752 - useless -Wconversion with short +=.
This is a longstanding issue with lots of duplicates; people are not
interested in a -Wconversion warning about mychar += 1.  So now that warning
depends on -Warith-conversion; otherwise we only warn if operands of the
arithmetic have conversion issues.

	* c.opt (-Warith-conversion): New.
	* c-warn.c (conversion_warning): Recurse for operands of
	operators.  Only warn about the whole expression with
	-Warith-conversion.
2020-01-21 18:40:19 -05:00
Jason Merrill
731dbfc3f3 Handle -Wsign-conversion in conversion_warning.
It seemed strange to me to warn about sign conversion in
unsafe_conversion_p, when other warnings are in conversion_warning, and the
latter function is the only place that asks the former function to warn.
This change is also necessary for my -Warith-conversion patch.

	* c-common.c (unsafe_conversion_p): Don't warn, return UNSAFE_SIGN.
	* c-warn.c (conversion_warning): Warn about UNSAFE_SIGN.
2020-01-21 18:40:19 -05:00
Jim Wilson
0501b74264 RISC-V: Fix rtl checking enabled failure with -msave-restore.
Found with an rtl checking enabled build and check.  This triggered failures
in the gcc.target/riscv/save-restore* tests.  We are using XINT to access an
XWINT value; INTVAL is the preferred solution.

	gcc/
	* config/riscv/riscv-sr.c (riscv_sr_match_prologue): Use INTVAL
	instead of XINT.
2020-01-21 15:20:19 -08:00
Hans-Peter Nilsson
95a5c0336e More uses of effective-target march_option for cris
* gcc.target/cris/asm-v8.S, gcc.target/cris/inasm-v8.c,
	gcc.target/cris/sync-1.c: Apply effective_target_march_option.

Oops.  A few stragglers, same as recent update: differing
-march=... options is an error, noticed with e.g.
"make check RUNTESTFLAGS=--target_board=cris-sim/arch=v10"
2020-01-22 00:09:14 +01:00
H.J. Lu
8e0efc1033 i386: Do GNU2 TLS address computation in ptr_mode
Since GNU2 TLS address from glibc run-time is in ptr_mode, we should do
GNU2 TLS address computation in ptr_mode and zero-extend result to Pmode.

gcc/

	PR target/93319
	* config/i386/i386.c (ix86_tls_module_base): Replace Pmode
	with ptr_mode.
	(legitimize_tls_address): Do GNU2 TLS address computation in
	ptr_mode and zero-extend result to Pmode.
	*  config/i386/i386.md (@tls_dynamic_gnu2_64_<mode>): Replace
	:P with :PTR and Pmode with ptr_mode.
	(*tls_dynamic_gnu2_lea_64_<mode>): Likewise.
	(*tls_dynamic_gnu2_call_64_<mode>): Likewise.
	(*tls_dynamic_gnu2_combine_64_<mode>): Likewise.

gcc/testsuite/

	PR target/93319
	* gcc.target/i386/pr93319-1a.c: Don't include <stdio.h>.
	(test1): Replace printf with __builtin_printf.
2020-01-21 14:10:02 -08:00
Jason Merrill
ad09440a09 PR c++/60855 - ICE with sizeof VLA capture.
For normal captures we usually look through them within unevaluated context,
but that doesn't work here; trying to take the sizeof of the array in the
enclosing scope tries and fails to evaluate a SAVE_EXPR from the enclosing
scope.

	* lambda.c (is_lambda_ignored_entity): Don't look past VLA capture.
2020-01-21 16:42:10 -05:00
Jason Merrill
276265195a PR c++/90732 - ICE with VLA capture and generic lambda.
We were failing to handle VLA capture in tsubst_lambda_expr; initially
building a DECLTYPE_TYPE for the capture and then tsubsting it doesn't give
the special VLA handling.  So with this patch we call add_capture again for
VLAs.

	* pt.c (tsubst_lambda_expr): Repeat add_capture for VLAs.
2020-01-21 16:42:10 -05:00
Iain Sandoe
a312c80194 [coro] Fix co_await of void type.
gcc/cp
2020-01-21  Iain Sandoe  <iain@sandoe.co.uk>
    Bin Cheng  <bin.cheng@linux.alibaba.com>

* coroutines.cc (coro_promise_type_found_p): Check for NULL return
from complete_type_or_else.
(register_param_uses): Likewise.
(build_co_await): Do not try to use complete_type_or_else for void
types, otherwise for incomplete types, check for NULL return from
complete_type_or_else.

gcc/testsuite
2020-01-21  Bin Cheng  <bin.linux@linux.alibaba.com>

* g++.dg/coroutines/co-await-void_type.C: New test.
2020-01-21 20:57:30 +00:00
Jakub Jelinek
bd0a3e244d riscv: Fix up riscv_rtx_costs for RTL checking (PR target/93333)
As mentioned in the PR, during combine rtx_costs can be called sometimes
even on RTL that has not been validated yet and so can contain even operands
that aren't valid in any instruction.

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

	PR target/93333
	* config/riscv/riscv.c (riscv_rtx_costs) <case ZERO_EXTRACT>: Verify
	the last two operands are CONST_INT_P before using them as such.

	* gcc.c-torture/compile/pr93333.c: New test.
2020-01-21 21:43:03 +01:00
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