Commit Graph

186369 Commits

Author SHA1 Message Date
Iain Sandoe
cc8453012f Darwin: Define a suitable section name for CTF [PR101283]
This is a placeholder name ahead of any CTF implementation on
LLVM (which sets Darwin ABI).  Ideally, we would get agreement
on this choice (or any replacement) before GCC12 is shipped.

PR debug/101283 - Several tests fail on Darwin with -gctf

	PR debug/101283

gcc/ChangeLog:

	* config/darwin.h (CTF_INFO_SECTION_NAME): New.
2021-07-01 16:56:13 +01:00
H.J. Lu
51c30227fa x86: Add vec_duplicate<mode> expander
Add vec_duplicate<mode> expander for SSE2 if we can move from GPR to SSE
register directly.

	* config/i386/i386-expand.c (ix86_expand_vector_init_duplicate):
	Make it global.
	* config/i386/i386-protos.h (ix86_expand_vector_init_duplicate):
	New prototype.
	* config/i386/sse.md (INT_BROADCAST_MODE): New mode iterator.
	(vec_duplicate<mode>): New expander.
2021-07-01 08:11:20 -07:00
H.J. Lu
edafb35bda x86: Convert CONST_WIDE_INT/CONST_VECTOR to broadcast
1. Update move expanders to convert the CONST_WIDE_INT and CONST_VECTOR
operands to vector broadcast from an integer with AVX.
2. Add ix86_gen_scratch_sse_rtx to return a scratch SSE register which
won't increase stack alignment requirement and blocks transformation by
the combine pass.

A small benchmark:

https://gitlab.com/x86-benchmarks/microbenchmark/-/tree/memset/broadcast

shows that broadcast is a little bit faster on Intel Core i7-8559U:

$ make
gcc -g -I. -O2   -c -o test.o test.c
gcc -g   -c -o memory.o memory.S
gcc -g   -c -o broadcast.o broadcast.S
gcc -g   -c -o vec_dup_sse2.o vec_dup_sse2.S
gcc -o test test.o memory.o broadcast.o vec_dup_sse2.o
./test
memory      : 147215
broadcast   : 121213
vec_dup_sse2: 171366
$

broadcast is also smaller:

$ size memory.o broadcast.o
   text	   data	    bss	    dec	    hex	filename
    132	      0	      0	    132	     84	memory.o
    122	      0	      0	    122	     7a	broadcast.o
$

3. Update PR 87767 tests to expect integer broadcast instead of broadcast
from memory.
4. Update avx512f_cond_move.c to expect integer broadcast.

A small benchmark:

https://gitlab.com/x86-benchmarks/microbenchmark/-/tree/vpaddd/broadcast

shows that integer broadcast is faster than embedded memory broadcast:

$ make
gcc -g -I. -O2 -march=skylake-avx512   -c -o test.o test.c
gcc -g   -c -o memory.o memory.S
gcc -g   -c -o broadcast.o broadcast.S
gcc -o test test.o memory.o broadcast.o
./test
memory      : 425538
broadcast   : 375260
$

gcc/

	PR target/100865
	* config/i386/i386-expand.c (ix86_expand_vector_init_duplicate):
	New prototype.
	(ix86_byte_broadcast): New function.
	(ix86_convert_const_wide_int_to_broadcast): Likewise.
	(ix86_expand_move): Convert CONST_WIDE_INT to broadcast if mode
	size is 16 bytes or bigger.
	(ix86_broadcast_from_integer_constant): New function.
	(ix86_expand_vector_move): Convert CONST_WIDE_INT and CONST_VECTOR
	to broadcast if mode size is 16 bytes or bigger.
	* config/i386/i386-protos.h (ix86_gen_scratch_sse_rtx): New
	prototype.
	* config/i386/i386.c (ix86_gen_scratch_sse_rtx): New function.

gcc/testsuite/

	PR target/100865
	* gcc.target/i386/avx512f-broadcast-pr87767-1.c: Expect integer
	broadcast.
	* gcc.target/i386/avx512f-broadcast-pr87767-5.c: Likewise.
	* gcc.target/i386/avx512vl-broadcast-pr87767-1.c: Likewise.
	* gcc.target/i386/avx512vl-broadcast-pr87767-5.c: Likewise.
	* gcc.target/i386/avx512f_cond_move.c: Also pass
	-mprefer-vector-width=512 and expect integer broadcast.
	* gcc.target/i386/pr100865-1.c: New test.
	* gcc.target/i386/pr100865-2.c: Likewise.
	* gcc.target/i386/pr100865-3.c: Likewise.
	* gcc.target/i386/pr100865-4a.c: Likewise.
	* gcc.target/i386/pr100865-4b.c: Likewise.
	* gcc.target/i386/pr100865-5a.c: Likewise.
	* gcc.target/i386/pr100865-5b.c: Likewise.
	* gcc.target/i386/pr100865-6a.c: Likewise.
	* gcc.target/i386/pr100865-6b.c: Likewise.
	* gcc.target/i386/pr100865-6c.c: Likewise.
	* gcc.target/i386/pr100865-7a.c: Likewise.
	* gcc.target/i386/pr100865-7b.c: Likewise.
	* gcc.target/i386/pr100865-7c.c: Likewise.
	* gcc.target/i386/pr100865-8a.c: Likewise.
	* gcc.target/i386/pr100865-8b.c: Likewise.
	* gcc.target/i386/pr100865-8c.c: Likewise.
	* gcc.target/i386/pr100865-9a.c: Likewise.
	* gcc.target/i386/pr100865-9b.c: Likewise.
	* gcc.target/i386/pr100865-9c.c: Likewise.
	* gcc.target/i386/pr100865-10a.c: Likewise.
	* gcc.target/i386/pr100865-10b.c: Likewise.
	* gcc.target/i386/pr100865-11a.c: Likewise.
	* gcc.target/i386/pr100865-11b.c: Likewise.
	* gcc.target/i386/pr100865-11c.c: Likewise.
	* gcc.target/i386/pr100865-12a.c: Likewise.
	* gcc.target/i386/pr100865-12b.c: Likewise.
	* gcc.target/i386/pr100865-12c.c: Likewise.
2021-07-01 08:11:20 -07:00
Uros Bizjak
d63454815d i386: Return true/false instead of 1/0 from predicates.
No functional changes.

2021-07-01  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
	* config/i386/predicates.md (ix86_endbr_immediate_operand):
	Return true/false instead of 1/0.
	(movq_parallel): Ditto.
2021-07-01 16:57:57 +02:00
Uros Bizjak
cfeffe9c46 Return true/false instead of 1/0 from generic predicates.
No functional changes.

