Commit graph

183975 commits

Author SHA1 Message Date
Aldy Hernandez
88081d38bd Handle setting of 1-bit anti-ranges uniformly.
PR tree-optimization/99296
	* value-range.cc (irange::irange_set_1bit_anti_range): New.
	(irange::irange_set_anti_range): Call irange_set_1bit_anti_range
	* value-range.h (irange::irange_set_1bit_anti_range): New.
2021-03-23 02:57:41 -04:00
Joseph Myers
441e1980ce Update gcc sv.po.
* sv.po: Update.
2021-03-23 00:34:23 +00:00
GCC Administrator
8b744f46a2 Daily bump. 2021-03-23 00:16:25 +00:00
Jonathan Wakely
7c1006135d libstdc++: Implement string_view range constructor for C++20
This implements the new string_view constructor proposed by P1989R2.
This hasn't been voted into the C++23 draft yet, but it's been reviewed
by LWG and is expected to be approved at the next WG21 meeting.

libstdc++-v3/ChangeLog:

	* include/std/string_view (basic_string_view(Range&&)): Define new
	constructor and deduction guide.
	* testsuite/21_strings/basic_string_view/cons/char/range_c++20.cc: New test.
	* testsuite/21_strings/basic_string_view/cons/wchar_t/range_c++20.cc: New test.
