Aldy Hernandez [Tue, 25 May 2021 06:36:44 +0000 (08:36 +0200)]
Fix selftest for targets where short and int are the same size.
avr-elf seems to use HImode for both integer_type_node and
signed_char_type_node, which is causing the check for different sized
VARYING ranges to fail.
gcc/ChangeLog:
* value-range.cc (range_tests_legacy): Use
build_nonstandard_integer_type instead of int and short.
Eric Botcazou [Tue, 25 May 2021 16:30:29 +0000 (18:30 +0200)]
Remove stalled TREE_READONLY flag on automatic variable
gcc/
* gimplify.c (gimplify_decl_expr): Clear TREE_READONLY on the DECL
when really creating an initialization statement for it.
Jakub Jelinek [Tue, 25 May 2021 15:24:38 +0000 (17:24 +0200)]
c++: Avoid -Wunused-value false positives on nullptr passed to ellipsis [PR100666]
When passing expressions with decltype(nullptr) type with side-effects to
ellipsis, we pass (void *)0 instead, but for the side-effects evaluate them
on the lhs of a COMPOUND_EXPR. Unfortunately that means we warn about it
if the expression is a call to nodiscard marked function, even when the
result is really used, just needs to be transformed.
Fixed by adding a warning_sentinel.
2021-05-25 Jakub Jelinek <jakub@redhat.com>
PR c++/100666
* call.c (convert_arg_to_ellipsis): For expressions with NULLPTR_TYPE
and side-effects, temporarily disable -Wunused-result warning when
building COMPOUND_EXPR.
* g++.dg/cpp1z/nodiscard8.C: New test.
* g++.dg/cpp1z/nodiscard9.C: New test.
Eric Botcazou [Tue, 25 May 2021 14:51:05 +0000 (16:51 +0200)]
Fix thinko in latest change to setup_one_parameter
gcc/
* tree-inline.c (setup_one_parameter): Fix thinko in new condition.
Jakub Jelinek [Tue, 25 May 2021 14:44:35 +0000 (16:44 +0200)]
c++tools: Include <cstdlib> for exit [PR100731]
This TU uses exit, but doesn't include <stdlib.h> or <cstdlib> and relies
on some other header to include it indirectly, which apparently doesn't
happen on reporter's host.
The other <c*> headers aren't guarded either and we rely on a compiler
capable of C++11, so maybe we can rely on <cstdlib> being around
unconditionally.
2021-05-25 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/100731
* server.cc: Include <cstdlib>.
Kito Cheng [Tue, 25 May 2021 13:26:12 +0000 (21:26 +0800)]
RISC-V: Pass -mno-relax to assembler
gcc/ChangeLog:
* config/riscv/riscv.h (ASM_SPEC): Pass -mno-relax.
Martin Liska [Wed, 10 Mar 2021 14:12:31 +0000 (15:12 +0100)]
Improve global state for options.
gcc/c-family/ChangeLog:
PR tree-optimization/92860
PR target/99592
* c-attribs.c (handle_optimize_attribute): Save target node
before calling parse_optimize_options and save it in case
it changes.
* c-pragma.c (handle_pragma_target): Similarly for pragma.
(handle_pragma_pop_options): Likewise here.
gcc/ChangeLog:
PR tree-optimization/92860
PR target/99592
* optc-save-gen.awk: Remove exceptions.
Martin Liska [Thu, 20 May 2021 07:32:29 +0000 (09:32 +0200)]
Add no_sanitize_coverage attribute.
gcc/ChangeLog:
* asan.h (sanitize_coverage_p): New function.
* doc/extend.texi: Document it.
* fold-const.c (fold_range_test): Use sanitize_flags_p
instead of flag_sanitize_coverage.
(fold_truth_andor): Likewise.
* sancov.c: Likewise.
* tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise.
* ipa-inline.c (sanitize_attrs_match_for_inline_p): Handle
-fsanitize-coverage when inlining.
gcc/c-family/ChangeLog:
* c-attribs.c (handle_no_sanitize_coverage_attribute): New.
gcc/testsuite/ChangeLog:
* gcc.dg/sancov/attribute.c: New test.
Cooper Qu [Tue, 25 May 2021 12:03:48 +0000 (20:03 +0800)]
C-SKY: Fix copyright of csky-modes.def.
The incorrect copyright comment format causes build error:
builddir/source//gcc/gcc/config/csky/csky-modes.def: In function ‘void create_modes()’:
builddir/source//gcc/gcc/config/csky/csky-modes.def:1:4: error: ‘C’ was not declared in this scope
;; C-SKY extra machine modes.
^
builddir/source//gcc/gcc/config/csky/csky-modes.def:1:6: error: ‘SKY’ was not declared in this scope
;; C-SKY extra machine modes.
^
builddir/source//gcc/gcc/config/csky/csky-modes.def:2:16: error: ‘Copyright’ was not declared in this scope
;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
^
builddir/source//gcc/gcc/config/csky/csky-modes.def:3:4: error: ‘Contributed’ was not declared in this scope
;; Contributed by C-SKY Microsystems and Mentor Graphics.
^
gcc/ChangeLog:
* config/csky/csky-modes.def : Fix copyright.
Eric Botcazou [Tue, 25 May 2021 10:12:08 +0000 (12:12 +0200)]
Fix typo and weird syntax in configure script
c++tools/
* configure.ac (--enable-maintainer-mode): Fix typo and weird syntax.
* configure: Regenerate.
Cooper Qu [Tue, 25 May 2021 08:56:58 +0000 (16:56 +0800)]
C-SKY: Amend copyrights of recently added files.
gcc/ChangeLog:
* config/csky/csky-modes.def : Amend copyright.
* config/csky/csky_insn_fpuv2.md : Likewise.
* config/csky/csky_insn_fpuv3.md : Likewise.
gcc/testsuite/ChangeLog:
* gcc.target/csky/fpuv3/fpuv3.exp : Amend copyright.
Richard Biener [Tue, 25 May 2021 09:11:27 +0000 (11:11 +0200)]
libgomp/100747 - fix permission of configure scripts
Added executable bits.
2021-05-25 Richard Biener <rguenther@suse.de>
PR libgomp/100747
liboffloadmic/
* configure: Make executable.
* plugin/configure: Likewise.
Jakub Jelinek [Tue, 25 May 2021 09:11:02 +0000 (11:11 +0200)]
Update copyright years in c++tools
While looking at PR100731, I have noticed the copyright years are 2020-ish
only. This patch adds it to update-copyright.py and updates those.
2021-05-25 Jakub Jelinek <jakub@redhat.com>
contrib/
* update-copyright.py: Add c++tools.
c++tools/
* Makefile.in: Update copyright year.
* configure.ac: Likewise.
* resolver.cc: Likewise.
* resolver.h: Likewise.
* server.cc: Likewise.
(print_version): Update copyright notice date.
Richard Biener [Tue, 25 May 2021 08:21:41 +0000 (10:21 +0200)]
middle-end/100727 - fix call expansion with WITH_SIZE_EXPR arg
call expansion used the result of get_base_address to switch between
ABIs - with get_base_address now never returning NULL we have to
re-instantiate the check in a more explicit way. This also adjusts
mark_addressable to skip WITH_SIZE_EXPRs, consistent with how
build_fold_addr_expr handles it.
2021-05-25 Richard Biener <rguenther@suse.de>
PR middle-end/100727
* calls.c (initialize_argument_information): Explicitely test
for WITH_SIZE_EXPR.
* gimple-expr.c (mark_addressable): Skip outer WITH_SIZE_EXPR.
Jakub Jelinek [Tue, 25 May 2021 09:07:01 +0000 (11:07 +0200)]
openmp: Fix reduction clause handling on teams distribute simd [PR99928]
When a directive isn't combined with worksharing-loop, it takes much
simpler clause splitting path for reduction, and that one was missing
handling of teams when combined with simd.
2021-05-25 Jakub Jelinek <jakub@redhat.com>
PR middle-end/99928
gcc/c-family/
* c-omp.c (c_omp_split_clauses): Copy reduction to teams when teams is
combined with simd and not with taskloop or for.
gcc/testsuite/
* c-c++-common/gomp/pr99928-8.c: Remove xfails from omp teams r21 and
r28 checks.
* c-c++-common/gomp/pr99928-9.c: Likewise.
* c-c++-common/gomp/pr99928-10.c: Likewise.
libgomp/
* testsuite/libgomp.c-c++-common/reduction-17.c: New test.
Martin Liska [Tue, 25 May 2021 08:37:28 +0000 (10:37 +0200)]
Fix sphinx-build warning.
RemovedInSphinx40Warning: app.add_lexer() API changed; Please give lexer class instead of instance
gcc/ada/ChangeLog:
* doc/share/conf.py: Fix Sphinx 4.0.x error.
Geng Qi [Fri, 30 Apr 2021 13:01:31 +0000 (21:01 +0800)]
C-SKY: Add cases for csky fpuv3 instructions.
gcc/testsuite/ChangeLog:
* gcc.target/csky/fpuv3/fpuv3.exp: New.
* gcc.target/csky/fpuv3/fpv3_div.c: New.
* gcc.target/csky/fpuv3/fpv3_fadd.c: New.
* gcc.target/csky/fpuv3/fpv3_fdtos.c: New.
* gcc.target/csky/fpuv3/fpv3_fftoi_rm.c: New.
* gcc.target/csky/fpuv3/fpv3_fftoi_rz.c: New.
* gcc.target/csky/fpuv3/fpv3_fhtos.c: New.
* gcc.target/csky/fpuv3/fpv3_fitof.c: New.
* gcc.target/csky/fpuv3/fpv3_fmov.c: New.
* gcc.target/csky/fpuv3/fpv3_fmovi.c: New.
* gcc.target/csky/fpuv3/fpv3_fmula.c: New.
* gcc.target/csky/fpuv3/fpv3_fmuls.c: New.
* gcc.target/csky/fpuv3/fpv3_fneg.c: New.
* gcc.target/csky/fpuv3/fpv3_fnmula.c: New.
* gcc.target/csky/fpuv3/fpv3_fnmuls.c: New.
* gcc.target/csky/fpuv3/fpv3_fstod.c: New.
* gcc.target/csky/fpuv3/fpv3_fstoh.c: New.
* gcc.target/csky/fpuv3/fpv3_fsub.c: New.
* gcc.target/csky/fpuv3/fpv3_fxtof.c: New.
* gcc.target/csky/fpuv3/fpv3_h.c: New.
* gcc.target/csky/fpuv3/fpv3_hs.c: New.
* gcc.target/csky/fpuv3/fpv3_hsz.c: New.
* gcc.target/csky/fpuv3/fpv3_hz.c: New.
* gcc.target/csky/fpuv3/fpv3_ls.c: New.
* gcc.target/csky/fpuv3/fpv3_lsz.c: New.
* gcc.target/csky/fpuv3/fpv3_lt.c: New.
* gcc.target/csky/fpuv3/fpv3_ltz.c: New.
* gcc.target/csky/fpuv3/fpv3_max.c: New.
* gcc.target/csky/fpuv3/fpv3_min.c: New.
* gcc.target/csky/fpuv3/fpv3_mul.c: New.
* gcc.target/csky/fpuv3/fpv3_mula.c: New.
* gcc.target/csky/fpuv3/fpv3_muls.c: New.
* gcc.target/csky/fpuv3/fpv3_ne.c: New.
* gcc.target/csky/fpuv3/fpv3_nez.c: New.
* gcc.target/csky/fpuv3/fpv3_recip.c: New.
* gcc.target/csky/fpuv3/fpv3_sqrt.c: New.
* gcc.target/csky/fpuv3/fpv3_unordered.c: New.
Tobias Burnus [Tue, 25 May 2021 07:17:07 +0000 (09:17 +0200)]
fortran/intrinsic.texi: Fix copy'n'paste errors and typos
gcc/fortran/ChangeLog:
* intrinsic.texi (GERROR, GETARGS, GETLOG, NORM2, PARITY, RANDOM_INIT,
RANDOM_NUMBER): Fix typos and copy'n'paste errors.
Co-Authored-By: Johannes Nendwich <a08727063@unet.univie.ac.at>
Geng Qi [Mon, 24 May 2021 12:22:55 +0000 (20:22 +0800)]
C-SKY: Separate FRAME_POINTER_REGNUM into FRAME_POINTER_REGNUM and HARD_FRAME_POINTER_REGNUM.
gcc/ChangeLog:
* config/csky/csky.h (FRAME_POINTER_REGNUM): Use
HARD_FRAME_POINTER_REGNUM and FRAME_POINTER_REGNUM instead of
the signle definition. The signle definition may not work well
at simplify_subreg_regno().
(HARD_FRAME_POINTER_REGNUM): New.
(ELIMINABLE_REGS): Add for HARD_FRAME_POINTER_REGNUM.
* config/csky/csky.c (get_csky_live_regs, csky_can_eliminate,
csky_initial_elimination_offset, csky_expand_prologue,
csky_expand_epilogue): Add for HARD_FRAME_POINTER_REGNUM.
Geng Qi [Mon, 24 May 2021 12:22:54 +0000 (20:22 +0800)]
C-SKY: Bug fix for bad setting of TARGET_DSP and TARGET_DIV.
gcc/ChangeLog:
* config/csky/csky.c (csky_option_override):
Init csky_arch_isa_features[] in advance, so TARGET_DSP
and TARGET_DIV can be set well.
Geng Qi [Mon, 24 May 2021 12:22:53 +0000 (20:22 +0800)]
C-SKY: Delete LO_REGS and HI_REGS, use HILO_REGS instead.
gcc/ChangeLog:
* config/csky/constraints.md ("l", "h"): Delete.
* config/csky/csky.h (reg_class, REG_CLASS_NAMES,
REG_CLASS_CONTENTS): Delete LO_REGS and HI_REGS.
* config/csky/csky.c (regno_reg_classm,
csky_secondary_reload, csky_register_move_cost):
Use HILO_REGS instead of LO_REGS and HI_REGS.
Geng Qi [Mon, 24 May 2021 12:22:52 +0000 (20:22 +0800)]
C-SKY: Add fpuv3 instructions and CK860 arch.
gcc/ChangeLog:
* config/csky/constraints.md ("W"): New constriant for mem operand
with base reg, index register.
("Q"): Renamed and modified "csky_valid_fpuv2_mem_operand" to
"csky_valid_mem_constraint_operand" to deal with both "Q" and "W"
constraint.
("Dv"): New constraint for const double value that can be used at
fmovi instruction.
* config/csky/csky-modes.def (HFmode): New mode.
* config/csky/csky-protos.h (csky_valid_fpuv2_mem_operand): Rename
to "csky_valid_mem_constraint_operand" and support new constraint
"W".
(csky_get_movedouble_length): New.
(fpuv3_output_move): New.
(fpuv3_const_double): New.
* config/csky/csky.c (csky_option_override): New arch CK860 with fpv3.
(decompose_csky_address): Refine.
(csky_print_operand): New "CONST_DOUBLE" operand.
(csky_output_move): Support fpv3 instructions.
(csky_get_movedouble_length): New.
(fpuv3_output_move): New.
(fpuv3_const_double): New.
(csky_emit_compare): Cover float comparsion.
(csky_emit_compare_float): Refine.
(csky_vaild_fpuv2_mem_operand): Rename to
"csky_valid_mem_constraint_operand" and support new constraint "W".
(ck860_rtx_costs): New.
(csky_rtx_costs): Add the cost calculation of CK860.
(regno_reg_class): New vregs for fpuv3.
(csky_dbx_regno): Likewise.
(csky_cpu_cpp_builtins): New builtin macro for fpuv3.
(csky_conditional_register_usage): Suporrot fpuv3.
(csky_dwarf_register_span): Suporrot fpuv3.
(csky_init_builtins, csky_mangle_type): Support "__fp16" type.
(ck810_legitimate_index_p): Support fp16.
* config/csky/csky.h (TARGET_TLS): ADD CK860.
(CSKY_VREG_P, CSKY_VREG_LO_P, CSKY_VREG_HI_P): Support fpuv3.
(TARGET_SINGLE_FPU): Support fpuv3.
(TARGET_SUPPORT_FPV3): New.
(FIRST_PSEUDO_REGISTER): Change to 202 to hold the new fpuv3 registers.
(FIXED_REGISTERS, CALL_REALLY_USED_REGISTERS, REGISTER_NAMES,
REG_CLASS_CONTENTS): Support fpuv3.
* config/csky/csky.md (movsf): Move to cksy_insn_fpu.md and refine.
(csky_movsf_fpv2): Likewise.
(ck801_movsf): Likewise.
(csky_movsf): Likewise.
(movdf): Likewise.
(csky_movdf_fpv2): Likewise.
(ck801_movdf): Likewise.
(csky_movdf): Likewise.
(movsicc): Refine. Use "comparison_operatior" instead of
"ordered_comparison_operatior".
(addsicc): Likewise.
(CSKY_FIRST_VFP3_REGNUM, CSKY_LAST_VFP3_REGNUM): New constant.
(call_value_internal_vh): New.
* config/csky/csky_cores.def (CK860): New arch and cpu.
(fpv3_hf): New.
(fpv3_hsf): New.
(fpv3_sdf): New.
(fpv3): New.
* config/csky/csky_insn_fpu.md: Refactor. Separate all float patterns
into emit-patterns and match-patterns, remain the emit-patterns here,
and move the match-patterns to csky_insn_fpuv2.md or
csky_insn_fpuv3.md.
* config/csky/csky_insn_fpuv2.md: New file for fpuv2 instructions.
* config/csky/csky_insn_fpuv3.md: New file and new patterns for fpuv3
isntructions.
* config/csky/csky_isa.def (fcr): New.
(fpv3_hi): New.
(fpv3_hf): New.
(fpv3_sf): New.
(fpv3_df): New.
(CK860): New definition for ck860.
* config/csky/csky_tables.opt (ck860): New processors ck860,
ck860f. And new arch ck860.
(fpv3_hf): New.
(fpv3_hsf): New.
(fpv3_hdf): New.
(fpv3): New.
* config/csky/predicates.md (csky_float_comparsion_operator): Delete
"geu", "gtu", "leu", "ltu", which will never appear at float comparison.
* config/csky/t-csky-elf: Support 860.
* config/csky/t-csky-linux: Likewise.
* doc/md.texi: Add "Q" and "W" constraints for C-SKY.
GCC Administrator [Tue, 25 May 2021 00:16:53 +0000 (00:16 +0000)]
Daily bump.
Ian Lance Taylor [Sun, 23 May 2021 02:19:13 +0000 (19:19 -0700)]
compiler: mark global variables whose address is taken
To implement this, change the backend to use flag bits for variables.
Fixes https://gcc.gnu.org/PR100537
PR go/100537
* go-gcc.cc (class Gcc_backend): Update methods that create
variables to take a flags parameter.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/322129
François Dumont [Tue, 25 Aug 2020 19:31:23 +0000 (21:31 +0200)]
libstdc++: Limit allocation on iterator insertion in Hashtable [PR 96088]
When inserting into unordered_multiset or unordered_multimap first instantiate
the node to store and compute the hash code from it to avoid a potential
intermediate key_type instantiation.
When inserting into unordered_set or unordered_map check if invoking the hash
functor with container key_type is noexcept and invoking the same hash functor
with key part of the iterator value_type can throw. In this case create a
temporary key_type instance at Hashtable level and use it to compute the hash
code. This temporary instance is moved to the final storage location if needed.
libstdc++-v3/ChangeLog:
PR libstdc++/96088
* include/bits/hashtable_policy.h (_Select2nd): New.
(_NodeBuilder<>): New.
(_ReuseOrAllocNode<>::operator()): Use variadic template args.
(_AllocNode<>::operator()): Likewise.
* include/bits/hashtable.h
(_Hashtable<>::__node_builder_t): New.
(_Hashtable<>::_M_insert_unique<>(_Kt&&, _Arg&&, const _NodeGenerator&)):
New.
(_Hashtable<>::_S_forward_key): New.
(_Hashtable<>::_M_insert): Use latter.
(_Hashtable<>::_M_insert(const_iterator, _Arg&&, const _NodeGenerator&, false_type)):
Instantiate node first, compute hash code second.
* testsuite/23_containers/unordered_map/96088.cc: New test.
* testsuite/23_containers/unordered_multimap/96088.cc: New test.
* testsuite/23_containers/unordered_multiset/96088.cc: New test.
* testsuite/23_containers/unordered_set/96088.cc: New test.
* testsuite/util/replacement_memory_operators.h
(counter::_M_increment): New.
(counter::_M_decrement): New.
(counter::reset()): New.
Aaron Sawdey [Wed, 3 Mar 2021 00:06:37 +0000 (18:06 -0600)]
Fusion patterns for add-logical/logical-add
This patch modifies the function in genfusion.pl for generating
the logical-logical patterns so that it can also generate the
add-logical and logical-add patterns which are very similar.
gcc/ChangeLog:
* config/rs6000/genfusion.pl (gen_logical_addsubf): Refactor to
add generation of logical-add and add-logical fusion pairs.
* config/rs6000/rs6000-cpus.def: Add new fusion to ISA 3.1 mask
and powerpc mask.
* config/rs6000/rs6000.c (rs6000_option_override_internal): Turn on
logical-add and add-logical fusion by default.
* config/rs6000/rs6000.opt: Add -mpower10-fusion-logical-add and
-mpower10-fusion-add-logical options.
* config/rs6000/fusion.md: Regenerate file.
gcc/testsuite/ChangeLog:
* gcc.target/powerpc/fusion-p10-logadd.c: New file.
Aldy Hernandez [Mon, 24 May 2021 17:57:29 +0000 (19:57 +0200)]
VARYING ranges of different sizes should not be equal.
VARYING ranges are just normal ranges that span the entire domain. Such
ranges have had end-points for a few releases now, and the fact that the
legacy code was still treating all VR_VARYING the same was an oversight.
This patch fixes the oversight to match the multi-range behavior.
gcc/ChangeLog:
* value-range.cc (irange::legacy_equal_p): Check type when
comparing VR_VARYING types.
(range_tests_legacy): Test comparing VARYING ranges of different
sizes.
Patrick Palka [Mon, 24 May 2021 19:24:44 +0000 (15:24 -0400)]
libstdc++: Fix iterator caching inside range adaptors [PR100479]
This fixes two issues with our iterator caching as described in detail
in the PR. Since we recently added the __non_propagating_cache class
template as part of r12-336 for P2328, this patch just rewrites the
problematic _CachedPosition partial specialization in terms of this
class template.
For the offset partial specialization, it's safe to propagate the cached
offset on copy/move, but we should still invalidate the cached offset in
the source object on move.
libstdc++-v3/ChangeLog:
PR libstdc++/100479
* include/std/ranges (__detail::__non_propagating_cache): Move
definition up to before that of _CachedPosition. Make base
class _Optional_base protected instead of private. Add const
overload for operator*.
(__detail::_CachedPosition): Rewrite the partial specialization
for forward ranges as a derived class of __non_propagating_cache.
Remove the size constraint on the partial specialization for
random access ranges. Add copy/move/copy-assignment/move-assignment
members to the offset partial specialization for random
access ranges that propagate the cached value but additionally
invalidate it in the source object on move.
* testsuite/std/ranges/adaptors/100479.cc: New test.
Jonathan Wakely [Mon, 24 May 2021 17:42:09 +0000 (18:42 +0100)]
libstdc++: Qualify functions used in tests
These tests rely on ADL for some functions, probably unintentionally.
The calls only work because the iterator wrappers derive from
std::iterator and so namespace std is an associated namespace.
libstdc++-v3/ChangeLog:
* testsuite/25_algorithms/inplace_merge/constrained.cc: Qualify
call to ranges::next.
* testsuite/25_algorithms/is_sorted/constrained.cc: Likewise.
* testsuite/25_algorithms/is_sorted_until/constrained.cc:
Likewise.
* testsuite/25_algorithms/swap_ranges/1.cc: Qualify call to
swap_ranges.
Tobias Burnus [Mon, 24 May 2021 14:50:51 +0000 (16:50 +0200)]
OpenMP/Fortran: Handle polymorphic scalars in data-sharing FIRSTPRIVATE [PR86470]
gcc/fortran/ChangeLog:
PR fortran/86470
* trans-expr.c (gfc_copy_class_to_class): Add unshare_expr.
* trans-openmp.c (gfc_is_polymorphic_nonptr,
gfc_is_unlimited_polymorphic_nonptr): New.
(gfc_omp_clause_copy_ctor, gfc_omp_clause_dtor): Handle
polymorphic scalars.
libgomp/ChangeLog:
PR fortran/86470
* testsuite/libgomp.fortran/class-firstprivate-1.f90: New test.
* testsuite/libgomp.fortran/class-firstprivate-2.f90: New test.
* testsuite/libgomp.fortran/class-firstprivate-3.f90: New test.
gcc/testsuite/ChangeLog:
PR fortran/86470
* gfortran.dg/gomp/class-firstprivate-1.f90: New test.
* gfortran.dg/gomp/class-firstprivate-2.f90: New test.
* gfortran.dg/gomp/class-firstprivate-3.f90: New test.
* gfortran.dg/gomp/class-firstprivate-4.f90: New test.
Wilco Dijkstra [Mon, 24 May 2021 13:31:37 +0000 (14:31 +0100)]
AArch64: Enable fast shifts on Neoverse N1
Enable the fast shift feature in Neoverse N1 tuning - this means additions with
a shift left by 1-4 are as fast as addition. This improves multiply by constant
expansions, eg. x * 25 is now emitted using shifts rather than a multiply:
add w0, w0, w0, lsl 2
add w0, w0, w0, lsl 2
ChangeLog:
2020-09-11 Wilco Dijkstra <wdijkstr@arm.com>
* config/aarch64/aarch64.c (neoversen1_tunings):
Enable AARCH64_EXTRA_TUNE_CHEAP_SHIFT_EXTEND.
Wilco Dijkstra [Mon, 24 May 2021 13:23:50 +0000 (14:23 +0100)]
AArch64: Cleanup aarch64_classify_symbol
Use a GOT indirection for extern weak symbols instead of a literal - this is
the same as PIC/PIE and mirrors LLVM behaviour. Ensure PIC/PIE use the same
offset limits for symbols that don't use the GOT.
Passes bootstrap and regress.
ChangeLog:
2021-04-27 Wilco Dijkstra <wdijkstr@arm.com>
* config/aarch64/aarch64.c (aarch64_classify_symbol): Use GOT for
extern weak symbols. Limit symbol offsets for non-GOT symbols with
PIC/PIE.
Christophe Lyon [Thu, 11 Mar 2021 11:08:49 +0000 (11:08 +0000)]
arm: Auto-vectorization for MVE: vld4/vst4
This patch enables MVE vld4/vst4 instructions for auto-vectorization.
We move the existing expanders from neon.md and enable them for MVE,
calling the respective emitter.
2021-03-12 Christophe Lyon <christophe.lyon@linaro.org>
gcc/
* config/arm/neon.md (vec_load_lanesxi<mode>)
(vec_store_lanexoi<mode>): Move ...
* config/arm/vec-common.md: here.
gcc/testsuite/
* gcc.target/arm/simd/mve-vld4.c: New test, derived from
slp-perm-3.c
Christophe Lyon [Mon, 8 Mar 2021 12:23:49 +0000 (12:23 +0000)]
arm: Auto-vectorization for MVE: vld2/vst2
This patch enables MVE vld2/vst2 instructions for auto-vectorization.
We move the existing expanders from neon.md and enable them for MVE,
calling the respective emitter.
2021-03-12 Christophe Lyon <christophe.lyon@linaro.org>
gcc/
* config/arm/neon.md (vec_load_lanesoi<mode>)
(vec_store_lanesoi<mode>): Move ...
* config/arm/vec-common.md: here.
gcc/testsuite/
* gcc.target/arm/simd/mve-vld2.c: New test, derived from
slp-perm-2.c
Wang Liushuai [Mon, 24 May 2021 08:09:29 +0000 (10:09 +0200)]
Do not load the thunk symbols.
gcc/lto/ChangeLog:
* lto-dump.c (get_size): Fix the NPD error about the thunk symbol.
Martin Liska [Mon, 24 May 2021 07:16:01 +0000 (09:16 +0200)]
gcc-changelog: Add note about ChangeLog entries
contrib/ChangeLog:
* gcc-changelog/git_commit.py: Add note that ChangeLog entries
are added automatically.
* gcc-changelog/test_email.py: Update test.
liuhongt [Thu, 20 May 2021 01:59:36 +0000 (09:59 +0800)]
Fix ICE when lhs is NULL.
gcc/ChangeLog:
PR target/100660
* config/i386/i386.c (ix86_gimple_fold_builtin): Replacing
stmt with GIMPLE_NOP when lhs doesn't exist.
gcc/testsuite/ChangeLog:
PR target/100660
* gcc.target/i386/pr100660.c: New test.
Andrew Pinski [Sun, 23 May 2021 17:35:40 +0000 (17:35 +0000)]
Fix two testcases for ssa names which are more than 1 digit
phi-opt-10.c and phi-opt-7.c both depend on currently that some ssa name
versions are one digit long which is not always correct. This fixes the
problem by detecting digits rather than just using '.'.
Committed as obvious after a bootstrap/test.
Thanks,
Andrew Pinski
gcc/testsuite/ChangeLog
* gcc.dg/tree-ssa/phi-opt-10.c: Use "\[0-9\]*" instead of '.'
when matching ssa name version.
* gcc.dg/tree-ssa/phi-opt-7.c: Likewise.
GCC Administrator [Mon, 24 May 2021 00:16:23 +0000 (00:16 +0000)]
Daily bump.
Uros Bizjak [Sun, 23 May 2021 20:14:21 +0000 (22:14 +0200)]
i386: Add push insns for 4-byte vectors [PR100722]
2021-05-23 Uroš Bizjak <ubizjak@gmail.com>
gcc/
PR target/100722
* config/i386/mmx.md (*push<VI_32:mode>2_rex64):
New instruction pattern.
(*push<VI_32:mode>2): Ditto.
(push splitter for SSE registers): New splitter.
gcc/testsuite/
PR target/100722
* gcc.target/i386/pr100722.c: New test.
Harald Anlauf [Sun, 23 May 2021 18:51:14 +0000 (20:51 +0200)]
Fortran: fix passing return value to class(*) dummy argument
gcc/fortran/ChangeLog:
PR fortran/100551
* trans-expr.c (gfc_conv_procedure_call): Adjust check for
implicit conversion of actual argument to an unlimited polymorphic
procedure argument.
gcc/testsuite/ChangeLog:
PR fortran/100551
* gfortran.dg/pr100551.f90: New test.
Martin Liska [Sun, 23 May 2021 12:19:08 +0000 (14:19 +0200)]
Revert "Add ChangeLogs for the previous commit."
This reverts commit
1160d9c1e482ea1dc524c056aa8eeaff6b1a591e.
Martin Liska [Sun, 23 May 2021 12:08:08 +0000 (14:08 +0200)]
Revert "PR98301 Add missing changelog entries."
This reverts commit
c4771b3438a8cd9afcef1762957b763f8df3fa6e.
Tobias Burnus [Sun, 23 May 2021 09:56:39 +0000 (11:56 +0200)]
fortran/intrinsic.texi: Use proper variable name
gcc/fortran/ChangeLog:
* intrinsic.texi (ATOMIC_ADD, ATOMIC_FETCH_ADD): Use the
proper variable name in the description.
Andrew Pinski [Sun, 23 May 2021 08:11:06 +0000 (08:11 +0000)]
Add ChangeLogs for the previous commit.
Andrew Pinski [Sun, 16 May 2021 17:40:16 +0000 (10:40 -0700)]
Don't simplify (A & C) != 0 ? D : 0 for pointer types.
While rewriting part of PHI-OPT to use match-and-simplify,
I ran into a bug where this pattern in match.pd would hit
and would produce invalid gimple; a shift of a pointer type.
This just disables this simplification for pointer types similarly
to what is already done in PHI-OPT for the generic A ? D : 0 case.
OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
Thanks,
Andrew Pinski
2021-5-23 Andrew Pinski <apinski@marvell.com>
gcc/
* match.pd ((A & C) != 0 ? D : 0): Limit to non pointer types.
gcc/testsuite/
* gcc.dg/gimplefe-45.c: New test.
GCC Administrator [Sun, 23 May 2021 00:16:24 +0000 (00:16 +0000)]
Daily bump.
Andre Vehreschild [Sat, 22 May 2021 11:36:31 +0000 (13:36 +0200)]
PR98301 Add missing changelog entries.
Andre Vehreschild [Sat, 22 May 2021 11:27:42 +0000 (13:27 +0200)]
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/98301 - random_init() is broken
Correct implementation of random_init() when -fcoarray=lib is given.
gcc/fortran/ChangeLog:
PR fortran/98301
* trans-decl.c (gfc_build_builtin_function_decls): Move decl.
* trans-intrinsic.c (conv_intrinsic_random_init): Use bool for
lib-call of caf_random_init instead of logical (4-byte).
* trans.h: Add tree var for random_init.
libgfortran/ChangeLog:
PR fortran/98301
* caf/libcaf.h (_gfortran_caf_random_init): New function.
* caf/single.c (_gfortran_caf_random_init): New function.
* gfortran.map: Added fndecl.
* intrinsics/random_init.f90: Implement random_init.
Thomas Schwinge [Sat, 22 May 2021 08:28:34 +0000 (10:28 +0200)]
[OpenACC privatization] Prune uninteresting/varying diagnostics in 'libgomp.oacc-fortran/privatized-ref-2.f90'
Minor fix-up for my recent commit
11b8286a83289f5b54e813f14ff56d730c3f3185
"[OpenACC privatization] Largely extend diagnostics and corresponding testsuite
coverage [PR90115]".
libgomp/
PR testsuite/90115
* testsuite/libgomp.oacc-fortran/privatized-ref-2.f90: Prune
uninteresting/varying diagnostics.
Reported-by: Sunil K Pandey <skpandey@sc.intel.com>
Aaron Sawdey [Sat, 22 May 2021 02:59:39 +0000 (21:59 -0500)]
Fix rs6000 p10 fusion patterns with old attr type names
Somehow I managed to check in a version of genfusion.pl this
afternoon that was not updated to the new insn attr type names.
Committing as obvious and to make the code match what was posted
and reviewed.
gcc/
* config/rs6000/genfusion.pl (gen_addadd): Fix incorrect attr types.
* config/rs6000/fusion.md: Regenerate file.
GCC Administrator [Sat, 22 May 2021 00:16:29 +0000 (00:16 +0000)]
Daily bump.
Aaron Sawdey [Tue, 26 Jan 2021 03:11:52 +0000 (21:11 -0600)]
combine patterns for add-add fusion
This patch adds a function to genfusion.pl to add a couple
more patterns so combine can do fusion of pairs of add and
vaddudm instructions.
gcc/ChangeLog:
* config/rs6000/genfusion.pl (gen_addadd): New function.
* config/rs6000/fusion.md: Regenerate file.
* config/rs6000/rs6000-cpus.def: Add
OPTION_MASK_P10_FUSION_2ADD to masks.
* config/rs6000/rs6000.c (rs6000_option_override_internal):
Handle default value of OPTION_MASK_P10_FUSION_2ADD.
* config/rs6000/rs6000.opt: Add -mpower10-fusion-2add.
gcc/testsuite/ChangeLog:
* gcc.target/powerpc/fusion-p10-addadd.c: New file.
Aaron Sawdey [Fri, 11 Dec 2020 19:47:12 +0000 (13:47 -0600)]
Test cases for p10 fusion patterns
This adds some test cases to make sure that the combine patterns for p10
fusion are working.
gcc/testsuite/ChangeLog:
* gcc.target/powerpc/fusion-p10-ldcmpi.c: New file.
* gcc.target/powerpc/fusion-p10-2logical.c: New file.
Jakub Jelinek [Fri, 21 May 2021 19:16:21 +0000 (21:16 +0200)]
openmp: Fix up firstprivate+lastprivate clause handling [PR99928]
The C/C++ clause splitting happens very early during construct parsing,
but only the FEs later on handle possible instantiations, non-static
member handling and array section lowering.
In the OpenMP 5.0/5.1 rules, whether firstprivate is added to combined
target depends on whether it isn't also mentioned in lastprivate or map
clauses, but unfortunately I think such checks are much better done only
when the FEs perform all the above mentioned changes.
So, this patch arranges for the firstprivate clause to be copied or moved
to combined target construct (as before), but sets flags on that clause,
which tell the FE *finish_omp_clauses and the gimplifier it has been added
only conditionally and let the FEs and gimplifier DTRT for these.
2021-05-21 Jakub Jelinek <jakub@redhat.com>
PR middle-end/99928
gcc/
* tree.h (OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET): Define.
* gimplify.c (enum gimplify_omp_var_data): Fix up
GOVD_MAP_HAS_ATTACHMENTS value, add GOVD_FIRSTPRIVATE_IMPLICIT.
(omp_lastprivate_for_combined_outer_constructs): If combined target
has GOVD_FIRSTPRIVATE_IMPLICIT set for the decl, change it to
GOVD_MAP | GOVD_SEEN.
(gimplify_scan_omp_clauses): Set GOVD_FIRSTPRIVATE_IMPLICIT for
firstprivate clauses with OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT.
(gimplify_adjust_omp_clauses): For firstprivate clauses with
OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT either clear that bit and
OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET too, or remove it and
let it be replaced by implicit map clause.
gcc/c-family/
* c-omp.c (c_omp_split_clauses): Set OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT
on firstprivate clause copy going to target construct, and for
target simd set also OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET bit.
gcc/c/
* c-typeck.c (c_finish_omp_clauses): Move firstprivate clauses with
OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain. Don't error
if a decl is mentioned both in map clause and in such firstprivate
clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
gcc/cp/
* semantics.c (finish_omp_clauses): Move firstprivate clauses with
OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT to the end of the chain. Don't error
if a decl is mentioned both in map clause and in such firstprivate
clause unless OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET is also set.
gcc/testsuite/
* c-c++-common/gomp/pr99928-3.c: Remove all xfails.
* c-c++-common/gomp/pr99928-15.c: New test.
Jakub Jelinek [Fri, 21 May 2021 19:13:06 +0000 (21:13 +0200)]
openmp: Fix up handling of implicit lastprivate on outer constructs for implicit linear and lastprivate IVs [PR99928]
This patch fixes the handling of lastprivate propagation to outer combined/composite
leaf constructs from implicit linear or lastprivate clauses on simd IVs and adds missing
testsuite coverage for explicit and implicit lastprivate on simd IVs.
2021-05-21 Jakub Jelinek <jakub@redhat.com>
PR middle-end/99928
* gimplify.c (omp_lastprivate_for_combined_outer_constructs): New
function.
(gimplify_scan_omp_clauses) <case OMP_CLAUSE_LASTPRIVATE>: Use it.
(gimplify_omp_for): Likewise.
* c-c++-common/gomp/pr99928-6.c: Remove all xfails.
* c-c++-common/gomp/pr99928-13.c: New test.
* c-c++-common/gomp/pr99928-14.c: New test.
Thomas Schwinge [Fri, 21 May 2021 06:51:47 +0000 (08:51 +0200)]
[OpenACC privatization] Reject 'static', 'external' in blocks [PR90115]
gcc/
PR middle-end/90115
* omp-low.c (oacc_privatization_candidate_p): Reject 'static',
'external' in blocks.
gcc/testsuite/
PR middle-end/90115
* c-c++-common/goacc/privatization-1-compute-loop.c: Update.
* c-c++-common/goacc/privatization-1-compute.c: Likewise.
* c-c++-common/goacc/privatization-1-routine_gang-loop.c:
Likewise.
* c-c++-common/goacc/privatization-1-routine_gang.c: Likewise.
libgomp/
PR middle-end/90115
* testsuite/libgomp.oacc-c-c++-common/static-variable-1.c: Update.
* testsuite/libgomp.oacc-fortran/privatized-ref-2.f90: Likewise.
Thomas Schwinge [Thu, 20 May 2021 14:11:37 +0000 (16:11 +0200)]
[OpenACC privatization] Largely extend diagnostics and corresponding testsuite coverage [PR90115]
gcc/
PR middle-end/90115
* flag-types.h (enum openacc_privatization): New.
* params.opt (-param=openacc-privatization): New.
* doc/invoke.texi (openacc-privatization): Document it.
* omp-general.h (get_openacc_privatization_dump_flags): New
function.
* omp-low.c (oacc_privatization_candidate_p): Add diagnostics.
* omp-offload.c (execute_oacc_device_lower)
<IFN_UNIQUE_OACC_PRIVATE>: Re-work diagnostics.
* target.def (goacc.adjust_private_decl): Add 'location_t'
parameter.
* doc/tm.texi: Regenerate.
* config/gcn/gcn-protos.h (gcn_goacc_adjust_private_decl): Adjust.
* config/gcn/gcn-tree.c (gcn_goacc_adjust_private_decl): Likewise.
* config/nvptx/nvptx.c (nvptx_goacc_adjust_private_decl):
Likewise. Preserve it for...
(nvptx_goacc_expand_var_decl): ... use here.
gcc/testsuite/
PR middle-end/90115
* c-c++-common/goacc/privatization-1-compute-loop.c: New file.
* c-c++-common/goacc/privatization-1-compute.c: Likewise.
* c-c++-common/goacc/privatization-1-routine_gang-loop.c:
Likewise.
* c-c++-common/goacc/privatization-1-routine_gang.c: Likewise.
* gfortran.dg/goacc/privatization-1-compute-loop.f90: Likewise.
* gfortran.dg/goacc/privatization-1-compute.f90: Likewise.
* gfortran.dg/goacc/privatization-1-routine_gang-loop.f90:
Likewise.
* gfortran.dg/goacc/privatization-1-routine_gang.f90: Likewise.
* c-c++-common/goacc-gomp/nesting-1.c: Update.
* c-c++-common/goacc/private-reduction-1.c: Likewise.
* gfortran.dg/goacc/private-3.f95: Likewise.
libgomp/
PR middle-end/90115
* testsuite/libgomp.oacc-fortran/private-atomic-1-vector.f90: New
file.
* testsuite/libgomp.oacc-c-c++-common/firstprivate-1.c: Update.
* testsuite/libgomp.oacc-c-c++-common/host_data-7.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-decompose-1.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-local-worker-1.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-local-worker-2.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-local-worker-3.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-local-worker-4.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-local-worker-5.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-gang-1.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-gang-2.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-gang-3.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-gang-4.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-gang-5.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-gang-6.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-vector-1.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-vector-2.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-worker-1.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-worker-2.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-worker-3.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-worker-4.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-worker-5.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-worker-6.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/kernels-private-vars-loop-worker-7.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-g-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-g-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-gwv-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-gwv-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-red-g-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-red-gwv-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-red-v-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-red-v-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-red-wv-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-v-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-w-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-wv-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-reduction.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/private-atomic-1-gang.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/private-atomic-1.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/private-variables.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/routine-4.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/static-variable-1.c:
Likewise.
* testsuite/libgomp.oacc-fortran/acc_on_device-1-1.f90: Likewise.
* testsuite/libgomp.oacc-fortran/acc_on_device-1-2.f: Likewise.
* testsuite/libgomp.oacc-fortran/acc_on_device-1-3.f: Likewise.
* testsuite/libgomp.oacc-fortran/declare-1.f90: Likewise.
* testsuite/libgomp.oacc-fortran/host_data-5.F90: Likewise.
* testsuite/libgomp.oacc-fortran/if-1.f90: Likewise.
* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-gang-1.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-gang-2.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-gang-3.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-gang-6.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-vector-1.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-vector-2.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-worker-1.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-worker-2.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-worker-3.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-worker-4.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-worker-5.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-worker-6.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/kernels-private-vars-loop-worker-7.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/optional-private.f90: Likewise.
* testsuite/libgomp.oacc-fortran/parallel-dims.f90: Likewise.
* testsuite/libgomp.oacc-fortran/private-atomic-1-gang.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/private-atomic-1-worker.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/private-variables.f90: Likewise.
* testsuite/libgomp.oacc-fortran/privatized-ref-2.f90: Likewise.
* testsuite/libgomp.oacc-fortran/routine-7.f90: Likewise.
Thomas Schwinge [Tue, 18 May 2021 15:30:34 +0000 (17:30 +0200)]
Add '__OPTIMIZE__' DejaGnu selector
gcc/testsuite/
* lib/target-supports.exp (check_effective_target___OPTIMIZE__):
New proc.
* gcc.c-torture/compile/ssa-unused-1.c: New file.
gcc/
* doc/sourcebuild.texi (Other attributes): Document '__OPTIMIZE__'
DejaGnu selector.
Thomas Schwinge [Thu, 20 May 2021 13:55:18 +0000 (15:55 +0200)]
[OpenACC privatization] Explain OpenACC privatization candidate selection [PR90115]
gcc/
PR middle-end/90115
* omp-low.c (oacc_privatization_candidate_p): New function.
(oacc_privatization_scan_clause_chain)
(oacc_privatization_scan_decl_chain): Use it. Also
'gcc_checking_assert' that we're not seeing duplicates.
Thomas Schwinge [Thu, 20 May 2021 13:45:06 +0000 (15:45 +0200)]
[OpenACC privatization] Skip processing if no work to be done [PR90115]
gcc/
PR middle-end/90115
* omp-offload.c (execute_oacc_device_lower): Skip processing if no
work to be done.
Thomas Schwinge [Thu, 20 May 2021 13:44:09 +0000 (15:44 +0200)]
[OpenACC privatization] Explain two different configurations [PR90115]
gcc/
PR middle-end/90115
* omp-offload.c (execute_oacc_device_lower): Explain.
Thomas Schwinge [Thu, 20 May 2021 13:37:07 +0000 (15:37 +0200)]
[OpenACC privatization] Don't let unhandled 'IFN_UNIQUE_OACC_PRIVATE' linger [PR90115]
Make sure they're all handled in 'execute_oacc_device_lower'. Why we at all
can have 'level == -1' cases is a separate bug to be fixed.
gcc/
PR middle-end/90115
* omp-offload.c (execute_oacc_device_lower)
<IFN_UNIQUE_OACC_PRIVATE>: Diagnose and handle for 'level == -1'
case, too.
* internal-fn.c (expand_UNIQUE): Don't expect
'IFN_UNIQUE_OACC_PRIVATE'.
Thomas Schwinge [Thu, 20 May 2021 13:22:24 +0000 (15:22 +0200)]
[OpenACC privatization] Don't evaluate OpenMP 'for' clauses [PR90115]
gcc/
PR middle-end/90115
* omp-low.c (lower_omp_for): Don't evaluate OpenMP 'for' clauses.
Thomas Schwinge [Thu, 20 May 2021 13:08:38 +0000 (15:08 +0200)]
[OpenACC privatization, nvptx] Tighten some aspects [PR90115]
No functional change.
gcc/
PR middle-end/90115
* config/nvptx/nvptx.c (nvptx_goacc_adjust_private_decl)
(nvptx_goacc_expand_var_decl): Tighten.
Julian Brown [Fri, 26 Feb 2021 12:34:49 +0000 (04:34 -0800)]
openacc: Add support for gang local storage allocation in shared memory [PR90115]
This patch implements a method to track the "private-ness" of
OpenACC variables declared in offload regions in gang-partitioned,
worker-partitioned or vector-partitioned modes. Variables declared
implicitly in scoped blocks and those declared "private" on enclosing
directives (e.g. "acc parallel") are both handled. Variables that are
e.g. gang-private can then be adjusted so they reside in GPU shared
memory.
The reason for doing this is twofold: correct implementation of OpenACC
semantics, and optimisation, since shared memory might be faster than
the main memory on a GPU. Handling of private variables is intimately
tied to the execution model for gangs/workers/vectors implemented by
a particular target: for current targets, we use (or on mainline, will
soon use) a broadcasting/neutering scheme.
That is sufficient for code that e.g. sets a variable in worker-single
mode and expects to use the value in worker-partitioned mode. The
difficulty (semantics-wise) comes when the user wants to do something like
an atomic operation in worker-partitioned mode and expects a worker-single
(gang private) variable to be shared across each partitioned worker.
Forcing use of shared memory for such variables makes that work properly.
In terms of implementation, the parallelism level of a given loop is
not fixed until the oaccdevlow pass in the offload compiler, so the
patch delays fixing the parallelism level of variables declared on or
within such loops until the same point. This is done by adding a new
internal UNIQUE function (OACC_PRIVATE) that lists (the address of) each
private variable as an argument, and other arguments set so as to be able
to determine the correct parallelism level to use for the listed
variables. This new internal function fits into the existing scheme for
demarcating OpenACC loops, as described in comments in the patch.
Two new target hooks are introduced: TARGET_GOACC_ADJUST_PRIVATE_DECL and
TARGET_GOACC_EXPAND_VAR_DECL. The first can tweak a variable declaration
at oaccdevlow time, and the second at expand time. The first or both
of these target hooks can be used by a given offload target, depending
on its strategy for implementing private variables.
This patch updates the TARGET_GOACC_ADJUST_PRIVATE_DECL target hook in
the AMD GCN backend to the current name and prototype. (An earlier
version of the hook was already present, but dormant.)
gcc/
PR middle-end/90115
* doc/tm.texi.in (TARGET_GOACC_EXPAND_VAR_DECL)
(TARGET_GOACC_ADJUST_PRIVATE_DECL): Add documentation hooks.
* doc/tm.texi: Regenerate.
* expr.c (expand_expr_real_1): Expand decls using the
expand_var_decl OpenACC hook if defined.
* internal-fn.c (expand_UNIQUE): Handle IFN_UNIQUE_OACC_PRIVATE.
* internal-fn.h (IFN_UNIQUE_CODES): Add OACC_PRIVATE.
* omp-low.c (omp_context): Add oacc_privatization_candidates
field.
(lower_oacc_reductions): Add PRIVATE_MARKER parameter. Insert
before fork.
(lower_oacc_head_tail): Add PRIVATE_MARKER parameter. Modify
private marker's gimple call arguments, and pass it to
lower_oacc_reductions.
(oacc_privatization_scan_clause_chain)
(oacc_privatization_scan_decl_chain, lower_oacc_private_marker):
New functions.
(lower_omp_for, lower_omp_target, lower_omp_1): Use these.
* omp-offload.c (convert.h): Include.
(oacc_loop_xform_head_tail): Treat private-variable markers like
fork/join when transforming head/tail sequences.
(struct var_decl_rewrite_info): Add struct.
(oacc_rewrite_var_decl, is_sync_builtin_call): New functions.
(execute_oacc_device_lower): Support rewriting gang-private
variables using target hook, and fix up addr_expr and var_decl
nodes afterwards.
* target.def (adjust_private_decl, expand_var_decl): New hooks.
* config/gcn/gcn-protos.h (gcn_goacc_adjust_gangprivate_decl):
Rename to...
(gcn_goacc_adjust_private_decl): ...this.
* config/gcn/gcn-tree.c (gcn_goacc_adjust_gangprivate_decl):
Rename to...
(gcn_goacc_adjust_private_decl): ...this. Add LEVEL parameter.
* config/gcn/gcn.c (TARGET_GOACC_ADJUST_GANGPRIVATE_DECL): Rename
definition using gcn_goacc_adjust_gangprivate_decl...
(TARGET_GOACC_ADJUST_PRIVATE_DECL): ...to this, using
gcn_goacc_adjust_private_decl.
* config/nvptx/nvptx.c (tree-pretty-print.h): Include.
(gang_private_shared_size): New global variable.
(gang_private_shared_align): Likewise.
(gang_private_shared_sym): Likewise.
(gang_private_shared_hmap): Likewise.
(nvptx_option_override): Initialize these.
(nvptx_file_end): Output gang_private_shared_sym.
(nvptx_goacc_adjust_private_decl, nvptx_goacc_expand_var_decl):
New functions.
(nvptx_set_current_function): Clear gang_private_shared_hmap.
(TARGET_GOACC_ADJUST_PRIVATE_DECL): Define hook.
(TARGET_GOACC_EXPAND_VAR_DECL): Likewise.
libgomp/
PR middle-end/90115
* testsuite/libgomp.oacc-c-c++-common/private-atomic-1-gang.c: New
test.
* testsuite/libgomp.oacc-fortran/private-atomic-1-gang.f90:
Likewise.
* testsuite/libgomp.oacc-fortran/private-atomic-1-worker.f90:
Likewise.
Co-Authored-By: Chung-Lin Tang <cltang@codesourcery.com>
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
H.J. Lu [Fri, 21 May 2021 12:52:11 +0000 (05:52 -0700)]
x86: Remove MAX_BITSIZE_MODE_ANY_INT
It is only defined for i386 and everyone uses the default:
#define MAX_BITSIZE_MODE_ANY_INT (64*BITS_PER_UNIT)
Whatever problems we had before, they have been fixed now.
* config/i386/i386-modes.def (MAX_BITSIZE_MODE_ANY_INT): Removed.
H.J. Lu [Fri, 21 May 2021 12:16:20 +0000 (05:16 -0700)]
Elide expand_constructor if move by pieces is preferred
Elide expand_constructor when the constructor is static storage and not
mostly zeros and we can move it by pieces prefer to do so since that's
usually more efficient than performing a series of stores from immediates.
2021-05-21 Richard Biener <rguenther@suse.de>
H.J. Lu <hjl.tools@gmail.com>
gcc/
PR middle-end/90773
* expr.c (expand_constructor): Elide expand_constructor if
move by pieces is preferred.
gcc/testsuite/
* gcc.target/i386/pr90773-24.c: New test.
* gcc.target/i386/pr90773-25.c: Likewise.
Thomas Schwinge [Fri, 21 May 2021 07:03:43 +0000 (09:03 +0200)]
Don't skip 'libgomp.oacc-fortran/privatized-ref-2.f90' for nvptx offloading
libgomp/
* testsuite/libgomp.oacc-fortran/privatized-ref-2.f90: Don't skip
for nvptx offloading.
Tobias Burnus [Wed, 3 Jun 2020 13:35:12 +0000 (15:35 +0200)]
Add 'libgomp.oacc-fortran/privatized-ref-2.f90'
libgomp/
* testsuite/libgomp.oacc-fortran/privatized-ref-2.f90: New.
Kyrylo Tkachov [Fri, 21 May 2021 13:46:00 +0000 (14:46 +0100)]
aarch64: Add attributes for builtins specified in aarch64-builtins.c
Besides the builtins in aarch64-simd-builtins.def there are a number of builtins defined in aarch64-builtins.c itself.
They could also benefit from the attributes generated by aarch64_get_attributes.
However aarch64_get_attributes and its helpers are only set up to handle a aarch64_simd_builtin_datum.
This patch changes these functions to instead take a flag and mode value that are extracted from
aarch64_simd_builtin_datum.flags and aarch64_simd_builtin_datum.mode anyway.
Then the various builtin init functions in aarch64-builtins.c can pass down their own FLAG_* flags
that they want to derive attributes from.
gcc/ChangeLog:
* config/aarch64/aarch64-builtins.c (aarch64_call_properties):
Take a flag and mode value as arguments.
(aarch64_modifies_global_state_p): Likewise.
(aarch64_reads_global_state_p): Likewise.
(aarch64_could_trap_p): Likewise.
(aarch64_get_attributes): Likewise.
(aarch64_init_simd_builtins): Adjust callsite of above.
(aarch64_init_fcmla_laneq_builtins): Use aarch64_get_attributes to get
function attributes to apply to builtins.
(aarch64_init_crc32_builtins): Likewise.
(aarch64_init_builtin_rsqrt): Likewise.
Aaron Sawdey [Tue, 2 Mar 2021 23:50:52 +0000 (17:50 -0600)]
Add insn types for fusion pairs
This adds new values for insn attr type for p10 fusion. The genfusion.pl
script is modified to use them, and fusion.md regenerated to capture
the new patterns. There are also some formatting only changes to
fusion.md that apparently weren't captured after a previous commit
of genfusion.pl.
gcc/
* config/rs6000/rs6000.md (define_attr "type"): Add types for fusion.
* config/rs6000/genfusion.pl (gen_ld_cmpi_p10): Use new fusion types.
(gen_2logical): Use new fusion types.
* config/rs6000/fusion.md: Regenerate.
Uros Bizjak [Fri, 21 May 2021 11:03:04 +0000 (13:03 +0200)]
i386: Add comparisons for 4-byte vectors [PR100637]
2021-05-21 Uroš Bizjak <ubizjak@gmail.com>
gcc/
PR target/100637
* config/i386/i386-expand.c (ix86_expand_sse_movcc):
Handle V4QI and V2HI modes.
(ix86_expand_sse_movcc): Ditto.
* config/i386/mmx.md (*<sat_plusminus:insn><VI_32:mode>3):
New instruction pattern.
(*eq<VI_32:mode>3): Ditto.
(*gt<VI_32:mode>3): Ditto.
(*xop_pcmov_<VI_32:mode>): Ditto.
(mmx_pblendvb32): Ditto.
(mmx_pblendvb64): Rename from mmx_pblendvb.
(vec_cmp<VI_32:mode><VI_32:mode>): New expander.
(vec_cmpu<VI_32:mode><VI_32:mode>): Ditto.
(vcond<VI_32:mode><VI_32:mode>): Ditto.
(vcondu<VI_32:mode><VI_32:mode>): Ditto.
(vcond_mask_<VI_32:mode><VI_32:mode>): Ditto.
gcc/testsuite/
PR target/100637
* g++.target/i386/pr100637-1b.C: New test.
* g++.target/i386/pr100637-1w.C: Ditto.
* gcc.target/i386/pr100637-2b.c: Ditto.
* gcc.target/i386/pr100637-2w.c: Ditto.
Piotr Trojanek [Fri, 21 May 2021 09:30:26 +0000 (11:30 +0200)]
Detect illegal conditions in Raise_xxx_Error nodes
Enforce comment from sinfo.ads about the Condition field in N_Raise_xxx_Error
nodes. Only an extra sanity check; the behaviour is not affected.
gcc/ada/
* gcc-interface/trans.c (Raise_Error_to_gnu): Add an assertion.
Tamar Christina [Fri, 21 May 2021 09:30:59 +0000 (10:30 +0100)]
libsanitizer: Remove cyclades from libsanitizer
The Linux kernel has removed the interface to cyclades from
the latest kernel headers[1] due to them being orphaned for the
past 13 years.
libsanitizer uses this header when compiling against glibc, but
glibcs itself doesn't seem to have any references to cyclades.
Further more it seems that the driver is broken in the kernel and
the firmware doesn't seem to be available anymore.
As such since this is breaking the build of libsanitizer (and so the
GCC bootstrap[2]) I propose to remove this.
[1] https://lkml.org/lkml/2021/3/2/153
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379
(cherry picked from commit
f7c5351552387bd43f6ca3631016d7f0dfe0f135)
libsanitizer/ChangeLog:
PR sanitizer/100379
* sanitizer_common/sanitizer_common_interceptors_ioctl.inc: Cherry-pick
llvm-project revision
f7c5351552387bd43f6ca3631016d7f0dfe0f135.
* sanitizer_common/sanitizer_platform_limits_posix.cpp: Likewise.
* sanitizer_common/sanitizer_platform_limits_posix.h: Likewise.
Eric Botcazou [Fri, 21 May 2021 09:25:53 +0000 (11:25 +0200)]
Remove discriminant checks in gigi
gcc/ada/
* gcc-interface/utils.c (gnat_pushdecl): Fix typo in comment.
* gcc-interface/utils2.c (build_simple_component_ref): Build NULL_EXPR
if the offset of the field has overflowed.
(build_component_ref): Add gigi checking assertion that the reference
has been built and replace the discriminant check by a Program_Error.
Eric Botcazou [Fri, 21 May 2021 09:19:32 +0000 (11:19 +0200)]
Consistently generate debug info for elaboration variables
This makes sure that debug info is generated for elaboration variables,
even if the variables are not generated exclusively for this purpose.
gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Named_Integer>: Do
not pass default value in call to create_var_decl.
<E_Variable>: Likewise.
<E_Record_Subtype>: Both pass true for const_flag and false for
const_decl_allowed_p in call to create_var_decl.
Small tweaks in the generic record type case.
(elaborate_expression): Rename need_debug into need_for_debug and
adjust throughout.
(elaborate_expression_1): Likewise. Pass Needs_Debug_Info instead
of need_for_debug in call to create_var_decl.
(elaborate_expression_2): Likewise.
* gcc-interface/utils.c (maybe_pad_type): Pass false for
const_decl_allowed_p in call to create_var_decl.
Ghjuvan Lacambre [Fri, 21 May 2021 09:14:13 +0000 (11:14 +0200)]
Replace ? with ?? in warning messages
The former has been deprecated in favor of the latter.
gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_entity): Replace ? with ??.
(gnat_to_gnu_param): Likewise.
(gnat_to_gnu_subprog_type): Likewise.
(warn_on_field_placement): Likewise.
(intrin_arglists_compatible_p): Likewise.
* gcc-interface/trans.c (Pragma_to_gnu): Likewise.
(gnat_to_gnu): Likewise.
(validate_unchecked_conversion): Likewise.
* gcc-interface/utils.c (maybe_pad_type): Likewise.
Eric Botcazou [Fri, 21 May 2021 08:57:02 +0000 (10:57 +0200)]
Fix internal error on locally derived bit-packed array type
This is a regression present on the mainline, 11 and 10 branches,
in the form of an ICE on a locally derived bit-packed array type.
gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Process
the implementation type of a packed type implemented specially.
gcc/testsuite/
* gnat.dg/derived_type7.adb, gnat.dg/derived_type7.ads: New test.
Eric Botcazou [Fri, 21 May 2021 08:45:21 +0000 (10:45 +0200)]
Always translate Is_Pure flag into pure in C sense
Gigi has historically translated the Is_Pure flag of the front-end into
the "const" attribute of GNU C. That's correct for subprograms of pure
Ada units, but not fully exact according to the semantics of the flag.
gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_subprog_type): Always translate
the Is_Pure flag into the "pure" attribute of GNU C.
Eric Botcazou [Fri, 21 May 2021 08:40:41 +0000 (10:40 +0200)]
Fix segfault at run time on strict-alignment platforms
This fixes a regression present on the mainline and 11 branch by
restricting the problematic change dealing with bitfields whose
nomimal subtype is self-referential to the cases where the size
is really lower.
gcc/ada/
* gcc-interface/trans.c (Call_to_gnu): Restrict previous change
to bitfields whose size is not equal to the type size.
(gnat_to_gnu): Likewise.
Jakub Jelinek [Fri, 21 May 2021 08:39:50 +0000 (10:39 +0200)]
tree-optimization: Improve spaceship_replacement [PR94589]
On Wed, May 19, 2021 at 01:30:31PM -0400, Jason Merrill via Gcc-patches wrote:
> Here, when genericizing lexicographical_compare_three_way, we haven't yet
> walked the operands, so (a == a) still sees ADDR_EXPR <a>, but this is after
> we've changed the type of a to REFERENCE_TYPE. When we try to fold (a == a)
> by constexpr evaluation, the constexpr code doesn't understand trying to
> take the address of a reference, and we end up crashing.
>
> Fixed by avoiding constexpr evaluation in genericize_spaceship, by using
> fold_build2 instead of build_new_op on scalar operands. Class operands
> should have been expanded during parsing.
Unfortunately this slightly changed the IL and spaceship_replacement no
longer pattern matches it.
Here are 3 improvements that make it match:
1) as mentioned in the comment above spaceship_replacement, for
strong_ordering, we are pattern matching something like:
x == y ? 0 : x < y ? -1 : 1;
and for partial_ordering
x == y ? 0 : x < y ? -1 : x > y ? 1 : 2;
but given the == comparison done first and the other comparisons only
if == was false, we actually don't care if the other comparisons
are < vs. <= (or > vs. >=), provided the operands of the comparison
are the same; we know == is false when doing those and < vs. <= or
> vs. >= have the same behavior for NaNs too
2) when y is an integral constant, we should treat x < 5 equivalently
to x <= 4 etc.
3) the code punted if cond2_phi_edge wasn't a EDGE_TRUE_VALUE edge, but
as the new IL shows, that isn't really needed; given 1) that
> and >= are equivalent in the code, any of swapping the comparison
operands, changing L[TE]_EXPR to G[TE]_EXPR or vice versa or
swapping the EDGE_TRUE_VALUE / EDGE_FALSE_VALUE bits on the edges
reverses one of the two comparisons
2021-05-21 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/94589
* tree-ssa-phiopt.c (spaceship_replacement): For integral rhs1 and
rhs2, treat x <= 4 equivalently to x < 5 etc. In cmp1 and cmp2 (if
not the same as cmp3) treat <= the same as < and >= the same as >.
Don't require that cond2_phi_edge is true edge, instead take
false/true edges into account based on cmp1/cmp2 comparison kinds.
Eric Botcazou [Fri, 21 May 2021 08:34:00 +0000 (10:34 +0200)]
Fix spurious No_Elaboration violation for Size attribute
We optimize the associated range check but nevertheless flag a violation.
gcc/ada/
* gcc-interface/trans.c (Call_to_gnu): Minor tweaks.
(gnat_to_gnu_external): Likewise.
(Raise_Error_to_gnu): Return an empty statement list if there is a
condition and it is always false.
(gnat_to_gnu): Do not check for elaboration code a priori during the
translation but a posteriori instead.
Eric Botcazou [Fri, 21 May 2021 08:26:50 +0000 (10:26 +0200)]
Fix incorrect SLOC on instruction
This puts the missing SLOC on a statement generated by a return.
gcc/ada/
* gcc-interface/trans.c (gnat_to_gnu) <N_Simple_Return_Statement>:
Put a SLOC on the assignment from the return value to the return
object in the copy-in/copy-out case.
Eric Botcazou [Fri, 21 May 2021 08:19:32 +0000 (10:19 +0200)]
Use EXACT_DIV_EXPR as much as possible
...when the division is exact, typically dividing TYPE_SIZE by BITS_PER_UNIT.
gcc/ada/
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Replace
CEIL_DIV_EXPR with EXACT_DIV_EXPR.
* gcc-interface/misc.c (gnat_type_max_size): Likewise.
* gcc-interface/utils.c (maybe_pad_type): Likewise.
(finish_record_type): Likewise. And always compute the unit size.
Uros Bizjak [Fri, 21 May 2021 06:01:34 +0000 (08:01 +0200)]
i386: Add minmax and abs patterns for 4-byte vectors [PR100637]
2021-05-21 Uroš Bizjak <ubizjak@gmail.com>
gcc/
PR target/100637
* config/i386/mmx.md (SMAXMIN_MMXMODEI): New mode iterator.
(<smaxmin:code><SMAXMIN_MMXMODEI:mode>3): Macroize expander
from <smaxmin:code>v4hi3> and <smaxmin:code><MMXMODE14:mode>3
using SMAXMIN_MMXMODEI mode iterator.
(*<smaxmin:code>v4qi3): New insn pattern.
(*<smaxmin:code>v2hi3): Ditto.
(SMAXMIN_VI_32): New mode iterator.
(<smaxmin:code><SMAXMIN_VI_32>mode3): New expander.
(UMAXMIN_MMXMODEI): New mode iterator.
(<umaxmin:code><UMAXMIN_MMXMODEI:mode>3): Macroize expander
from <umaxmin:code>v8qi3> and <umaxmin:code><MMXMODE24:mode>3
using UMAXMIN_MMXMODEI mode iterator.
(*<umaxmin:code>v4qi3): New insn pattern.
(*<umaxmin:code>v2hi3): Ditto.
(UMAXMIN_VI_32): New mode iterator.
(<umaxmin:code><UMAXMIN_VI_32>mode3): New expander.
(abs<VI_32:mode>2): New insn pattern.
(ssse3_abs<MMXMODEI:mode>2, abs<MMXMODEI:mode>2): Move from ...
* config/i386/sse.md: ... here.
Patrick Palka [Fri, 21 May 2021 04:05:18 +0000 (00:05 -0400)]
libstdc++: Implement LWG 3490 change to drop_while_view::begin()
libstdc++-v3/ChangeLog:
PR libstdc++/100606
* include/std/ranges (drop_while_view::begin): Assert the
precondition added by LWG 3490.
Patrick Palka [Fri, 21 May 2021 03:39:05 +0000 (23:39 -0400)]
libstdc++: Fix access issue in iota_view::_Sentinel [PR100690]
libstdc++-v3/ChangeLog:
PR libstdc++/100690
* include/std/ranges (iota_view::_Sentinel::_M_distance_from):
Split out this member function from ...
(iota_view::_Sentinel::operator-): ... here, for sake of access
control.
* testsuite/std/ranges/iota/iota_view.cc (test05): New test.
GCC Administrator [Fri, 21 May 2021 00:16:57 +0000 (00:16 +0000)]
Daily bump.
David Edelsohn [Thu, 20 May 2021 18:07:18 +0000 (14:07 -0400)]
aix: collect2 text files in archive
Rust places text files in archives. AIX ld ignores such files with a
warning. The collect2 wrapper for ld had been exiting with a fatal
error if it scanned an archive that contained a non-COFF file.
This patch updates collect2.c to issue a warning and ignore the file
member, matching the behavior of AIX ld. GCC can encounter archives
created by Rust and should not issue a fatal error. This changes
fatal_error to warning, with an implicit location and no associated
optimization flag.
gcc/ChangeLog:
2021-05-20 Clement Chigot <clement.chigot@atos.net>
David Edelsohn <dje.gcc@gmail.com>
* collect2.c (scan_prog_file): Issue non-fatal warning for
non-COFF files.
Jason Merrill [Thu, 20 May 2021 01:13:43 +0000 (21:13 -0400)]
c++: designators in single-element init lists
While looking at PR100489, it occurred to me that places that currently
use an initializer-list with a single element to initialize an object of the
same type shouldn't do that if the element has a designator.
gcc/cp/ChangeLog:
* call.c (reference_binding): Check for designator.
(implicit_conversion_1, build_special_member_call): Likewise.
* decl.c (reshape_init_r): Likewise.
* pt.c (do_class_deduction): Likewise.
* typeck2.c (digest_init_r): Likewise.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/desig19.C: New test.
Jason Merrill [Thu, 20 May 2021 01:12:45 +0000 (21:12 -0400)]
c++: designated init with anonymous union [PR100489]
My patch for PR98463 added an assert that tripped on this testcase, because
we ended up with a U CONSTRUCTOR with an initializer for a, which is not a
member of U. We need to wrap the a initializer in another CONSTRUCTOR for
the anonymous union.
There was already support for this in process_init_constructor_record, but
not in process_init_constructor_union. But since this is about brace
elision, it really belongs under reshape_init rather than digest_init, so
this patch moves the handling to reshape_init_class, which also handles
unions.
PR c++/100489
gcc/cp/ChangeLog:
* decl.c (reshape_init_class): Handle designator for
member of anonymous aggregate here.
* typeck2.c (process_init_constructor_record): Not here.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/desig18.C: New test.
Jonathan Wakely [Thu, 20 May 2021 20:12:15 +0000 (21:12 +0100)]
libstdc++: Do not use static_assert without message in C++11
libstdc++-v3/ChangeLog:
* include/bits/random.tcc (__representable_as_double)
(__p1_representable_as_double): Add "" to static asserts.
Jonathan Wakely [Thu, 20 May 2021 15:39:06 +0000 (16:39 +0100)]
libstdc++: Use __builtin_unreachable for constexpr assertions [PR 100676]
The current implementation of compile-time precondition checks causes
compilation to fail by calling a non-constexpr function declared at
block scope. This breaks the CUDA compiler, which wraps some libstdc++
headers in a pragma that declares everything as a __host__ __device__
function, but others are not wrapped and so everything is a __host__
function. The local declaration thus gets redeclared as two different
types of function, which doesn't work.
Just use __builtin_unreachable to make constant evaluation fail, instead
of the local function declaration. Also simplify the assertion macros,
which has the side effect of giving simpler compilation errors when
using Clang.
libstdc++-v3/ChangeLog:
PR libstdc++/100676
* include/bits/c++config (__glibcxx_assert_1): Rename to ...
(__glibcxx_constexpr_assert): ... this.
(__glibcxx_assert_impl): Use __glibcxx_constexpr_assert.
(__glibcxx_assert): Define as either __glibcxx_constexpr_assert
or __glibcxx_assert_impl.
(__glibcxx_assert_2): Remove
* include/debug/macros.h (_GLIBCXX_DEBUG_VERIFY_AT_F): Use
__glibcxx_constexpr_assert instead of __glibcxx_assert_1.
* testsuite/21_strings/basic_string_view/element_access/char/back_constexpr_neg.cc:
Adjust expected error.
* testsuite/21_strings/basic_string_view/element_access/char/constexpr_neg.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/char/front_constexpr_neg.cc:
Likewise.
Likewise.
* testsuite/21_strings/basic_string_view/element_access/wchar_t/back_constexpr_neg.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/wchar_t/constexpr_neg.cc:
Likewise.
* testsuite/21_strings/basic_string_view/element_access/wchar_t/front_constexpr_neg.cc:
Likewise.
* testsuite/23_containers/span/back_neg.cc: Likewise.
* testsuite/23_containers/span/front_neg.cc: Likewise.
* testsuite/23_containers/span/index_op_neg.cc: Likewise.
Jonathan Wakely [Wed, 19 May 2021 20:35:58 +0000 (21:35 +0100)]
c++: Add new warning options for C++ language mismatches
This adds new warning flags, enabled by default: -Wc++11-extensions,
-Wc++14-extensions, -Wc++17-extensions, -Wc++20-extensions, and
-Wc++23-extensions. The names of the flags are copied from Clang, which
already has similar options.
No new diagnostics are added, but the new OPT_Wxxx variables are used to
control existing pedwarns about occurences of new C++ constructs in code
using an old C++ standard dialect. This allows several existing warnings
that cannot currently be disabled to be controlled by the appropriate
-Wno-xxx flag. For example, it will now be possible to disable warnings
about using variadic templates in C++98 code, by using the new
-Wno-c++11-extensions option. This will allow libstdc++ headers to
disable those warnings unconditionally by using diagnostic pragmas, so
that they are not emitted even if -Wsystem-headers is used.
Some of the affected diagnostics are currently only given when
-Wpedantic is used. Now that we have a more specific warning flag, we
could consider making them not depend on -Wpedantic, and only on the new
flag. This patch does not do that, as it intends to make no changes to
what is accepted/rejected by default. The only effect should be that
the new option is shown when -fdiagnostics-show-option is active, and
that some warnings can be disabled by using the new flags (and for the
warnings that previously only dependend on -Wpedantic, it will now be
possible to disable just those warnings while still using -Wpedantic for
its other benefits).
gcc/c-family/ChangeLog:
* c.opt (Wc++11-extensions, Wc++14-extensions)
(Wc++17-extensions, Wc++20-extensions, Wc++23-extensions): New
options.
gcc/cp/ChangeLog:
* call.c (maybe_warn_array_conv): Use new warning option.
* decl.c (mark_inline_variable, grokdeclarator): Likewise.
* error.c (maybe_warn_cpp0x): Likewise.
* parser.c (cp_parser_primary_expression)
(cp_parser_unqualified_id)
(cp_parser_pseudo_destructor_name)
(cp_parser_lambda_introducer)
(cp_parser_lambda_declarator_opt)
(cp_parser_selection_statement)
(cp_parser_init_statement)
(cp_parser_decomposition_declaration)
(cp_parser_function_specifier_opt)
(cp_parser_static_assert)
(cp_parser_namespace_definition)
(cp_parser_using_declaration)
(cp_parser_asm_definition)
(cp_parser_ctor_initializer_opt_and_function_body)
(cp_parser_initializer_list)
(cp_parser_type_parameter_key)
(cp_parser_member_declaration)
(cp_parser_try_block)
(cp_parser_std_attribute_spec): Likewise.
* pt.c (check_template_variable): Likewise.
gcc/ChangeLog:
* doc/invoke.texi (-Wno-c++11-extensions)
(-Wno-c++14-extensions, -Wno-c++17-extensions)
(-Wno-c++20-extensions, -Wno-c++23-extensions): Document
new options.
Indu Bhagat [Fri, 30 Apr 2021 15:03:52 +0000 (08:03 -0700)]
dwarf: new dwarf_debuginfo_p predicate
This patch introduces a dwarf_debuginfo_p predicate that abstracts and
replaces complex checks on write_symbols.
gcc/c-family/ChangeLog:
* c-lex.c (init_c_lex): Use dwarf_debuginfo_p.
gcc/ChangeLog:
* config/c6x/c6x.c (c6x_output_file_unwind): Use dwarf_debuginfo_p.
* config/darwin.c (darwin_override_options): Likewise.
* config/i386/cygming.h (DBX_REGISTER_NUMBER): Likewise.
* config/i386/darwin.h (DBX_REGISTER_NUMBER): Likewise.
(DWARF2_FRAME_REG_OUT): Likewise.
* config/mips/mips.c (mips_output_filename): Likewise.
* config/rs6000/rs6000.c (rs6000_xcoff_declare_function_name):
Likewise.
(rs6000_dbx_register_number): Likewise.
* dbxout.c: Include flags.h.
* dwarf2cfi.c (cfi_label_required_p): Likewise.
(dwarf2out_do_frame): Likewise.
* except.c: Include flags.h.
* final.c (dwarf2_debug_info_emitted_p): Likewise.
(final_scan_insn_1): Likewise.
* flags.h (dwarf_debuginfo_p): New function declaration.
* opts.c (dwarf_debuginfo_p): New function definition.
* targhooks.c (default_debug_unwind_info): Use dwarf_debuginfo_p.
* toplev.c (process_options): Likewise.
Indu Bhagat [Fri, 30 Apr 2021 14:52:40 +0000 (07:52 -0700)]
opts: change write_symbols to support bitmasks
To support multiple debug formats, we need to move away from explicit
enumeration of each individual combination of debug formats.
gcc/c-family/ChangeLog:
* c-opts.c (c_common_post_options): Adjust access to debug_type_names.
* c-pch.c (struct c_pch_validity): Use type uint32_t.
(pch_init): Renamed member.
(c_common_valid_pch): Adjust access to debug_type_names.
gcc/ChangeLog:
* common.opt: Change type to support bitmasks.
* flag-types.h (enum debug_info_type): Rename enumerator constants.
(NO_DEBUG): New bitmask.
(DBX_DEBUG): Likewise.
(DWARF2_DEBUG): Likewise.
(XCOFF_DEBUG): Likewise.
(VMS_DEBUG): Likewise.
(VMS_AND_DWARF2_DEBUG): Likewise.
* flags.h (debug_set_to_format): New function declaration.
(debug_set_count): Likewise.
(debug_set_names): Likewise.
* opts.c (debug_type_masks): Array of bitmasks for debug formats.
(debug_set_to_format): New function definition.
(debug_set_count): Likewise.
(debug_set_names): Likewise.
(set_debug_level): Update access to debug_type_names.
* toplev.c: Likewise.
gcc/objc/ChangeLog:
* objc-act.c (synth_module_prologue): Use uint32_t instead of enum
debug_info_type.
gcc/testsuite/ChangeLog:
* gcc.dg/pch/valid-1.c: Adjust diagnostic message in testcase.
* lib/dg-pch.exp: Adjust diagnostic message.
Martin Sebor [Thu, 20 May 2021 19:15:58 +0000 (13:15 -0600)]
PR middle-end/100684 - spurious -Wnonnull with -O1 on a C++ lambda
gcc/ChangeLog:
PR middle-end/100684
* tree-ssa-ccp.c (pass_post_ipa_warn::execute): Handle C++ lambda.
gcc/testsuite/ChangeLog:
PR middle-end/100684
* g++.dg/warn/Wnonnull13.C: New test.
* g++.dg/warn/Wnonnull14.C: New test.
* g++.dg/warn/Wnonnull15.C: New test.
Bernd Edlinger [Thu, 20 May 2021 18:19:43 +0000 (20:19 +0200)]
Fix a test failure in g++.dg/modules/omp-1_c.C
Adjust the line number due to previous commit,
which added a line for dg-require-effective-target.
2021-05-20 Bernd Edlinger <bernd.edlinger@hotmail.de>
* g++.dg/modules/omp-1_c.C: Fix testcase.
Patrick Palka [Thu, 20 May 2021 18:08:17 +0000 (14:08 -0400)]
libstdc++: Implement missing P0896R4 changes to reverse_iterator [PR100639]
This implements the P0896R4 changes to reverse_iterator's member types
value_type, difference_type and reference in C++20 mode, which fixes
taking the reverse_iterator of an iterator with a non-integral
difference_type (such as iota_view<long long>).
libstdc++-v3/ChangeLog:
PR libstdc++/100639
* include/bits/stl_iterator.h (reverse_iterator::difference_type):
In C++20 mode, define in terms of iter_difference_t as per P0896R4.
(reverse_iterator::reference): Likewise, but with iter_reference_t.
(reverse_iterator::value_type): Likewise, but with iter_value_t.
* testsuite/std/ranges/adaptors/reverse.cc (test08): New test.
* testsuite/24_iterators/reverse_iterator/100639.cc: New test.