2021-07-01  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
	* recog.c (general_operand): Return true/false instead of 1/0.
	(register_operand): Ditto.
	(immediate_operand): Ditto.
	(const_int_operand): Ditto.
	(const_scalar_int_operand): Ditto.
	(const_double_operand): Ditto.
	(push_operand): Ditto.
	(pop_operand): Ditto.
	(memory_operand): Ditto.
	(indirect_operand): Ditto.
2021-07-01 16:52:11 +02:00
Uros Bizjak
a86b3453fc Change the type of predicates to bool.
The patch was tested on many targets, but some fallout is expected.
To fix the build error, simply change the function type from int to bool,
as was done in the patch for several targets.

2021-07-01  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
	* genpreds.c (write_predicate_subfunction):
	Change the type of written subfunction to bool.
	(write_one_predicate_function):
	Change the type of written function to bool.
	(write_tm_preds_h): Ditto.
	* recog.h (*insn_operand_predicate_fn): Change the type to bool.
	* recog.c (general_operand): Change the type to bool.
	(address_operand): Ditto.
	(register_operand): Ditto.
	(pmode_register_operand): Ditto.
	(scratch_operand): Ditto.
	(immediate_operand): Ditto.
	(const_int_operand): Ditto.
	(const_scalar_int_operand): Ditto.
	(const_double_operand): Ditto.
	(nonimmediate_operand): Ditto.
	(nonmemory_operand): Ditto.
	(push_operand): Ditto.
	(pop_operand): Ditto.
	(memory_operand): Ditto.
	(indirect_operand): Ditto.
	(ordered_comparison_operator): Ditto.
	(comparison_operator): Ditto.

	* config/i386/i386-expand.c (ix86_expand_sse_cmp):
	Change the type of indirect predicate function to bool.

	* config/rs6000/rs6000.c (easy_vector_constant):
	Change the type to bool.

	* config/mips/mips-protos.h (m16_based_address_p):
	Change the type of operand 3 to bool.
2021-07-01 15:19:28 +02:00
Richard Biener
0a77c07b9b tree-optimization/101280 - revise interchange fix for PR101173
The following revises the original fix for PR101173 to correctly
check for a reversed dependence rather than disallowing a zero
distance.  It also adds a check from TSVC which asks for this
kind of interchange (but with a valid dependence).

2021-07-01  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/101280
	PR tree-optimization/101173
	* gimple-loop-interchange.cc
	(tree_loop_interchange::valid_data_dependences): Revert
	previous change and instead correctly handle DDR_REVERSED_P
	dependence.

	* gcc.dg/tree-ssa/loop-interchange-16.c: New testcase.
2021-07-01 13:38:59 +02:00
Ankur Saini
09a7b00ac3 MAINTAINERS - Add myself for write after approval
2021-07-01  Ankur Saini  <arsenic@sourceware.org>

	* MAINTAINERS: Add myself for write after approval.
2021-07-01 16:43:24 +05:30
Richard Biener
4a87605938 tree-optimization/101278 - handle self-use in DSE analysis
DSE store classification short-cuts the to-be classified stmt itself
from chaining but fails to first check whether the store uses itself
which can be the case when it is a call with the LHS also passed by
value as argument.

2021-07-01  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/101278
	* tree-ssa-dse.c (dse_classify_store): First check for
	uses, then ignore stmt for chaining purposes.

	* gcc.dg/torture/pr101278.c: New testcase.
2021-07-01 12:31:21 +02:00
Richard Biener
a3aaba6840 tree-optimization/100778 - fix placement of trapping vectorized ops
This avoids placing possibly trapping vectorized operations where
the corresponding scalar operation was possibly not executed.

2021-01-07  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/100778
	* tree-vect-slp.c (vect_schedule_slp_node): Do not place trapping
	vectorized ops ahead of their scalar BB.

	* gcc.dg/torture/pr100778.c: New testcase.
2021-07-01 12:31:21 +02:00
Uros Bizjak
9f6aeb85ee i386: Add integer nabs instructions [PR101044]
The patch adds integer nabs "(NEG (ABS (...)))" instructions, adds STV
conversion and adjusts STV cost calculations accordingly.  When CMOV
instruction is used to implement abs, the sign is determined from the
preceeding operand negation, and CMOVS is used to select between
negated and non-negated value.

To implement nabs, just reverse the condition and emit CMOVNS instead.

The STV costs are adjusted for inherent NOT of nabs insn. V2DI NOT is
somehow costly operation, since it is implemented as a load of zero,
followed by a SUB insn. OTOH, integer nabs with inherent NOT is relatively
cheap, so some STV chains became less profitable for conversion.

The patch rewrites operand scanner in compute_convert_gain to a switch
and reorders case instances in general_scalar_to_vector_candidate_p
to benefit from fallthroughs, and to remove special processing of
andnot in the later case.

gcc/

2021-07-01  Uroš Bizjak  <ubizjak@gmail.com>

	PR target/101044
	* config/i386/i386.md (*nabs<dwi>2_doubleword):
	New insn_and_split pattern.
	(*nabs<dwi>2_1): Ditto.
	* config/i386/i386-features.c
	(general_scalar_chain::compute_convert_gain):
	Handle (NEG (ABS (...))) RTX.  Rewrite src code
	scanner as switch statement.
	(general_scalar_chain::convert_insn):
	Handle (NEG (ABS (...))) RTX.
	(general_scalar_to_vector_candidate_p):
	Detect  (NEG (ABS (...))) RTX.  Reorder case statements
	for (AND (NOT (...) ...)) fallthrough.

gcc/testsuite/

2021-07-01  Uroš Bizjak  <ubizjak@gmail.com>

	PR target/101044
	* gcc.target/i386/pr101044.c: New test.
2021-07-01 11:19:28 +02:00
Richard Biener
7d8211603a tree-optimization/101178 - handle VEC_PERM in SLP permute propagation
This adds handling of VEC_PERM nodes to SLP permute propagation.
Previously VEC_PERM acted as forced materialization of incoming
permutes since it is a good place to do that (with the constraint
of those only appearing for two-operator nodes).  The following
patch, in addition to supporting (but not forcing) this, enables
VEC_PERM nodes acting as "any" permute on the outgoing side since
they also can consume arbitrary permutes on that side.

This again (meh) changes how we represent permutes and materialization
on the graph vertices now explicitely having the common incoming
permute as well as an outgoing permute and in case both are
different the vertex acts as materialization point of the incoming
permute.

2021-06-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/101178
	* tree-vect-slp.c (slpg_vertex::materialize): Remove.
	(slpg::perm_in): Add.
	(slpg::get_perm_in): Remove.
	(slpg::get_perm_materialized): Add.
	(vect_optimize_slp): Handle VEC_PERM nodes more optimally
	during permute propagation and materialization.

	* gcc.dg/vect/bb-slp-72.c: New testcase.
	* gcc.dg/vect/bb-slp-73.c: Likewise.
	* gcc.dg/vect/bb-slp-74.c: Likewise.