2021-03-22 22:56:04 +00:00
Nathan Sidwell
2bfd081f1b c++: Cross-module partial specialiations [PR 99480]
We were not correctly handling cross-module redeclarations of
partial-specializations.  They have their own TEMPLATE_DECL, which we
need to locate.  I had a FIXME there about this case.  Guess it's
fixed now.

	PR c++/99480
	gcc/cp/
	* module.cc (depset:#️⃣:make_dependency): Propagate flags for
	partial specialization.
	(module_may_redeclare): Handle partial specialization.
	gcc/testsuite/
	* g++.dg/modules/pr99480_a.H: New.
	* g++.dg/modules/pr99480_b.H: New.
2021-03-22 12:40:33 -07:00
Vladimir N. Makarov
02f2dc441b [PR99581] Define relaxed memory and use it for aarch64
aarch64 needs to skip memory address validation for LD1R insns.  Skipping
the address validation may result in LRA crash for some targets when usual
memory constraint is used.  This patch introduces define_relaxed_memory_constraint,
skipping address validation for it, and defining relaxed memory for
aarch64 LD1r insn memory operand.

gcc/ChangeLog:

	PR target/99581
	* config/aarch64/constraints.md (UtQ): Use
	define_relaxed_memory_constraint for it.
	* doc/md.texi (define_relaxed_memory_constraint): Describe it.
	* genoutput.c (main): Process DEFINE_RELAXED_MEMORY_CONSTRAINT.
	* genpreds.c (constraint_data): Add bitfield is_relaxed_memory.
	(have_relaxed_memory_constraints): New static var.
	(relaxed_memory_start, relaxed_memory_end): Ditto.
	(add_constraint): Add arg is_relaxed_memory.  Check name for
	relaxed memory.  Set up is_relaxed_memory in constraint_data and
	have_relaxed_memory_constraints.  Adjust calls.
	(choose_enum_order): Process relaxed memory.
	(write_tm_preds_h): Ditto.
	(main): Process DEFINE_RELAXED_MEMORY_CONSTRAINT.
	* gensupport.c (process_rtx): Process DEFINE_RELAXED_MEMORY_CONSTRAINT.
	* ira-costs.c (record_reg_classes): Process CT_RELAXED_MEMORY.
	* ira-lives.c (single_reg_class): Use
	insn_extra_relaxed_memory_constraint.
	* ira.c (ira_setup_alts): CT_RELAXED_MEMORY.
	* lra-constraints.c (valid_address_p): Use
	insn_extra_relaxed_memory_constraint instead of other memory
	constraints.
	(process_alt_operands): Process CT_RELAXED_MEMORY.
	(curr_insn_transform): Use insn_extra_relaxed_memory_constraint.
	* recog.c (asm_operand_ok, preprocess_constraints): Process
	CT_RELAXED_MEMORY.
	* reload.c (find_reloads): Ditto.
	* rtl.def (DEFINE_RELAXED_MEMORY_CONSTRAINT): New.
	* stmt.c (parse_input_constraint): Use
	insn_extra_relaxed_memory_constraint.

gcc/testsuite/ChangeLog:

	PR target/99581
	* gcc.target/powerpc/pr99581.c: New.
2021-03-22 13:37:00 -04:00
Segher Boessenkool
ba16797fe6 ubsan: Don't test for NaNs if those do not exist (PR97926)
2021-03-22  Segher Boessenkool  <segher@kernel.crashing.org>

	PR target/97926
	* ubsan.c (ubsan_instrument_float_cast): Don't test for unordered if
	there are no NaNs.
2021-03-22 16:32:42 +00:00
Jonathan Wakely
00b46c00c8 libstdc++: Add noexcept to std::begin etc as per LWG 2280 and 3537
This implements the proposed changes for LWG 3537 (which we're allowed
to do as an extension whatever the outcome of the issue). I noticed we
didn't implement LWG 2280 completely, as the std::begin and std::end
overloads for arrays were not noexcept.

libstdc++-v3/ChangeLog:

	* include/bits/range_access.h (begin(T (&)[N]), end(T (&)[N])):
	Add missing 'noexcept' as per LWG 2280.
	(rbegin(T (&)[N]), rend(T (&)[N]), rbegin(initializer_list<T>))
	(rend(initializer_list<T>)): Add 'noexcept' as per LWG 3537.
	* testsuite/24_iterators/range_access/range_access.cc: Check for
	expected noexcept specifiers. Check result types of generic
	std::begin and std::end overloads.
	* testsuite/24_iterators/range_access/range_access_cpp14.cc:
	Check for expected noexcept specifiers.
	* testsuite/24_iterators/range_access/range_access_cpp17.cc:
	Likewise.
2021-03-22 15:56:49 +00:00
Nathan Sidwell
87e3c2ef68 c++: duplicate alias templates with decltype [PR 99425]
This failure was ultimately from incorrect handling of alias
templates, but required a specific set of occurrences to happen in the
specialization hash table.  This cleans up the specialization
streaming to add alias instantiations at the same point as other
instantiations.  I also removed some unneeded global variables dealing
with mapping of duplicate decl contexts.

	PR c++/99425
	gcc/cp/
	* cp-tree.h (map_context_from, map_context_to): Delete.
	(add_mergeable_specialization): Add is_alias parm.
	* pt.c (add_mergeable_specialization): Add is_alias parm, add them.
	* module.cc (map_context_from, map_context_to): Delete.
	(trees_in::decl_value): Add specializations later, adjust call.
	Drop useless alias lookup. Set duplicate fn parm context.
	(check_mergeable_decl): Drop context mapping.
	(trees_in::is_matching_decl): Likewise.
	(trees_in::read_function_def): Drop parameter context adjustment
	here.
	gcc/testsuite/
	* g++.dg/modules/pr99425-1.h: New.
	* g++.dg/modules/pr99425-1_a.H: New.
	* g++.dg/modules/pr99425-1_b.H: New.
	* g++.dg/modules/pr99425-1_c.C: New.
	* g++.dg/modules/pr99425-2_a.X: New.
	* g++.dg/modules/pr99425-2_b.X: New.
	* g++.dg/template/pr99425.C: New.
2021-03-22 08:26:57 -07:00
Alex Coplan
150a829acc arm: Fix MVE ICEs with vector moves and -mpure-code [PR97252]
This fixes around 500 ICEs in the testsuite which can be seen when
testing with -march=armv8.1-m.main+mve -mfloat-abi=hard -mpure-code
(leaving the testsuite free of ICEs in this configuration). All of the
ICEs are in arm_print_operand (which is expecting a mem and gets another
rtx, e.g. a const_vector) when running the output code for
*mve_mov<mode> in alternative 4.

The issue is that MVE vector moves were relying on the arm_reorg pass to
move constant vectors that we can't easily synthesize to the literal
pool. This doesn't work for -mpure-code where the literal pool is
disabled. LLVM puts these in .rodata: I've chosen to do the same here.

With this change, for -mpure-code, we no longer want to allow a constant
on the RHS of a vector load in RA. To achieve this, I added a new
constraint which matches constants only if the literal pool is
available.

gcc/ChangeLog:

	PR target/97252
	* config/arm/arm-protos.h (neon_make_constant): Add generate
	argument to guard emitting insns, default to true.
	* config/arm/arm.c (arm_legitimate_constant_p_1): Reject
	CONST_VECTORs which neon_make_constant can't handle.
	(neon_vdup_constant): Add generate argument, avoid emitting
	insns if it's not set.
	(neon_make_constant): Plumb new generate argument through.
	* config/arm/constraints.md (Ui): New. Use it...
	* config/arm/mve.md (*mve_mov<mode>): ... here.
	* config/arm/vec-common.md (movv8hf): Use neon_make_constant to
	synthesize constants.
2021-03-22 14:43:15 +00:00
Richard Biener
57d9ac6728 Warn to not add debug hook targets
This adds a boiler-plate warning to the debug hooks structure to
strongly discourage people from adding new debug hook targets since
we want to get rid of the current abstraction in favor of maintaining
a DWARF view of debug in the middle-end and have support for alternate
output formats to be generated off that DWARF representation.

2021-03-22  Richard Biener  <rguenther@suse.de>

	* debug.h: Add deprecation warning.
2021-03-22 14:37:26 +01:00
Richard Biener
b931e4792b tree-optimization/99694 - fix value-numbering PHIs
This avoids endless cycling when a PHI node with unchanged backedge
value (the PHI result appearing there) is subject to CSE since doing
that effectively alters the hash entry.  The way to avoid this is
to ignore such edges when processing the PHI node.

2021-03-22  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/99694
	* tree-ssa-sccvn.c (visit_phi): Ignore edges with the
	PHI result.

	* gcc.dg/torture/pr99694.c: New testcase.
2021-03-22 14:37:26 +01:00
Martin Liska
c4519fe3db C++ modules: fix alloc-dealloc-mismatch ASAN issue
gcc/cp/ChangeLog:

	PR c++/99687
	* module.cc (fini_modules): Call vec_free instead of delete.
2021-03-22 13:01:20 +01:00
Martin Liska
c38f679eeb mklog: add new argument --directory.
The argument is handy when one needs to generate ChangeLog entries
for a different project (e.g. binutils).

contrib/ChangeLog:

	* mklog.py: Add --directory argument.
2021-03-22 10:54:32 +01:00
Kito Cheng
540dace2ed PR target/99702: Check RTL type before get value
gcc/ChangeLog:

	PR target/99702
	* config/riscv/riscv.c (riscv_expand_block_move): Get RTL value
	after type checking.

gcc/testsuite/ChangeLog:

	PR target/99702
	* gcc.target/riscv/pr99702.c: New.
2021-03-22 17:47:02 +08:00
Tobias Burnus
0e792ee11a Fortran: Fix 'name' bound size [PR99688]
gcc/fortran/ChangeLog:

	PR fortran/99688
	* match.c (select_type_set_tmp, gfc_match_select_type,
	gfc_match_select_rank): Fix 'name' buffersize to avoid out of bounds.
	* resolve.c (resolve_select_type): Likewise.
2021-03-22 09:50:50 +01:00
Jakub Jelinek
fc9c4e5fc5 debug: Fix __int128 handling in dwarf2out [PR99562]
The PR66728 changes broke __int128 handling.
It emits wide_int numbers in their minimum unsigned precision
rather than in their full precision.
The problem is then that e.g. the DW_OP_implicit_value path:
          int_mode = as_a <scalar_int_mode> (mode);
          loc_result = new_loc_descr (DW_OP_implicit_value,
                                      GET_MODE_SIZE (int_mode), 0);
          loc_result->dw_loc_oprnd2.val_class = dw_val_class_wide_int;
          loc_result->dw_loc_oprnd2.v.val_wide = ggc_alloc<wide_int> ();
          *loc_result->dw_loc_oprnd2.v.val_wide = rtx_mode_t (rtl, int_mode);
emits invalid DWARF.  In particular this patch fixes there multiple
occurences of:
        .byte   0x9e    # DW_OP_implicit_value
        .uleb128 0x10
        .quad   0xffffffffffffffff
+       .quad   0
        .quad   .LVL46  # Location list begin address (*.LLST40)
        .quad   .LFE14  # Location list end address (*.LLST40)
where we said the value has 16 byte size but then only emitted 8 byte value.
My understanding is that most of the places that use val_wide expect
the precision they chose (the one of the mode they want etc.), the only
exception is the add_const_value_attribute case where it deals with
VOIDmode CONST_WIDE_INTs, for that I agree when we don't have a mode
we need to fallback to minimum precision (not sure if maximum of
min_precision UNSIGNED and SIGNED wouldn't be better, then consumers
would know if it is signed or unsigned by looking at the MSB),
but that code already computes the precision, just decided to
create the wide_int with much larger precision (e.g. 512 bit
on x86_64).

2021-03-22  Jakub Jelinek  <jakub@redhat.com>

	PR debug/99562
	PR debug/66728
	* dwarf2out.c (get_full_len): Use get_precision rather than
	min_precision.
	(add_const_value_attribute): Make sure add_AT_wide argument has
	precision prec rather than some very wide one.
2021-03-22 08:52:04 +01:00
Kewen Lin
0ec7641ee1 rs6000: Fix some unexpected empty split conditions
This patch is to fix empty split-conditions of some
define_insn_and_split definitions where their conditions for
define_insn part aren't empty.  As Segher and Mike pointed
out, they can sometimes lead to unexpected consequences.

Bootstrapped/regtested on powerpc64le-linux-gnu P9 and
powerpc64-linux-gnu P8.

gcc/ChangeLog:

	* config/rs6000/rs6000.md (*rotldi3_insert_sf,
	*mov<SFDF:mode><SFDF2:mode>cc_p9, floatsi<mode>2_lfiwax,
	floatsi<mode>2_lfiwax_mem, floatunssi<mode>2_lfiwzx,
	floatunssi<mode>2_lfiwzx_mem, *floatsidf2_internal,
	*floatunssidf2_internal, fix_trunc<mode>si2_stfiwx,
	fix_trunc<mode>si2_internal, fixuns_trunc<mode>si2_stfiwx,
	*round32<mode>2_fprs, *roundu32<mode>2_fprs,
	*fix_trunc<mode>si2_internal): Fix empty split condition.
	* config/rs6000/vsx.md (*vsx_le_undo_permute_<mode>,
	vsx_reduc_<VEC_reduc_name>_v2df, vsx_reduc_<VEC_reduc_name>_v4sf,
	*vsx_reduc_<VEC_reduc_name>_v2df_scalar,
	*vsx_reduc_<VEC_reduc_name>_v4sf_scalar): Likewise.
2021-03-21 21:27:23 -05:00
Xionghu Luo
d0a5e8e1a8 rs6000: Convert the vector set variable idx to DImode [PR98914]
vec_insert defines the element argument type to be signed int by ELFv2
ABI.  When expanding a vector with a variable rtx, convert the rtx type
to DImode to support both intrinsic usage and other callers from
rs6000_expand_vector_init produced by v[k] = val when k is long type.

gcc/ChangeLog:

2021-03-21  Xionghu Luo  <luoxhu@linux.ibm.com>

	PR target/98914
	* config/rs6000/rs6000.c (rs6000_expand_vector_set_var_p9):
	Convert idx to DImode.
	(rs6000_expand_vector_set_var_p8): Likewise.

gcc/testsuite/ChangeLog:

2021-03-21  Xionghu Luo  <luoxhu@linux.ibm.com>

	PR target/98914
	* gcc.target/powerpc/pr98914.c: New test.
2021-03-21 21:14:02 -05:00
GCC Administrator
d2de43b775 Daily bump. 2021-03-22 00:16:20 +00:00
Jakub Jelinek
fc24ea2374 dwarf2out: Fix debug info for 2 byte floats [PR99388]
Aarch64, ARM and a couple of other architectures have 16-bit floats, HFmode.
As can be seen e.g. on
void
foo (void)
{
  __fp16 a = 1.0;
  asm ("nop");
  a = 2.0;
  asm ("nop");
  a = 3.0;
  asm ("nop");
}
testcase, GCC mishandles this on the dwarf2out.c side by assuming all
floating point types have sizes in multiples of 4 bytes, so what GCC emits
is it says that e.g. the DW_OP_implicit_value will be 2 bytes but then
doesn't emit anything and so anything emitted after it is treated by
consumers as the value and then they get out of sync.
real_to_target which insert_float uses indeed fills it that way, but putting
into an array of long 32 bits each time, but for the half floats it puts
everything into the least significant 16 bits of the first long no matter
what endianity host or target has.

The following patch fixes it.  With the patch the -g -O2 -dA output changes
(in a cross without .uleb128 support):
        .byte   0x9e    // DW_OP_implicit_value
        .byte   0x2     // uleb128 0x2
+       .2byte  0x3c00  // fp or vector constant word 0
        .byte   0x7     // DW_LLE_start_end (*.LLST0)
        .8byte  .LVL1   // Location list begin address (*.LLST0)
        .8byte  .LVL2   // Location list end address (*.LLST0)
        .byte   0x4     // uleb128 0x4; Location expression size
        .byte   0x9e    // DW_OP_implicit_value
        .byte   0x2     // uleb128 0x2
+       .2byte  0x4000  // fp or vector constant word 0
        .byte   0x7     // DW_LLE_start_end (*.LLST0)
        .8byte  .LVL2   // Location list begin address (*.LLST0)
        .8byte  .LFE0   // Location list end address (*.LLST0)
        .byte   0x4     // uleb128 0x4; Location expression size
        .byte   0x9e    // DW_OP_implicit_value
        .byte   0x2     // uleb128 0x2
+       .2byte  0x4200  // fp or vector constant word 0
        .byte   0       // DW_LLE_end_of_list (*.LLST0)

Bootstrapped/regtested on x86_64-linux, aarch64-linux and
armv7hl-linux-gnueabi, ok for trunk?

I fear the CONST_VECTOR case is still broken, while HFmode elements of vectors
should be fine (it uses eltsize of the element sizes) and likewise SFmode could
be fine, DFmode vectors are emitted as two 32-bit ints regardless of endianity
and I'm afraid it can't be right on big-endian.  But I haven't been able to
create a testcase that emits a CONST_VECTOR, for e.g. unused vector vars
with constant operands we emit CONCATN during expansion and thus ...
DW_OP_*piece for each element of the vector and for
DW_TAG_call_site_parameter we give up (because we handle CONST_VECTOR only
in loc_descriptor, not mem_loc_descriptor).

2021-03-21  Jakub Jelinek  <jakub@redhat.com>

	PR debug/99388
	* dwarf2out.c (insert_float): Change return type from void to
	unsigned, handle GET_MODE_SIZE (mode) == 2 and return element size.
	(mem_loc_descriptor, loc_descriptor, add_const_value_attribute):
	Adjust callers.
2021-03-21 17:27:39 +01:00
GCC Administrator
6af7b307f6 Daily bump. 2021-03-21 00:16:22 +00:00
H.J. Lu
19ff0b0d81 x86: Check cfun != NULL before accessing silent_p
Since construct_container may be called with cfun == NULL, check
cfun != NULL before accessing silent_p.

gcc/

	PR target/99679
	* config/i386/i386.c (construct_container): Check cfun != NULL
	before accessing silent_p.

gcc/testsuite/

	PR target/99679
	* g++.target/i386/pr99679-1.C: New test.
	* g++.target/i386/pr99679-2.C: Likewise.
2021-03-20 10:08:31 -07:00
Jakub Jelinek
9f59cb7cac c-family: Fix PR94272 -fcompare-debug issue even for C [PR99230]
The following testcase results in -fcompare-debug failure.
The problem is the similar like in PR94272
https://gcc.gnu.org/pipermail/gcc-patches/2020-March/542562.html
When genericizing, with -g0 we have just a TREE_SIDE_EFFECTS DO_STMT
in a branch of if, while with -g we have that wrapped into
TREE_SIDE_EFFECTS STATEMENT_LIST containing DEBUG_BEGIN_STMT and that
DO_STMT.
The do loop is empty with 0 condition, so c_genericize_control_stmt
turns it into an empty statement (without TREE_SIDE_EFFECTS).
For -g0 that means that suddenly the if branch doesn't have side effects
and is expanded differently.  But with -g we still have TREE_SIDE_EFFECTS
STATEMENT_LIST containing DEBUG_BEGIN_STMT and non-TREE_SIDE_EFFECTS stmt.
The following patch fixes that by detecting this case and removing
TREE_SIDE_EFFECTS.

And, so that we don't duplicate the same code, changes the C++ FE to
just call the c_genericize_control_stmt function that can now handle it.

2021-03-20  Jakub Jelinek  <jakub@redhat.com>

	PR debug/99230
	* c-gimplify.c (c_genericize_control_stmt): Handle STATEMENT_LIST.

	* cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
	special code, instead call c_genericize_control_stmt.

	* gcc.dg/pr99230.c: New test.
2021-03-20 17:02:06 +01:00
Ahamed Husni
9c2f08475a [PATCH] Fix typo in gcc/asan.c comment
gcc/
	* asan.c: Fix typos in comments.
2021-03-20 09:17:23 -06:00
Vladimir N. Makarov
8bf983c71e [PR99680] Check empty constraint before using CONSTRAINT_LEN.
It seems CONSTRAINT_LEN treats constraint '\0' as one having length 1.  Therefore we
read after the constraint string.  The patch fixes it.

gcc/ChangeLog:

	PR rtl-optimization/99680
	* lra-constraints.c (skip_contraint_modifiers): Rename to skip_constraint_modifiers.
	(process_address_1): Check empty constraint before using
	CONSTRAINT_LEN.
2021-03-20 10:52:10 -04:00
GCC Administrator
5f256a70a0 Daily bump. 2021-03-20 00:16:24 +00:00
Jakub Jelinek
3279a9a5a9 c: Fix up -Wunused-but-set-* warnings for _Atomics [PR99588]
As the following testcases show, compared to -D_Atomic= case we have many
-Wunused-but-set-* warning false positives.
When an _Atomic variable/parameter is read, we call mark_exp_read on it in
convert_lvalue_to_rvalue, but build_atomic_assign does not.
For consistency with the non-_Atomic case where we mark_exp_read the lhs
for lhs op= ... but not for lhs = ..., this patch does that too.
But furthermore we need to pattern match the trees emitted by _Atomic store,
so that _Atomic store itself is not marked as being a variable read, but
when the result of the store is used, we mark it.

2021-03-19  Jakub Jelinek  <jakub@redhat.com>

	PR c/99588
	* c-typeck.c (mark_exp_read): Recognize what build_atomic_assign
	with modifycode NOP_EXPR produces and mark the _Atomic var as read
	if found.
	(build_atomic_assign): For modifycode of NOP_EXPR, use COMPOUND_EXPRs
	rather than STATEMENT_LIST.  Otherwise call mark_exp_read on lhs.
	Set TREE_SIDE_EFFECTS on the TARGET_EXPR.

	* gcc.dg/Wunused-var-5.c: New test.
	* gcc.dg/Wunused-var-6.c: New test.
2021-03-19 22:54:31 +01:00
Joseph Myers
e5d74554b5 Regenerate gcc.pot.
* gcc.pot: Regenerate.
2021-03-19 21:33:05 +00:00
Pat Haugen
e1df2c3436 Add Power10 scheduling description.
2021-03-19  Pat Haugen  <pthaugen@linux.ibm.com>

gcc/

	* config/rs6000/rs6000.c (power10_cost): New.
	(rs6000_option_override_internal): Set Power10 costs.
	(rs6000_issue_rate): Set Power10 issue rate.
	* config/rs6000/power10.md: Rewrite for Power10.
2021-03-19 15:51:22 -05:00
Jonathan Wakely
b8ecdc7727 libstdc++: Add std::is_scoped_enum for C++23
Implement this C++23 feature, as proposed by P1048R1.

This implementation assumes that a C++23 compiler supports concepts
already. I don't see any point in using preprocessor hacks to detect
compilers which define __cplusplus to a post-C++20 value but don't
support concepts yet.

libstdc++-v3/ChangeLog:

	* include/std/type_traits (is_scoped_enum): Define.
	* include/std/version (__cpp_lib_is_scoped_enum): Define.
	* testsuite/20_util/is_scoped_enum/value.cc: New test.
	* testsuite/20_util/is_scoped_enum/version.cc: New test.
2021-03-19 20:10:56 +00:00
Thomas Koenig
83855386c4 Add size check to vector-matrix matmul.
It turns out the library version is much faster for vector-matrix
multiplications for large sizes than what inlining can produce.
Use size checks for switching between this and inlining for
that case to.

gcc/fortran/ChangeLog:

	* frontend-passes.c (inline_limit_check): Add rank_a
	argument. If a is rank 1, set the second dimension to 1.
	(inline_matmul_assign): Pass rank_a argument to inline_limit_check.
	(call_external_blas): Likewise.

gcc/testsuite/ChangeLog:

	* gfortran.dg/inline_matmul_6.f90: Adjust count for
	  _gfortran_matmul.
2021-03-19 20:52:20 +01:00
Vladimir N. Makarov
d81019db09 [PR99663] Don't use unknown constraint for address constraint in process_address_1.
s390x has insns using several alternatives with address constraints.  Even
if we don't know at this stage what alternative will be used, we still can say
that is an address constraint.  So don't use unknown constraint in this
case when there are multiple constraints or/and alternative.

gcc/ChangeLog:

	PR target/99663
	* lra-constraints.c (process_address_1): Don't use unknown
	constraint for address constraint.

gcc/testsuite/ChangeLog:

	PR target/99663
	* gcc.target/s390/pr99663.c: New.
2021-03-19 15:34:48 -04:00
Jakub Jelinek
82bb66730b c++: Only reject reinterpret casts from pointers to integers for manifestly_const_eval evaluation [PR99456]
My PR82304/PR95307 fix moved reinterpret cast from pointer to integer
diagnostics from cxx_eval_outermost_constant_expr where it caught
invalid code only at the outermost level down into
cxx_eval_constant_expression.
Unfortunately, it regressed following testcase, we emit worse code
including dynamic initialization of some vars.
While the initializers are not constant expressions due to the
reinterpret_cast in there, there is no reason not to fold them as an
optimization.

I've tried to make this dependent on !ctx->quiet, but that regressed
two further tests, and on ctx->strict, which regressed other tests,
so this patch bases that on manifestly_const_eval.

The new testcase is now optimized as much as it used to be in GCC 10
and the only regression it causes is an extra -Wnarrowing warning
on vla22.C test on invalid code (which the patch adjusts).

2021-03-19  Jakub Jelinek  <jakub@redhat.com>

	PR c++/99456
	* constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
	INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
	don't diagnose it, set *non_constant_p nor return t.

	* g++.dg/opt/pr99456.C: New test.
	* g++.dg/ext/vla22.C: Expect a -Wnarrowing warning for c++11 and
	later.
2021-03-19 18:36:56 +01:00
Iain Sandoe
02f305440f Darwin : Fix build failure for powerpc-darwin8 [PR99661].
A hunk had been missed from r11-6417, fixed thus:

gcc/ChangeLog:

	PR target/99661
	* config.gcc (powerpc-*-darwin8): Delete the reference to
	the now removed darwin8.h.
2021-03-19 16:40:11 +00:00
Olivier Hainque
eadb118e36 target/99660 - missing VX_CPU_PREFIX for vxworksae
This fixes an oversight which causes make all-gcc
to fail for --target=*vxworksae or vxworksmils, a regression
introduced by the recent VxWorks7 related updates.

Both AE and MILS variants resort to a common config/vxworksae.h,
which misses a definition of VX_CPU_PREFIX expected by port
specific headers.

The change just provides the missing definition.

2021-03-19  Olivier Hainque  <hainque@adacore.com>

gcc/
	PR target/99660
	* config/vxworksae.h (VX_CPU_PREFIX): Define.
2021-03-19 16:16:39 +00:00
John David Anglin
22d1a90a15 Use memcpy instead of strncpy to avoid error with -Werror=stringop-truncation.
gcc/ChangeLog:

	* config/pa/pa.c (import_milli): Use memcpy instead of strncpy.
2021-03-19 15:57:06 +00:00
Tamar Christina
c3a2bc6daa slp: remove unneeded permute calculation (PR99656)
The attach testcase ICEs because as you showed on the PR we have one child
which is an internal with a PERM of EVENEVEN and one with TOP.

The problem is while we can conceptually merge the permute itself into EVENEVEN,
merging the lanes don't really make sense.

That said, we no longer even require the merged lanes as we create the permutes
based on the KIND directly.

This patch just removes all of that code.

Unfortunately it still won't vectorize with the cost model enabled due to the
blend that's created combining the load and the external

	note: node 0x51f2ce8 (max_nunits=1, refcnt=1)
	note: op: VEC_PERM_EXPR
	note:       { }
	note:       lane permutation { 0[0] 1[1] }
	note:       children 0x51f23e0 0x51f2578
	note: node 0x51f23e0 (max_nunits=2, refcnt=1)
	note: op template: _16 = REALPART_EXPR <*t1_9(D)>;
	note:       stmt 0 _16 = REALPART_EXPR <*t1_9(D)>;
	note:       stmt 1 _16 = REALPART_EXPR <*t1_9(D)>;
	note:       load permutation { 0 0 }
	note: node (external) 0x51f2578 (max_nunits=1, refcnt=1)
	note:       { _18, _18 }

which costs the cost for the load-and-split and the cost of the external splat,
and the one for blending them while in reality it's just a scalar load and
insert.

The compiler (with the cost model disabled) generates

	ldr     q1, [x19]
	dup     v1.2d, v1.d[0]
	ldr     d0, [x19, 8]
	fneg    d0, d0
	ins     v1.d[1], v0.d[0]

while really it should be

	ldp     d1, d0, [x19]
	fneg    d0, d0
	ins     v1.d[1], v0.d[0]

but that's for another time.

gcc/ChangeLog:

	PR tree-optimization/99656
	* tree-vect-slp-patterns.c (linear_loads_p,
	complex_add_pattern::matches, is_eq_or_top,
	vect_validate_multiplication, complex_mul_pattern::matches,
	complex_fms_pattern::matches): Remove complex_perm_kinds_t.
	* tree-vectorizer.h: (complex_load_perm_t): Removed.
	(slp_tree_to_load_perm_map_t): Use complex_perm_kinds_t instead of
	complex_load_perm_t.

gcc/testsuite/ChangeLog:

	PR tree-optimization/99656
	* gfortran.dg/vect/pr99656.f90: New test.
2021-03-19 14:29:36 +00:00
H.J. Lu
5e2eabe1ee x86: Issue error for return/argument only with function body
If we never generate function body, we shouldn't issue errors for return
nor argument.  Add silent_p to i386 machine_function to avoid issuing
errors for return and argument without function body.

gcc/

	PR target/99652
	* config/i386/i386-options.c (ix86_init_machine_status): Set
	silent_p to true.
	* config/i386/i386.c (init_cumulative_args): Set silent_p to
	false.
	(construct_container): Return early for return and argument
	errors if silent_p is true.
	* config/i386/i386.h (machine_function): Add silent_p.

gcc/testsuite/

	PR target/99652
	* gcc.dg/torture/pr99652-1.c: New test.
	* gcc.dg/torture/pr99652-2.c: Likewise.
	* gcc.target/i386/pr57655.c: Adjusted.
	* gcc.target/i386/pr59794-6.c: Likewise.
	* gcc.target/i386/pr70738-1.c: Likewise.
	* gcc.target/i386/pr96744-1.c: Likewise.
2021-03-19 06:39:51 -07:00
David Malcolm
21d09cb732 analyzer: mark epath_finder with DISABLE_COPY_AND_ASSIGN [PR99614]
cppcheck warns that class epath_finder does dynamic memory allocation, but
is missing a copy constructor and operator=.

This class isn't meant to be copied or assigned, so mark it with
DISABLE_COPY_AND_ASSIGN.

gcc/analyzer/ChangeLog:
	PR analyzer/99614
	* diagnostic-manager.cc (class epath_finder): Add
	DISABLE_COPY_AND_ASSIGN.
2021-03-19 09:01:57 -04:00
Jakub Jelinek
009528d61c arm: Fix mve_vshlq* [PR99593]
As mentioned in the PR, before the r11-6708-gbfab355012ca0f5219da8beb04f2fdaf757d34b7
change v[al]shr<mode>3 expanders were expanding the shifts by register
to gen_ashl<mode>3_{,un}signed which don't support immediate CONST_VECTOR
shift amounts, but now expand to mve_vshlq_<supf><mode> which does.
The testcase ICEs, because the constraint doesn't match the predicate and
because LRA works solely with the constraints, so it can e.g. from REG_EQUAL
propagate there a CONST_VECTOR which matches the constraint but fails the
predicate and only later on other passes will notice the predicate fails
and ICE.

Fixed by adding a constraint that matches the immediate part of the
predicate.

	PR target/99593
	* config/arm/constraints.md (Ds): New constraint.
	* config/arm/vec-common.md (mve_vshlq_<supf><mode>): Use w,Ds
	constraint instead of w,Dm.

	* g++.target/arm/pr99593.C: New test.
2021-03-19 13:48:44 +01:00
Andrew Stubbs
5cded5aff7 amdgcn: Typo fix
gcc/ChangeLog:

	* config/gcn/gcn.c (gcn_parse_amdgpu_hsa_kernel_attribute): Fix quotes
	in error message.
2021-03-19 10:51:43 +00:00
Matthias Klose
3b0155305e substitute @tie{} with a space for the man pages
contrib/

2021-03-19  Matthias Klose  <doko@ubuntu.com>

	* texi2pod.pl: Substitute @tie{} with a space for the man pages.
2021-03-19 10:03:02 +00:00
Eric Botcazou
af73a8b202 Require linker plugin for another LTO test
If it is not present, fat LTO is generated with an additional warning.

gcc/testsuite/
	* g++.dg/lto/pr89335_0.C: Require the linker plugin.
2021-03-19 09:25:23 +01:00
Eric Botcazou
b980edba50 Fix segfault during encoding of CONSTRUCTORs
The segfault occurs in native_encode_initializer when it is encoding the
CONSTRUCTOR for an array whose lower bound is negative (it's OK in Ada).
The computation of the current position is done in HOST_WIDE_INT and this
does not work for arrays whose original range has a negative lower bound
and a positive upper bound; the computation must be done in sizetype
instead so that it may wrap around.

gcc/
	PR middle-end/99641
	* fold-const.c (native_encode_initializer) <CONSTRUCTOR>: For an
	array type, do the computation of the current position in sizetype.
2021-03-19 09:25:23 +01:00
GCC Administrator
287e3e8466 Daily bump. 2021-03-19 00:16:26 +00:00
Marek Polacek
bd9b262fa9 c++: Fix error-recovery with requires expression [PR99500]
This fixes an ICE on invalid code where one of the parameters was
error_mark_node and thus resetting its DECL_CONTEXT crashed.

gcc/cp/ChangeLog:

	PR c++/99500
	* parser.c (cp_parser_requirement_parameter_list): Handle
	error_mark_node.

gcc/testsuite/ChangeLog:

	PR c++/99500
	* g++.dg/cpp2a/concepts-err3.C: New test.
2021-03-18 20:09:44 -04:00
Marek Polacek
96ccb32543 c++: Remove FLOAT_EXPR assert in tsubst.
This assert triggered when pr85013.C was compiled with -fchecking=2
which the usual testing doesn't exercise.  Let's remove it for now
and revisit in GCC 12.

gcc/cp/ChangeLog:

	* pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.
2021-03-18 17:20:32 -04:00
Vladimir N. Makarov
a4670f58eb [PR99422] LRA: Use lookup_constraint only for a single constraint in process_address_1.
This is an additional patch for PR99422.  In process_address_1 we
look only at the first constraint in the 1st alternative
and ignore all other possibilities.  As we don't know what
alternative and constraint will be used at this stage, we can be sure
only for a single constraint with one alternative and should use unknown
constraint for all other cases.

gcc/ChangeLog:

	PR target/99422
	* lra-constraints.c (process_address_1): Use lookup_constraint
	only for a single constraint.
2021-03-18 15:59:15 -04:00
Martin Sebor
30b10dacd0 PR middle-end/99502 - missing -Warray-bounds on partial out of bounds
gcc/ChangeLog:

	PR middle-end/99502
	* gimple-array-bounds.cc (inbounds_vbase_memaccess_p): Rename...
	(inbounds_memaccess_p): ...to this.  Check the ending offset of
	the accessed member.

gcc/testsuite/ChangeLog:

	PR middle-end/99502
	* g++.dg/warn/Warray-bounds-22.C: New test.
	* g++.dg/warn/Warray-bounds-23.C: New test.
	* g++.dg/warn/Warray-bounds-24.C: New test.
2021-03-18 13:38:00 -06:00