2021-07-01 09:47:58 +02:00
Jakub Jelinek
b0ab968999 dwarf2out: Handle COMPOUND_LITERAL_EXPR in loc_list_from_tree_1 [PR101266]
In this case dwarf2out_decl is called from the FEs with GENERIC but not
yet gimplified expressions in it.

As loc_list_from_tree_1 has an exhaustive list of tree codes it wants to
handle and for checking asserts no other codes makes it in, we should
handle even GENERIC trees that shouldn't be valid in GIMPLE.

The following patch handles COMPOUND_LITERAL_EXPR by hnadling it like the
underlying VAR_DECL temporary.

Verified the emitted DWARF is correct (but unoptimized, we emit
DW_OP_lit1 DW_OP_lit1 DW_OP_minus for the upper bound).

2021-07-01  Jakub Jelinek  <jakub@redhat.com>

	PR debug/101266
	* dwarf2out.c (loc_list_from_tree_1): Handle COMPOUND_LITERAL_EXPR.

	* gcc.dg/pr101266.c: New test.
2021-07-01 09:45:02 +02:00
Jakub Jelinek
91c771ec8a openmp - Fix up && and || reductions [PR94366]
As the testcase shows, the special treatment of && and || reduction combiners
where we expand them as omp_out = (omp_out != 0) && (omp_in != 0) (or with ||)
is not needed just for &&/|| on floating point or complex types, but for all
&&/|| reductions - when expanded as omp_out = omp_out && omp_in (not in C but
GENERIC) it is actually gimplified into NOP_EXPRs to bool from both operands,
which turns non-zero values multiple of 2 into 0 rather than 1.

This patch just treats all &&/|| the same and furthermore uses bool type
instead of int for the comparisons.

2021-07-01  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/94366
gcc/
	* omp-low.c (lower_rec_input_clauses): Rename is_fp_and_or to
	is_truth_op, set it for TRUTH_*IF_EXPR regardless of new_var's type,
	use boolean_type_node instead of integer_type_node as NE_EXPR type.
	(lower_reduction_clauses): Likewise.
libgomp/
	* testsuite/libgomp.c-c++-common/pr94366.c: New test.
2021-07-01 08:55:49 +02:00
Patrick Palka
a688c284dd c++: cxx_eval_array_reference and empty elem type [PR101194]
Here the initializer for x is represented as an empty CONSTRUCTOR due to
its empty element type.  So during constexpr evaluation of the ARRAY_REF
x[0], we end up trying to value initialize the omitted element at index 0,
which fails because the element type is not default constructible.

This patch makes cxx_eval_array_reference specifically handle the case
where the element type is an empty type.

	PR c++/101194

gcc/cp/ChangeLog:

	* constexpr.c (cxx_eval_array_reference): When the element type
	is an empty type and the corresponding element is omitted, just
	return an empty CONSTRUCTOR instead of attempting value
	initialization.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/constexpr-empty16.C: New test.
2021-06-30 20:44:52 -04:00
Patrick Palka
613497aa6e c++: Extend the PR96204 fix to variable templates too
r12-1829 corrected the access scope during partial specialization
matching of class templates, but overlooked the variable template case.
This patch moves the access scope adjustment to within
most_specialized_partial_spec so that all callers can benefit.

This patch also adjusts a couple of these callers to avoid always
passing the most general template of a variable template specialization,
since that'd cause us to push the wrong access scope for e.g. the second
testcase below (we'd push A<T> instead of A<int>/A<char>).  We ought to
be passing the partially instantiated template instead.

	PR c++/96204

gcc/cp/ChangeLog:

	* pt.c (finish_template_variable): Pass the partially
	instantiated template and its args to instantiate_template.
	(instantiate_class_template_1): No need to call
	push_nested_class and pop_nested_class around the call to
	most_specialized_partial_spec.
	(instantiate_template_1): Pass the partially instantiated
	template to lookup_template_variable.
	(most_specialized_partial_spec):  Use push_access_scope_guard
	to set the access scope appropriately.  Use
	deferring_access_check_sentinel to force access to get checked
	immediately.
	(instantiate_decl): Just pass the VAR_DECL to
	most_specialized_partial_spec.

gcc/testsuite/ChangeLog:

	* g++.dg/template/access41.C: New test.
	* g++.dg/template/access41a.C: New test.
2021-06-30 20:21:16 -04:00
GCC Administrator
25b6bfea5f Daily bump. 2021-07-01 00:16:41 +00:00
Jonathan Wakely
6963c3b9ed libstdc++: Improve Doxygen documentation groups [PR 101258]
This defines some new Doxygen groups for C++17 variable templates and
for the contents of <experimental/type_traits>. By documenting the group
as a whole and adding each template to a group we don't need to document
them individually.

Also mark more internals with "@cond undocumented" so that Doxygen
ignores them by default. Also make Doxygen process <experimental/simd>.

For some reason, many of the class templates in <type_traits> do not
appear in the "Metaprogramming" group. For example, add_cv,
remove_extent, and all the is_xxx_constructible and is_xxx_assignable
traits. For some reason, Doxygen doesn't include them in the group,
despite doing it correctly for other traits in the same header.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	PR libstdc++/101258
	* doc/doxygen/user.cfg.in (INPUT): Add <experimental/simd>.
	(COLS_IN_ALPHA_INDEX): Remove obsolete tag.
	(PREDEFINED): Add/fix some more macros that need to be expanded.
	* include/bits/random.h: Stop Doxygen from documenting internal
	implementation details.
	* include/bits/random.tcc: Likewise.
	* include/bits/this_thread_sleep.h: Fix @file name.
	* include/experimental/bits/simd.h: Add to Doxygen group. Do not
	document internal implementation details.
	* include/experimental/bits/simd_detail.h: Do not document
	internal implementation details.
	* include/experimental/simd: Define Doxygen groups.
	* include/experimental/type_traits: Improve documentation for
	the header file. Define groups. Use @since commands.
	* include/std/scoped_allocator (scoped_allocator_adaptor): Move
	declaration before undocumented region.
	* include/std/type_traits (true_type, false_type): Use using
	declaration instead of typedef.
	(is_invocable_v, is_nothrow_invocable_v, is_invocable_r_v)
	(is_nothrow_invocable_r_v): Move definitions next to other C++17
	variable templates.
	Do not document internal implementation details. Move misplaced
	group-end command. Define group for variable templates.
	* include/std/variant: Do not document internal implementation
	details.
	* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error
	line number.
2021-07-01 00:25:46 +01:00
Jonathan Wakely
36adced3b6 libstdc++: Make <experimental/simd> depend on C++17
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* include/experimental/simd: Do not define anything pre-C++17.
2021-07-01 00:15:43 +01:00
Jonathan Wakely
996be6b670 libstdc++: Suppress redundant definitions of static members in <random>
Since C++17 the static members of the random number engines are
implicitly inline, so don't need definitions.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* include/bits/random.tcc [__cpp_inline_variables]: Remove
	redundant definitions of static constexpr member variables.
	* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error
	line number.
2021-07-01 00:15:29 +01:00
Indu Bhagat
aa31ae6970 testsuite: Add missing dg-add-options to CTF testcase ctf-skip-types-4.c
The test already has the appropriate dg-require-effective-target, but requires
the dg-add-options to use the flags needed, if any. This patch fixes the
failure of this testcase on powerpc64.

2021-06-30  Indu Bhagat  <indu.bhagat@oracle.com>

	gcc/testsuite/
	* gcc.dg/debug/ctf/ctf-skip-types-4.c: Add dg-add-options float64 and
	float64x.
2021-06-30 15:13:50 -07:00
Gerald Pfeifer
13eaeffde5 libiberty: No longer use /usr/tmp
/usr/tmp is antiquated and not present on decently modern systems.
Remove it from consideration when choosing a directory for temporary
files.

libiberty:

2021-06-29  Gerald Pfeifer  <gerald@pfeifer.com>

	* make-temp-file.c (usrtmp): Remove.
	(choose_tmpdir): Remove use of usrtmp.
2021-07-01 00:00:26 +02:00
Michael Meissner
730d021e3e Fix IEEE 128-bit min/max test.
This patch fixes the float128-minmax.c test so that it can accommodate the
generation of xsmincqp and xsmaxcqp instructions on power10.  I changed the
effective target from 'float128' to 'ppc_float128_hw', since this needs the
IEEE 128-bit float hardware support.  Changing to use 'ppc_float128_hw' allows
the 'lp64' test to be dropped.  The 'lp64' test originally was needed because
big endian 32-bit code cannot enable the IEEE 128-bit floating point
instructions.

gcc/testsuite/
2021-06-30  Michael Meissner  <meissner@linux.ibm.com>

	* gcc.target/powerpc/float128-minmax.c: Adjust expected code for
	power10.
	* lib/target-supports.exp (check_effective_target_has_arch_pwr10):
	New.
2021-06-30 14:54:48 -04:00
Patrick Palka
c28e1d288a c++: Fix push_access_scope and introduce RAII wrapper for it
When push_access_scope is passed a TYPE_DECL for a class type (which
can happen during e.g. satisfaction), we undesirably push only the
enclosing context of the class instead of the class itself.  This
causes us to mishandle e.g. testcase below due to us not entering the
scope of A before checking its constraints.

This patch adjusts push_access_scope accordingly, and introduces an
RAII wrapper for it.  We make use of this wrapper right away by
replacing the only user of push_nested_class_guard with this new
wrapper, which means we can remove push_nested_class_guard (whose
functionality is basically subsumed by the new wrapper).

gcc/cp/ChangeLog:

	* constraint.cc (get_normalized_constraints_from_decl): Use
	push_access_scope_guard instead of push_nested_class_guard.
	* cp-tree.h (struct push_nested_class_guard): Replace with ...
	(struct push_access_scope_guard): ... this.
	* pt.c (push_access_scope): When the argument corresponds to
	a class type, push the class instead of its context.
	(pop_access_scope): Adjust accordingly.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/concepts-access2.C: New test.
2021-06-30 13:12:36 -04:00
Hafiz Abid Qadeer
b5bb7f328d [amdgcn] Add hook for DWARF address spaces.
Map GCN address spaces to the proposed DWARF address spaces defined by AMD at
https://llvm.org/docs/AMDGPUUsage.html#amdgpu-dwarf-address-class-mapping-table

gcc/

	* config/gcn/gcn.c: Include dwarf2.h.
	(gcn_addr_space_debug): New function.
	(TARGET_ADDR_SPACE_DEBUG): New hook.
2021-06-30 17:51:17 +01:00
Hafiz Abid Qadeer
22f201e4b3 [amdgcn] Use frame pointer for CFA expressions.
As size of address is bigger than registers in amdgcn, we are forced to use
DW_CFA_def_cfa_expression to make an expression that concatenates multiple
registers for the value of the CFA.  This then prohibits us from using many
of the dwarf ops which expect CFA rule to be a single regsiter plus an offset.
Using frame pointer in the CFA rule is only real possibility as it is saved
in every frame and it is easy to unwind its value.

So unless user gives fomit-frame-pointer, we use frame pointer for the
cfi information.  This options also has a different default now.

gcc/

	* common/config/gcn/gcn-common.c
	(gcn_option_optimization_table): Change OPT_fomit_frame_pointer to -O3.
	* config/gcn/gcn.c (gcn_expand_prologue): Prefer the frame pointer
	when emitting CFI.
	(gcn_expand_prologue): Prefer the frame pointer when emitting CFI.
	(gcn_frame_pointer_rqd): New function.
	(TARGET_FRAME_POINTER_REQUIRED): New hook.
2021-06-30 17:48:30 +01:00
Hafiz Abid Qadeer
251697a64b [amdgcn] Update CFI configuration
Currently we don't get any call frame information for the amdgcn target.
This patch makes necessary adjustments to generate CFI that can work with
ROCGDB (ROCm 3.8+).

gcc/

	* config/gcn/gcn.c (move_callee_saved_registers): Emit CFI notes for
	prologue register saves.
	(gcn_debug_unwind_info): Use UI_DWARF2.
	(gcn_dwarf_register_number): Map DWARF_LINK_REGISTER to DWARF PC.
	(gcn_dwarf_register_span): DWARF_LINK_REGISTER doesn't span.
	* config/gcn/gcn.h: (DWARF_FRAME_RETURN_COLUMN): New define.
	(DWARF_LINK_REGISTER): New define.
	(FIRST_PSEUDO_REGISTER): Increment.
	(FIXED_REGISTERS): Add entry for DWARF_LINK_REGISTER.
	(CALL_USED_REGISTERS): Likewise.
	(REGISTER_NAMES): Likewise.
2021-06-30 17:48:22 +01:00
Marek Polacek
e66d0b7b87 c++: DR2397 - auto specifier for * and & to arrays [PR100975]
This patch implements DR2397, which removes the restriction in
[dcl.array]p4 that the array element type may not be a placeholder
type.  We don't need to worry about decltype(auto) here, so this
allows code like

  int a[3];
  auto (*p)[3] = &a;
  auto (&r)[3] = a;

However, note that

  auto (&&r)[2] = { 1, 2 };
  auto arr[2] = { 1, 2 };

still doesn't work (although one day it might) and neither does

  int arr[5];
  auto x[5] = arr;

given that auto deduction is performed in terms of function template
argument deduction, so the array decays to *.

	PR c++/100975
	DR 2397

gcc/cp/ChangeLog:

	* decl.c (create_array_type_for_decl): Allow array of auto.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/auto24.C: Remove dg-error.
	* g++.dg/cpp0x/auto3.C: Adjust dg-error.
	* g++.dg/cpp0x/auto42.C: Likewise.
	* g++.dg/cpp0x/initlist75.C: Likewise.
	* g++.dg/cpp0x/initlist80.C: Likewise.
	* g++.dg/diagnostic/auto1.C: Remove dg-error.
	* g++.dg/cpp23/auto-array.C: New test.
2021-06-30 12:11:17 -04:00
Richard Biener
a075350ee7 tree-optimization/101267 - fix SLP vect with masked operations
This fixes the missed handling of external/constant mask SLP
operations, for the testcase in particular masked loads.  The
patch adjusts the vect_check_scalar_mask API to reflect the
required vect_is_simple_use SLP compatible API plus adjusts
for the special handling of masked loads in SLP discovery.

The issue is likely latent.

2021-06-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/101267
	* tree-vect-stmts.c (vect_check_scalar_mask): Adjust
	API and use SLP compatible interface of vect_is_simple_use.
	Reject not vectorized SLP defs for callers that do not support
	that.
	(vect_check_store_rhs): Handle masked stores and pass down
	the appropriate operator index.
	(vectorizable_call): Adjust.
	(vectorizable_store): Likewise.
	(vectorizable_load): Likewise.  Handle SLP pecularity of
	masked loads.
	(vect_is_simple_use): Remove special-casing of masked stores.

	* gfortran.dg/pr101267.f90: New testcase.
2021-06-30 16:40:12 +02:00
David Malcolm
e61ffa2014 analyzer: eliminate enum binding_key [PR95006]
I rewrote the way the analyzer's region_model tracks the state of memory
in GCC 11 (in 808f4dfeb3), which
introduced a store with a binding_map class, mapping binding keys to
symbolic values.

The GCC 11 implementation of binding keys has an enum binding_kind,
which can be "default" vs "direct"; the idea being that direct
bindings take priority over default bindings, where the latter could
be used to represent e.g. a zero-fill of a buffer, and the former
expresses those subregions that have since been touched.

This doesn't work well: it doesn't express the idea of filling
different subregions with different values, or a memset that only
touches part of a buffer, leading to numerous XFAILs in the memset
test cases (and elsewhere).

As preparatory work towards tracking uninitialized values, this patch
eliminates the enum binding_kind, so that all bindings have
equal weight; the order in which they happen is all that matters.
If a write happens which partially overwrites an existing binding,
the new code can partially overwrite a binding, potentially punching a
hole so that an existing binding is split into two parts.

The patch adds some new classes:
- a new "bits_within_svalue" symbolic value to support extracting
  parts of an existing value when its binding is partially clobbered
- a new "repeated_svalue" symbolic value to better express filling
  a region with repeated copies of a symbolic value (e.g. constant
  zero)
- a new "sized_region" region to express accessing a subregion
  with a symbolic size in bytes
and it rewrites e.g. how memset is implemented, so that we can precisely
track which bits in a region have not been touched.

That said, the patch doesn't actually implement "uninitialized" values;
I'm saving that for a followup.

gcc/analyzer/ChangeLog:
	PR analyzer/95006
	* analyzer.h (class repeated_svalue): New forward decl.
	(class bits_within_svalue): New forward decl.
	(class sized_region): New forward decl.
	(get_field_at_bit_offset): New forward decl.
	* engine.cc (exploded_graph::get_or_create_node): Validate the
	merged state.
	(exploded_graph::maybe_process_run_of_before_supernode_enodes):
	Validate the states at each stage.
	* program-state.cc (program_state::validate): Validate
	m_region_model.
	* region-model-impl-calls.cc (region_model::impl_call_memset):
	Replace special-case logic for handling constant sizes with
	a call to fill_region of a sized_region with the given fill value.
	* region-model-manager.cc (maybe_undo_optimize_bit_field_compare):
	Drop DK_direct.
	(region_model_manager::maybe_fold_sub_svalue):  Fold element-based
	subregions of an initial value into initial values of an element.
	Fold subvalues of repeated svalues.
	(region_model_manager::maybe_fold_repeated_svalue): New.
	(region_model_manager::get_or_create_repeated_svalue): New.
	(get_bit_range_for_field): New.
	(get_byte_range_for_field): New.
	(get_field_at_byte_range): New.
	(region_model_manager::maybe_fold_bits_within_svalue): New.
	(region_model_manager::get_or_create_bits_within): New.
	(region_model_manager::get_sized_region): New.
	(region_model_manager::log_stats): Update for addition of
	m_repeated_values_map, m_bits_within_values_map, and
	m_sized_regions.
	* region-model.cc (region_model::validate): New.
	(region_model::on_assignment): Drop enum binding_kind.
	(region_model::get_initial_value_for_global): Likewise.
	(region_model::get_rvalue_for_bits): Replace body with call to
	get_or_create_bits_within.
	(region_model::get_capacity): Handle RK_SIZED.
	(region_model::set_value): Drop enum binding_kind.
	(region_model::fill_region): New.
	(region_model::get_representative_path_var_1): Handle RK_SIZED.
	* region-model.h (visitor::visit_repeated_svalue): New.
	(visitor::visit_bits_within_svalue): New.
	(region_model_manager::get_or_create_repeated_svalue): New decl.
	(region_model_manager::get_or_create_bits_within): New decl.
	(region_model_manager::get_sized_region): New decl.
	(region_model_manager::maybe_fold_repeated_svalue): New decl.
	(region_model_manager::maybe_fold_bits_within_svalue): New decl.
	(region_model_manager::repeated_values_map_t): New typedef.
	(region_model_manager::m_repeated_values_map): New field.
	(region_model_manager::bits_within_values_map_t): New typedef.
	(region_model_manager::m_bits_within_values_map): New field.
	(region_model_manager::m_sized_regions): New field.
	(region_model::fill_region): New decl.
	* region.cc (region::get_base_region): Handle RK_SIZED.
	(region::base_region_p): Likewise.
	(region::get_byte_size_sval): New.
	(get_field_at_bit_offset): Make non-static.
	(region::calc_offset): Move implementation of cases to
	get_relative_concrete_offset vfunc implementations.  Handle
	RK_SIZED.
	(region::get_relative_concrete_offset): New.
	(decl_region::get_svalue_for_initializer): Drop enum binding_kind.
	(field_region::get_relative_concrete_offset): New, from
	region::calc_offset.
	(element_region::get_relative_concrete_offset): Likewise.
	(offset_region::get_relative_concrete_offset): Likewise.
	(sized_region::accept): New.
	(sized_region::dump_to_pp): New.
	(sized_region::get_byte_size): New.
	(sized_region::get_bit_size): New.
	* region.h (enum region_kind): Add RK_SIZED.
	(region::dyn_cast_sized_region): New.
	(region::get_byte_size): Make virtual.
	(region::get_bit_size): Likewise.
	(region::get_byte_size_sval): New decl.
	(region::get_relative_concrete_offset): New decl.
	(field_region::get_relative_concrete_offset): New decl.
	(element_region::get_relative_concrete_offset): Likewise.
	(offset_region::get_relative_concrete_offset): Likewise.
	(class sized_region): New.
	* store.cc (binding_kind_to_string): Delete.
	(binding_key::make): Drop enum binding_kind.
	(binding_key::dump_to_pp): Delete.
	(binding_key::cmp_ptrs): Drop enum binding_kind.
	(bit_range::contains_p): New.
	(byte_range::dump): New.
	(byte_range::contains_p): New.
	(byte_range::cmp): New.
	(concrete_binding::dump_to_pp): Drop enum binding_kind.
	(concrete_binding::cmp_ptr_ptr): Likewise.
	(symbolic_binding::dump_to_pp): Likewise.
	(symbolic_binding::cmp_ptr_ptr): Likewise.
	(binding_map::apply_ctor_val_to_range): Likewise.
	(binding_map::apply_ctor_pair_to_child_region): Likewise.
	(binding_map::get_overlapping_bindings): New.
	(binding_map::remove_overlapping_bindings): New.
	(binding_cluster::validate): New.
	(binding_cluster::bind): Drop enum binding_kind.
	(binding_cluster::bind_compound_sval): Likewise.
	(binding_cluster::purge_region): Likewise.
	(binding_cluster::zero_fill_region): Reimplement in terms of...
	(binding_cluster::fill_region): New.
	(binding_cluster::mark_region_as_unknown): Drop enum binding_kind.
	(binding_cluster::get_binding): Likewise.
	(binding_cluster::get_binding_recursive): Likewise.
	(binding_cluster::get_any_binding): Likewise.
	(binding_cluster::maybe_get_compound_binding): Reimplement.
	(binding_cluster::get_overlapping_bindings): Delete.
	(binding_cluster::remove_overlapping_bindings): Reimplement in
	terms of binding_map::remove_overlapping_bindings.
	(binding_cluster::can_merge_p): Update for removal of
	enum binding_kind.
	(binding_cluster::on_unknown_fncall): Drop enum binding_kind.
	(binding_cluster::maybe_get_simple_value): Likewise.
	(store_manager::get_concrete_binding): Likewise.
	(store_manager::get_symbolic_binding): Likewise.
	(store::validate): New.
	(store::set_value): Drop enum binding_kind.
	(store::zero_fill_region): Reimplement in terms of...
	(store::fill_region): New.
	(selftest::test_binding_key_overlap): Drop enum binding_kind.
	* store.h (enum binding_kind): Delete.
	(binding_kind_to_string): Delete decl.
	(binding_key::make): Drop enum binding_kind.
	(binding_key::dump_to_pp): Make pure virtual.
	(binding_key::get_kind): Delete.
	(binding_key::mark_deleted): Delete.
	(binding_key::mark_empty): Delete.
	(binding_key::is_deleted): Delete.
	(binding_key::is_empty): Delete.
	(binding_key::binding_key): Delete.
	(binding_key::impl_hash): Delete.
	(binding_key::impl_eq): Delete.
	(binding_key::m_kind): Delete.
	(bit_range::get_last_bit_offset): New.
	(bit_range::contains_p): New.
	(byte_range::contains_p): New.
	(byte_range::operator==): New.
	(byte_range::get_start_byte_offset): New.
	(byte_range::get_next_byte_offset): New.
	(byte_range::get_last_byte_offset): New.
	(byte_range::as_bit_range): New.
	(byte_range::cmp): New.
	(concrete_binding::concrete_binding): Drop enum binding_kind.
	(concrete_binding::hash): Likewise.
	(concrete_binding::operator==): Likewise.
	(concrete_binding::mark_deleted): New.
	(concrete_binding::mark_empty): New.
	(concrete_binding::is_deleted): New.
	(concrete_binding::is_empty): New.
	(default_hash_traits<ana::concrete_binding>::empty_zero_p): Make false.
	(symbolic_binding::symbolic_binding): Drop enum binding_kind.
	(symbolic_binding::hash): Likewise.
	(symbolic_binding::operator==): Likewise.
	(symbolic_binding::mark_deleted): New.
	(symbolic_binding::mark_empty): New.
	(symbolic_binding::is_deleted): New.
	(symbolic_binding::is_empty): New.
	(binding_map::remove_overlapping_bindings): New decl.
	(binding_map::get_overlapping_bindings): New decl.
	(binding_cluster::validate): New decl.
	(binding_cluster::bind): Drop enum binding_kind.
	(binding_cluster::fill_region): New decl.
	(binding_cluster::get_binding): Drop enum binding_kind.
	(binding_cluster::get_binding_recursive): Likewise.
	(binding_cluster::get_overlapping_bindings): Delete.
	(store::validate): New decl.
	(store::set_value): Drop enum binding_kind.
	(store::fill_region): New decl.
	(store_manager::get_concrete_binding): Drop enum binding_kind.
	(store_manager::get_symbolic_binding): Likewise.
	* svalue.cc (svalue::cmp_ptr): Handle SK_REPEATED and
	SK_BITS_WITHIN.
	(svalue::extract_bit_range): New.
	(svalue::maybe_fold_bits_within): New.
	(constant_svalue::maybe_fold_bits_within): New.
	(unknown_svalue::maybe_fold_bits_within): New.
	(unaryop_svalue::maybe_fold_bits_within): New.
	(repeated_svalue::repeated_svalue): New.
	(repeated_svalue::dump_to_pp): New.
	(repeated_svalue::accept): New.
	(repeated_svalue::all_zeroes_p): New.
	(repeated_svalue::maybe_fold_bits_within): New.
	(bits_within_svalue::bits_within_svalue): New.
	(bits_within_svalue::dump_to_pp): New.
	(bits_within_svalue::maybe_fold_bits_within): New.
	(bits_within_svalue::accept): New.
	(bits_within_svalue::implicitly_live_p): New.
	(compound_svalue::maybe_fold_bits_within): New.
	* svalue.h (enum svalue_kind): Add SK_REPEATED and SK_BITS_WITHIN.
	(svalue::dyn_cast_repeated_svalue): New.
	(svalue::dyn_cast_bits_within_svalue): New.
	(svalue::extract_bit_range): New decl.
	(svalue::maybe_fold_bits_within): New vfunc decl.
	(region_svalue::key_t::mark_empty): Use 2 rather than NULL_TREE.
	(region_svalue::key_t::is_empty): Likewise.
	(default_hash_traits<region_svalue::key_t>::empty_zero_p): Make false.
	(constant_svalue::maybe_fold_bits_within): New.
	(unknown_svalue::maybe_fold_bits_within): New.
	(poisoned_svalue::key_t::mark_empty): Use 2 rather than NULL_TREE.
	(poisoned_svalue::key_t::is_empty): Likewise.
	(default_hash_traits<poisoned_svalue::key_t>::empty_zero_p): Make
	false.
	(setjmp_svalue::key_t::mark_empty): Use 2 rather than NULL_TREE.
	(setjmp_svalue::key_t::is_empty): Likewise.
	(default_hash_traits<setjmp_svalue::key_t>::empty_zero_p): Make
	false.
	(unaryop_svalue::key_t::mark_empty): Use 2 rather than NULL_TREE.
	(unaryop_svalue::key_t::is_empty): Likewise.
	(unaryop_svalue::maybe_fold_bits_within): New.
	(default_hash_traits<unaryop_svalue::key_t>::empty_zero_p): Make
	false.
	(binop_svalue::key_t::mark_empty): Use 2 rather than NULL_TREE.
	(binop_svalue::key_t::is_empty): Likewise.
	(default_hash_traits<binop_svalue::key_t>::empty_zero_p): Make
	false.
	(sub_svalue::key_t::mark_empty): Use 2 rather than NULL_TREE.
	(sub_svalue::key_t::is_empty): Likewise.
	(default_hash_traits<sub_svalue::key_t>::empty_zero_p): Make
	false.
	(class repeated_svalue): New.
	(is_a_helper <const repeated_svalue *>::test): New.
	(struct default_hash_traits<repeated_svalue::key_t>): New.
	(class bits_within_svalue): New.
	(is_a_helper <const bits_within_svalue *>::test): New.
	(struct default_hash_traits<bits_within_svalue::key_t>): New.
	(widening_svalue::key_t::mark_empty): Use 2 rather than NULL_TREE.
	(widening_svalue::key_t::is_empty): Likewise.
	(default_hash_traits<widening_svalue::key_t>::empty_zero_p): Make
	false.
	(compound_svalue::key_t::mark_empty): Use 2 rather than NULL_TREE.
	(compound_svalue::key_t::is_empty): Likewise.
	(compound_svalue::maybe_fold_bits_within): New.
	(default_hash_traits<compound_svalue::key_t>::empty_zero_p): Make
	false.

gcc/testsuite/ChangeLog:
	PR analyzer/95006
	* gcc.dg/analyzer/clobbers-1.c: New test.
	* gcc.dg/analyzer/clobbers-2.c: New test.
	* gcc.dg/analyzer/data-model-1.c (test_26): Mark xfail as fixed.
	(test_28): Likewise.
	(test_52): Likewise.  Add coverage for end of buffer.
	* gcc.dg/analyzer/explode-1.c: Add leak warning.
	* gcc.dg/analyzer/memset-1.c (test_3): Mark xfail as fixed.
	(test_4): Use char.  Mark xfail as fixed.
	(test_6b): New.
	(test_7): Mark xfail as fixed.  Add coverage for start of buffer.
	(test_8): New.
	(test_9): New.
	* gcc.dg/analyzer/memset-CVE-2017-18549-1.c: New test.
	* gcc.dg/analyzer/symbolic-8.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2021-06-30 10:27:40 -04:00
Tobias Burnus
63fe82d80d gcc.c: Add -foffload= to display_help
gcc/ChangeLog:

	* common.opt (foffload): Remove help as Driver only.
	* gcc.c (display_help): Add -foffload.
2021-06-30 14:51:22 +02:00
Christophe Lyon
f6bc9d9bdd [testsuite]: Add missing dg-add-options float16 to gcc.dg/debug/ctf/ctf-skip-types-2.c
The test already checks dg-require-effective-target float16, but this
is not sufficient to use the flags needed, if any.
This patch makes the test pass on arm.

2021-06-30  Christophe Lyon  <christophe.lyon@foss.st.com>

	gcc/testsuite/
	* gcc.dg/debug/ctf/ctf-skip-types-2.c: Add dg-add-options float16.
2021-06-30 11:44:30 +00:00
Tobias Burnus
a3ce7d75dd gcc.c's check_offload_target_name: Fixes to inform hints
gcc/ChangeLog:

	* gcc.c (close_at_file, execute): Replace alloca by XALLOCAVEC.
	(check_offload_target_name): Fix splitting OFFLOAD_TARGETS into
	a candidate list; better inform no offload target is configured
	and fix hint extraction when passed target is not '\0' at [len].
	* common.opt (foffload): Add tailing '.'.
	(foffload-options): Likewise; fix flag name in the help string.
2021-06-30 13:17:54 +02:00
prathamesh.kulkarni
0a9d038ec1 arm/66791: Gate comparison in vca intrinsics on __FAST_MATH__.
gcc/ChangeLog:

	PR target/66791
	* config/arm/arm_neon.h: Move vabs intrinsics before vcage_f32.
	(vcage_f32): Gate comparison on __FAST_MATH__.
	(vcageq_f32): Likewise.
	(vcale_f32): Likewise.
	(vcaleq_f32): Likewise.
	(vcagt_f32): Likewise.
	(vcagtq_f32): Likewise.
	(vcalt_f32): Likewise.
	(vcaltq_f32): Likewise.
	(vcage_f16): Likewise.
	(vcageq_f16): Likewise.
	(vcale_f16): Likewise.
	(vcaleq_f16): Likewise.
	(vcagt_f16): Likewise.
	(vcagtq_f16): Likewise.
	(vcalt_f16): Likewise.
	(vcaltq_f16): Likewise.
2021-06-30 15:15:23 +05:30
Richard Biener
39da8a7ba9 tree-optimization/101264 - rework SLP "any" permute forward prop
This integrates the forward propagation of SLP "any" permutes into
the main propagation stage as a separate single-pass propagation
didn't work out.

2021-06-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/101264
	* tree-vect-slp.c (vect_optimize_slp): Propagate the
	computed perm_in to all "any" permute successors
	we cannot de-duplicate immediately.

	* gfortran.dg/pr101264.f90: New testcase.
2021-06-30 11:14:12 +02:00
Xi Ruoyao
35da8a9802
MAINTAINERS: Add myself for write after approval
ChangeLog:

	* MAINTAINERS (Write After Approval): Add myself.
2021-06-30 10:47:17 +08:00
Xi Ruoyao
6bf383c37e
fixinc: don't "fix" machine names in __has_include(...) [PR91085]
fixincludes/

	PR other/91085
	* fixfixes.c (check_has_inc): New static function.
	  (machine_name_fix): Don't replace header names in
	  __has_include(...).
	* inclhack.def (machine_name): Adjust test.
	* tests/base/testing.h: Update.
2021-06-30 10:43:20 +08:00
liuhongt
ed392e9db4 The upper bits of FIXUPIMMS{S,D} should come from src1 not dest.
gcc/ChangeLog:

	PR target/101248
	* config/i386/sse.md
	(avx512f_sfixupimm<mode><sd_maskz_name><round_saeonly_name>):
	Refined to ..
	(avx512f_sfixupimm<mode><maskz_scalar_name><round_saeonly_name>):
	this.
	(avx512f_sfixupimm<mode>_mask<round_saeonly_name>"): Refined.
	* config/i386/subst.md (maskz_scalar): New define_subst.
	(maskz_scalar_name): New subst_attr.
	(maskz_scalar_op5): Ditto.
	(round_saeonly_maskz_scalar_op5): Ditto.
	(round_saeonly_maskz_scalar_operand5): Ditto.

gcc/testsuite/ChangeLog

	PR target/101248
	* gcc.target/i386/pr101248.c: New test.
2021-06-30 09:07:46 +08:00
David Edelsohn
652abe2220 aix: align text CSECTs to at least 32 bytes.
gcc/ChangeLog:

	* config/rs6000/rs6000.c (rs6000_xcoff_section_type_flags):
	Increase code CSECT alignment to at least 32 bytes.
	* config/rs6000/xcoff.h (TEXT_SECTION_ASM_OP): Add 32 byte
	alignment designation.
2021-06-29 20:44:12 -04:00
GCC Administrator
6bc18203dd Daily bump. 2021-06-30 00:16:52 +00:00
Sergei Trofimovich
1cb5e50f98 docs: Fix s/net yet/not yet/ typo
gcc/ChangeLog:

	* doc/generic.texi: Fix s/net yet/not yet/ typo.
2021-06-29 22:15:12 +01:00
Jason Merrill
362347c5a4 c++: don't treat member var as var template
While looking at a partial instantiation issue I noticed that we were
wrongly hitting the partial instantiation code when instantiating a static
data member of a class template.  I don't think this broke anything, but we
don't need to do that (small) extra work.

gcc/cp/ChangeLog:

	* pt.c (instantiate_decl): Only consider partial specializations of
	actual variable templates.
2021-06-29 16:50:23 -04:00
Ian Lance Taylor
13c906f43f compiler: don't generate temporaries for composite literals
We were generating temporaries for composite literals when a
conversion to interface type was required.  However, Cherry's
https://golang.org/cl/176459 changed the compiler to insert explicit
type conversions.  And those explicit type conversions insert the
required temporaries in Type_conversion_expression::do_flatten.
So in practice the composite literal do_flatten methods would never
insert temporaries, as the values they see would always be multi_eval_safe.
So just remove the unnecessary do_flatten methods.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/331691
2021-06-29 13:44:37 -07:00
Ian Lance Taylor
cca7eb8f7c go-gcc: set DECL_NAMELESS for temporary variables
* go-gcc.cc (Gcc_backend::static_chain_variable): Set
	DECL_NAMELESS on the new decl.
	(Gcc_backend::temporary_variable): Likewise.
	(Gcc_backend::function): Set DECL_NAMELESS on the result decl.
2021-06-29 12:13:35 -07:00
Andrew MacLeod
a96d8d67d0 Fix MINUS_EXPR relations.
Flesh out and correct relations for both wrapping and non-wrapping values.

	gcc/
	PR tree-optimization/101254
	* range-op.cc (operator_minus::op1_op2_relation_effect): Check for
	wrapping/non-wrapping when setting the result range.

	gcc/testsuite
	* gcc.dg/pr101254.c: New.
2021-06-29 14:57:01 -04:00
Andrew MacLeod
604dce2d74 Allow PHIs to pick up global values.
We can also apply known global values to PHI nodes in EVRP.

	* value-query.cc (gimple_range_global): Allow phis.
2021-06-29 14:57:01 -04:00
Andrew MacLeod
a7e655ae40 Add stmt context in simplify_using_ranges.
There were places simplify_using_ranges was not utilzing the stmt context.

	* vr-values.c (vr_values::vrp_stmt_computes_nonzero): Use stmt.
	(simplify_using_ranges::op_with_boolean_value_range_p): Add a
	statement for location context.
	(check_for_binary_op_overflow): Ditto.
	(simplify_using_ranges::get_vr_for_comparison): Ditto.
	(simplify_using_ranges::compare_name_with_value): Ditto.
	(simplify_using_ranges::compare_names): Ditto.
	(vrp_evaluate_conditional_warnv_with_ops_using_ranges): Ditto.
	(simplify_using_ranges::simplify_truth_ops_using_ranges): Ditto.
	(simplify_using_ranges::simplify_min_or_max_using_ranges): Ditto.
	(simplify_using_ranges::simplify_internal_call_using_ranges): Ditto.
	(simplify_using_ranges::two_valued_val_range_p): Ditto.
	(simplify_using_ranges::simplify): Ditto.
	* vr-values.h: Adjust prototypes.
2021-06-29 14:57:01 -04:00
Ian Lance Taylor
8a8a7d332d compiler: in composite literals use temps only for interfaces
For a composite literal we only need to introduce a temporary variable
if we may be converting to an interface type, so only do it then.
This saves over 80% of compilation time when using gccgo to compile
cmd/internal/obj/x86, as the GCC middle-end spends a lot of time
pointlessly computing interactions between temporary variables.

For PR debug/101064
For golang/go#46600

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/331513
2021-06-29 11:01:19 -07:00
Uros Bizjak
c60d9160b4 i386: Add V2SFmode vec_addsub pattern [PR95046]
gcc/

2021-06-21  Uroš Bizjak  <ubizjak@gmail.com>

	PR target/95046
	* config/i386/mmx.md (vec_addsubv2sf3): New insn pattern.

gcc/testsuite/

2021-06-21  Uroš Bizjak  <ubizjak@gmail.com>

	PR target/95046
	* gcc.target/i386/pr95046-9.c: New test.
2021-06-29 19:16:26 +02:00
Julian Brown
c0f8c22a3e Fortran: Re-enable 128-bit integers for AMD GCN
This patch reverts the part of Tobias's patch for PR target/96306 that
disables 128-bit integer support for AMD GCN.

2021-06-18  Julian Brown  <julian@codesourcery.com>

libgfortran/
	PR target/96306
	* configure.ac: Remove stanza that removes KIND=16 integers for AMD GCN.
	* configure: Regenerate.
2021-06-29 08:19:56 -07:00