Skip to content
Snippets Groups Projects
  1. May 18, 2021
    • Patrick Palka's avatar
      libstdc++: Fix access issue in elements_view::_Sentinel [PR100631] · 38751c4d
      Patrick Palka authored
      In the earlier commit r12-854 I forgot to also rewrite the other operator-
      overload in terms of the split-out member function _M_distance_from.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/100631
      	* include/std/ranges (elements_view::_Sentinel::operator-): Use
      	_M_distance_from in the other operator- overload too.
      	* testsuite/std/ranges/adaptors/elements.cc (test06): Augment test.
      38751c4d
    • Uros Bizjak's avatar
      i386: Fix <any_extend:insn>v4qiv4di2 expander · 8b9484c5
      Uros Bizjak authored
      Fix a mode mismatch.
      
      2021-05-18  Uroš Bizjak  <ubizjak@gmail.com>
      
      gcc/
      	* config/i386/sse.md (<any_extend:insn>v4qiv4di2):
      	Fix a mode mismatch with operand 1.
      8b9484c5
    • Uros Bizjak's avatar
      i386: Fix split_double_mode with paradoxical subreg [PR100626] · d39fbed7
      Uros Bizjak authored
      split_double_mode calls simplify_gen_subreg, which fails for the
      high half of the paradoxical subreg.  Return temporary register
      instead of NULL RTX in this case.
      
      2021-05-18  Uroš Bizjak  <ubizjak@gmail.com>
      
      gcc/
      	PR target/100626
      	* config/i386/i386-expand.c (split_double_mode): Return
      	temporary register when simplify_gen_subreg fails with
      	the high half od the paradoxical subreg.
      d39fbed7
    • Richard Biener's avatar
      Avoid setting TREE_ADDRESSABLE on stack vars during RTL expansion · d3a0208e
      Richard Biener authored
      This avoids setting TREE_ADDRESSABLE on variables we want to force to
      the stack.  Instead track those in a temporary bitmap and force
      stack expansion that way, leaving TREE_ADDRESSABLE alone, not
      pessimizing future alias queries.
      
      2021-05-17  Richard Biener  <rguenther@suse.de>
      
      	* cfgexpand.c (expand_one_var): Pass in forced_stack_var
      	and honor it when expanding.
      	(expand_used_vars_for_block): Pass through forced_stack_var.
      	(expand_used_vars): Likewise.
      	(discover_nonconstant_array_refs_r): Set bits in
      	forced_stack_vars instead of marking vars TREE_ADDRESSABLE.
      	(avoid_type_punning_on_regs): Likewise.
      	(discover_nonconstant_array_refs): Likewise.
      	(pass_expand::execute): Create and pass down forced_stack_var
      	bitmap.  For parameters and returns temporarily set
      	TREE_ADDRESSABLE when expand_function_start.
      d3a0208e
    • Thomas Schwinge's avatar
      [libgomp, testsuite] Don't shadow global 'offload_targets' variable · b5c3145a
      Thomas Schwinge authored
      See local 'offload_targets' variable in
      'libgomp/testsuite/lib/libgomp.exp:libgomp_check_effective_target_offload_target'
      vs. global 'libgomp/testsuite/libgomp-test-support.exp.in:offload_targets'
      variable.
      
      	libgomp/
      	* testsuite/lib/libgomp.exp
      	(check_effective_target_offload_target_nvptx): Don't shadow global
      	'offload_targets' variable.
      b5c3145a
    • Thomas Schwinge's avatar
      'libgomp.c-c++-common/reduction-{5,6}.c': Restrict '-latomic' to nvptx offloading compilation · 937fa5fb
      Thomas Schwinge authored
      Fix-up for recent commit 33b64795
      "OpenMP: Fix SIMT for complex/float reduction with && and ||"; see
      commit d42088e4 "Avoid -latomic for amdgcn
      offloading".
      
      	libgomp/
      	* testsuite/libgomp.c-c++-common/reduction-5.c: Restrict
      	'-latomic' to nvptx offloading compilation.
      	* testsuite/libgomp.c-c++-common/reduction-6.c: Likewise.
      937fa5fb
    • Thomas Schwinge's avatar
      'libgomp.c/target-44.c': Restrict '-latomic' to nvptx offloading compilation · abf937ac
      Thomas Schwinge authored
      Fix-up for recent commit f87990a2
      "[openmp, simt] Disable SIMT for user-defined reduction"; see commit
      d42088e4 "Avoid -latomic for amdgcn
      offloading".
      
      	libgomp/
      	* testsuite/libgomp.c/target-44.c: Restrict '-latomic' to nvptx
      	offloading compilation.
      abf937ac
    • Thomas Schwinge's avatar
      Add 'dg-note', 'dg-lto-note' · 03eb7791
      Thomas Schwinge authored
      That's 'dg-message "note: [...]"' with a twist: inhibit default notes pruning,
      such that "if 'dg-note' is used at least once in a testcase, [notes] are not
      pruned and instead must *all* be handled explicitly".
      
      The rationale is that either you're not interested in notes at all (default
      behavior of pruning all notes), but often, when you're interested in one note,
      you're in fact interested in all notes, and especially interested if
      *additional* notes appear over time, as GCC evolves.
      
      	gcc/testsuite/
      	* lib/gcc-dg.exp: Implement 'dg-note'.
      	* lib/prune.exp: Likewise.
      	* gcc.dg/vect/nodump-vect-opt-info-2.c: Use 'dg-note', and
      	'dg-prune-output "note: ".
      	* gfortran.dg/goacc/routine-external-level-of-parallelism-2.f: Use
      	'dg-note', match up additional notes, one class of them with
      	XFAILed 'dg-bogus'.
      	* lib/lto.exp: Implement 'dg-lto-note'.
      	* g++.dg/lto/odr-1_0.C: Use 'dg-lto-note', match up additional
      	notes.
      	* g++.dg/lto/odr-1_1.C: Likewise.
      	* g++.dg/lto/odr-2_1.C: Likewise.
      	libstdc++-v3/
      	* testsuite/lib/prune.exp: Add note about 'dg-note'.
      	gcc/
      	* doc/sourcebuild.texi: Document 'dg-note'.
      03eb7791
    • Tobias Burnus's avatar
      gcc/configure.ac: Fix cross build by using $(CFLAGS-$@) [PR100598] · 5116b54e
      Tobias Burnus authored
      BUILD_CFLAGS is set by configure; by default, BUILD_CFLAGS = $(ALL_CFLAGS)
      is used. The latter contains (see gcc/Makefile.in) $(CFLAGS-$@), which is used
      to pass .o-file specific flags to the compiler.
      For cross builds, BUILD_CFLAGS is constructed in configure{,.ac} and missed
      the $(CFLAGS-$@) - despite the comment above ALL_CFLAGS that configure.ac
      might have to kept in sync.
      
      gcc/ChangeLog:
      
      	PR other/100598
      	* configure: Regenerate.
      	* configure.ac (BUILD_CFLAG, BUILD_CXXFLAGS): Add $(CFLAGS-$@).
      5116b54e
    • Thomas Schwinge's avatar
      [OMP] Tighten 'is_gimple_omp_oacc' · e1cca880
      Thomas Schwinge authored
      No overall change in behavior.
      
      	gcc/
      	* gimple.h (is_gimple_omp_oacc): Tighten.
      	* omp-low.c (check_omp_nesting_restrictions): Adjust.
      e1cca880
    • Richard Biener's avatar
      operand scanner TLC · 3e2c7158
      Richard Biener authored
      This applies some TLC to mark_address_taken which ends up setting
      TREE_ADDRESSABLE on nodes where it doesn't have any semantics.
      It also does work (incomplete) that get_base_address already does,
      likewise we'll never get WITH_SIZE_EXPR in this context and thus
      get_base_address never fails.
      
      2021-05-18  Richard Biener  <rguenther@suse.de>
      
      	* tree-ssa-operands.c (mark_address_taken): Simplify.
      3e2c7158
    • Martin Liska's avatar
      startswith: Fix offloading targets. · 6806469d
      Martin Liska authored
      gcc/ChangeLog:
      
      	* config/gcn/mkoffload.c (STR): Redefine.
      	* config/i386/intelmic-mkoffload.c (STR): Likewise.
      	* config/nvptx/mkoffload.c (STR): Likewise.
      6806469d
    • Jonathan Wakely's avatar
      gcc-changelog: Remove use of non-strict mode · 7b4bae0a
      Jonathan Wakely authored
      contrib/ChangeLog:
      
      	* gcc-changelog/git_email.py: Remove use of non-strict mode.
      7b4bae0a
    • Martin Liska's avatar
      Use startswith in targets. · c0129e2d
      Martin Liska authored
      gcc/ChangeLog:
      
      	* common/config/aarch64/aarch64-common.c (aarch64_parse_extension):
      	Use startswith function instead of strncmp.
      	* common/config/bfin/bfin-common.c (bfin_handle_option): Likewise.
      	* common/config/riscv/riscv-common.c (riscv_subset_list::parse): Likewise.
      	* config/aarch64/aarch64-sve-builtins-shapes.cc (parse_type): Likewise.
      	* config/aarch64/aarch64.c (aarch64_process_one_target_attr): Likewise.
      	* config/alpha/alpha.c (alpha_elf_section_type_flags): Likewise.
      	* config/arm/aarch-common.c (arm_md_asm_adjust): Likewise.
      	* config/arm/arm.c (arm_file_start): Likewise.
      	(arm_valid_target_attribute_rec): Likewise.
      	(thumb1_md_asm_adjust): Likewise.
      	* config/arm/driver-arm.c (host_detect_local_cpu): Likewise.
      	* config/avr/avr.c (STR_PREFIX_P): Likewise.
      	(avr_set_current_function): Likewise.
      	(avr_handle_addr_attribute): Likewise.
      	(avr_asm_output_aligned_decl_common): Likewise.
      	(avr_asm_named_section): Likewise.
      	(avr_section_type_flags): Likewise.
      	(avr_asm_select_section): Likewise.
      	* config/c6x/c6x.c (c6x_in_small_data_p): Likewise.
      	(c6x_section_type_flags): Likewise.
      	* config/darwin-c.c (darwin_cfstring_ref_p): Likewise.
      	(darwin_objc_declare_unresolved_class_reference): Likewise.
      	(darwin_objc_declare_class_definition): Likewise.
      	* config/darwin.c (indirect_data): Likewise.
      	(darwin_encode_section_info): Likewise.
      	(darwin_objc2_section): Likewise.
      	(darwin_objc1_section): Likewise.
      	(machopic_select_section): Likewise.
      	(darwin_globalize_label): Likewise.
      	(darwin_label_is_anonymous_local_objc_name): Likewise.
      	(darwin_asm_named_section): Likewise.
      	(darwin_asm_output_dwarf_offset): Likewise.
      	* config/frv/frv.c (frv_string_begins_with): Likewise.
      	(frv_in_small_data_p): Likewise.
      	* config/gcn/mkoffload.c (STR): Likewise.
      	(main): Likewise.
      	* config/i386/i386-builtins.c (get_builtin_code_for_version): Likewise.
      	* config/i386/i386-options.c (ix86_option_override_internal): Likewise.
      	* config/i386/i386.c (x86_64_elf_section_type_flags): Likewise.
      	(ix86_md_asm_adjust): Likewise.
      	* config/i386/intelmic-mkoffload.c (STR): Likewise.
      	* config/i386/winnt.c (i386_pe_asm_named_section): Likewise.
      	(i386_pe_file_end): Likewise.
      	* config/ia64/ia64.c (ia64_in_small_data_p): Likewise.
      	(ia64_section_type_flags): Likewise.
      	* config/mips/driver-native.c (host_detect_local_cpu): Likewise.
      	* config/mips/mips.c (mips_handle_interrupt_attr): Likewise.
      	(mips16_stub_function_p): Likewise.
      	(mips_function_rodata_section): Likewise.
      	* config/msp430/msp430.c (msp430_mcu_name): Likewise.
      	(msp430_function_section): Likewise.
      	(msp430_section_type_flags): Likewise.
      	(msp430_expand_helper): Likewise.
      	* config/nios2/nios2.c (nios2_small_section_name_p): Likewise.
      	(nios2_valid_target_attribute_rec): Likewise.
      	* config/nvptx/mkoffload.c (process): Likewise.
      	(STR): Likewise.
      	* config/pa/som.h: Likewise.
      	* config/pdp11/pdp11.c (pdp11_output_ident): Likewise.
      	* config/riscv/riscv.c (riscv_elf_select_rtx_section): Likewise.
      	* config/rs6000/rs6000.c (VTABLE_NAME_P): Likewise.
      	(rs6000_inner_target_options): Likewise.
      	* config/s390/driver-native.c (s390_host_detect_local_cpu): Likewise.
      	* config/sparc/driver-sparc.c (host_detect_local_cpu): Likewise.
      	* config/vax/vax.c (vax_output_int_move): Likewise.
      	* config/vms/vms-ld.c (startswith): Likewise.
      	(process_args): Likewise.
      	(main): Likewise.
      	* config/vms/vms.c: Likewise.
      c0129e2d
    • Jakub Jelinek's avatar
      regcprop: Avoid DCE of asm goto [PR100590] · c81704b3
      Jakub Jelinek authored
      The following testcase ICEs, because copyprop_hardreg_forward_1 decides
      to DCE asm goto with REG_UNUSED notes (because the output is unused and
      asm isn't volatile).  But that DCE just removes the asm goto, leaving
      a bb with two successors and no insn at the end that would allow that.
      
      The following patch makes sure we drop that way only INSNs and not
      JUMP_INSNs or CALL_INSNs.
      
      2021-05-18  Jakub Jelinek  <jakub@redhat.com>
      
      	PR rtl-optimization/100590
      	* regcprop.c (copyprop_hardreg_forward_1): Only DCE dead sets if
      	they are NONJUMP_INSN_P.
      
      	* gcc.dg/pr100590.c: New test.
      c81704b3
    • Jakub Jelinek's avatar
      function: Set dummy DECL_ASSEMBLER_NAME in push_dummy_function [PR100580] · 978b62e5
      Jakub Jelinek authored
      Last year I've added cgraph_node::get_create calls for the dummy
      functions used for -fdump-passes, so that it interacts well with pass
      disabling/enabling which is cgraph uid based.
      Unfortunately, as the following testcase shows, when assembler hash
      is present, that wants to compute DECL_ASSEMBLER_NAME and the C++ FE
      is unprepared to handle it on the dummy functions which don't have
      DECL_NAME etc.
      The following patch fixes it by setting up a dummy DECL_ASSEMBLER_NAME
      on these, so that the FEs don't need to compute it.
      
      2021-05-18  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c++/100580
      	* function.c (push_dummy_function): Set DECL_ARTIFICIAL and
      	DECL_ASSEMBLER_NAME on the fn_decl.
      
      	* g++.dg/other/pr100580.C: New test.
      978b62e5
    • Jakub Jelinek's avatar
      phiopt: Optimize partial_ordering spaceship >= 0 -ffinite-math-only [PR94589] · 65061ea2
      Jakub Jelinek authored
      As mentioned earlier, spaceship_replacement didn't optimize partial_ordering
      >= 0 comparisons, because the possible values are -1, 0, 1, 2 and the
      >= comparison is implemented as (res & 1) == res to choose the 0 and 1
      cases from that.  As we optimize that only with -ffinite-math-only, the
      2 case is assumed not to happen and my earlier match.pd change optimizes
      (res & 1) == res into (res & ~1) == 0, so this patch pattern matches
      that case and handles it like res >= 0.
      
      2021-05-18  Jakub Jelinek  <jakub@redhat.com>
      
      	PR tree-optimization/94589
      	* tree-ssa-phiopt.c (spaceship_replacement): Pattern match
      	phi result used in (res & ~1) == 0 comparison as res >= 0 as
      	res == 2 would be UB with -ffinite-math-only.
      
      	* g++.dg/opt/pr94589-2.C: Adjust scan-tree-dump count from 14 to 12.
      65061ea2
    • Martin Liska's avatar
      genversion should depend on DATESTAMP · b2a09773
      Martin Liska authored
      gcc/ChangeLog:
      
      	* Makefile.in: genversion.o should depend on DATESTAMP.
      b2a09773
    • Claudiu Zissulescu's avatar
      arc: Fix typo in negv2si2 pattern · def010e4
      Claudiu Zissulescu authored
      
      gcc/
      2021-05-18  Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* config/arc/simdext.md (negv2si2): Remove round bracket.
      
      Signed-off-by: default avatarClaudiu Zissulescu <claziss@synopsys.com>
      def010e4
    • Richard Biener's avatar
      Fix gcc.target/i386/pr100582.c with AVX512 · 1e07091d
      Richard Biener authored
      Which generates vpblendmb.
      
      2021-05-18  Richard Biener  <rguenther@suse.de>
      
      gcc/testsuite/
      	* gcc.target/i386/pr100582.c: Adjust for AVX512.
      1e07091d
    • Richard Biener's avatar
      c/100522 - avoid invalid GIMPLE in GIMPLE parsing · 414fe08a
      Richard Biener authored
      This plugs a few easy holes avoiding ICEs down the route.
      
      2021-05-18  Richard Biener  <rguenther@suse.de>
      
      	PR c/100522
      gcc/c/
      	* gimple-parser.c (c_parser_gimple_postfix_expression_after_primary):
      	Diagnose calls to non-functions.
      	(c_parser_gimple_statement): Diagnose unexpected assignment RHS.
      
      gcc/testsuite/
      	* gcc.dg/gimplefe-error-10.c: New testcase.
      414fe08a
    • Richard Biener's avatar
      c/100547 - reject overly large vector_size attributes · 4054472b
      Richard Biener authored
      This rejects a number of vector components that does not fit an 'int'
      which is an internal limitation of RTVEC.  This requires adjusting
      gcc.dg/attr-vector_size.c which checks for much larger
      supported vectors.  Note that the RTVEC limitation is a host specific
      limitation (unless we change this 'int' to int32_t), but should be
      32bits in practice everywhere.
      
      2021-05-12  Richard Biener  <rguenther@suse.de>
      
      	PR c/100547
      gcc/c-family/
      	* c-attribs.c (type_valid_for_vector_size): Reject too large nunits.
      	Reword existing nunit diagnostic.
      
      gcc/testsuite/
      	* gcc.dg/pr100547.c: New testcase.
      	* gcc.dg/attr-vector_size.c: Adjust.
      4054472b
    • Andreas Krebbel's avatar
      IBM Z: Support vector _Bool language extension · 7e75d624
      Andreas Krebbel authored
      _Bool needs to be defined as macro in order to trigger the
      context-sensitive macro expansion mechanism.
      
      gcc/ChangeLog:
      
      	* config/s390/s390-c.c (s390_cpu_cpp_builtins_internal): Define
      	_Bool as macro expanding to _Bool.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/s390/zvector/vec-_Bool.c: New test.
      7e75d624
    • Andreas Krebbel's avatar
      PR100281 C++: Fix SImode pointer handling · 720dff97
      Andreas Krebbel authored
      The problem appears to be triggered by two locations in the front-end
      where non-POINTER_SIZE pointers aren't handled right now.
      
      1. An assertion in strip_typedefs is triggered because the alignment
      of the types don't match. This in turn is caused by creating the new
      type with build_pointer_type instead of taking the type of the
      original pointer into account.
      
      2. An assertion in cp_convert_to_pointer is triggered which expects
      the target type to always have POINTER_SIZE.
      
      gcc/cp/ChangeLog:
      
      	PR c++/100281
      	* cvt.c (cp_convert_to_pointer): Use the size of the target
      	pointer type.
      	* tree.c (cp_build_reference_type): Call
      	cp_build_reference_type_for_mode with VOIDmode.
      	(cp_build_reference_type_for_mode): Rename from
      	cp_build_reference_type.  Add MODE argument and invoke
      	build_reference_type_for_mode.
      	(strip_typedefs): Use build_pointer_type_for_mode and
      	cp_build_reference_type_for_mode for pointers and references.
      
      gcc/ChangeLog:
      
      	PR c++/100281
      	* tree.c (build_reference_type_for_mode)
      	(build_pointer_type_for_mode): Pick pointer mode if MODE argument
      	is VOIDmode.
      	(build_reference_type, build_pointer_type): Invoke
      	build_*_type_for_mode with VOIDmode.
      
      gcc/testsuite/ChangeLog:
      
      	PR c++/100281
      	* g++.target/s390/pr100281-1.C: New test.
      	* g++.target/s390/pr100281-2.C: New test.
      720dff97
    • Patrick Palka's avatar
      libstdc++: Fix up semiregular-box partial specialization [PR100475] · fe993b46
      Patrick Palka authored
      This makes the in-place constructor of our partial specialization of
      __box for already-semiregular types perform direct-non-list-initialization
      (in accordance with the specification of the primary template), and
      additionally makes the member function data() use std::__addressof.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/100475
      	* include/std/ranges (__box::__box): Use non-list-initialization
      	in member initializer list of in-place constructor of the
      	partial specialization for semiregular types.
      	(__box::operator->): Use std::__addressof.
      	* testsuite/std/ranges/adaptors/detail/semiregular_box.cc
      	(test02): New test.
      	* testsuite/std/ranges/single_view.cc (test04): New test.
      fe993b46
    • Patrick Palka's avatar
      libstdc++: Fix condition for memoizing reverse_view::begin() [PR100621] · 03cf8d54
      Patrick Palka authored
      A range being a random access range isn't a sufficient condition for
      ranges::next(iter, sent) to have constant time complexity -- it must
      also have a sized sentinel.  This adjusts the memoization condition for
      reverse_view accordingly.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/100621
      	* include/std/ranges (reverse_view::_S_needs_cached_begin):
      	Set to true if the underlying non-common random-access range
      	doesn't have a sized sentinel.
      03cf8d54
    • Patrick Palka's avatar
      libstdc++: Fix miscellaneous issues with elements_view::_Sentinel [PR100631] · 2e2eef80
      Patrick Palka authored
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/100631
      	* include/std/ranges (elements_view::_Iterator): Also befriend
      	_Sentinel<!_Const>.
      	(elements_view::_Sentinel::_M_equal): Templatize.
      	(elements_view::_Sentinel::_M_distance_from): Split out from ...
      	(elements_view::_Sentinel::operator-): ... here.  Depend on
      	_Base2 instead of _Base in the return type.
      	* testsuite/std/ranges/adaptors/elements.cc (test06, test07):
      	New tests.
      2e2eef80
    • GCC Administrator's avatar
      Daily bump. · a7ffc1ef
      GCC Administrator authored
      a7ffc1ef
  2. May 17, 2021
    • Andrew MacLeod's avatar
      Once a range becomes constant, make it invariant. · 3f476de7
      Andrew MacLeod authored
      Once a range is forced to a constant globally, simply make it invariant.
      Unify this with the code which makes non-zero pointer ranges invariant.
      
      	gcc/
      	PR tree-optimization/100512
      	* gimple-range-cache.cc (ranger_cache::set_global_range): Mark const
      	and non-zero pointer ranges as invariant.
      	* gimple-range.cc (gimple_ranger::range_of_stmt): Remove pointer
      	processing from here.
      
      	gcc/testsuite/
      	PR tree-optimization/100512
      	* gcc.dg/pr100512.c: New.
      3f476de7
    • Serge Belyshev's avatar
      MAINTAINERS: Add myself for write after approval · 5282b2ac
      Serge Belyshev authored
      ChangeLog:
      
      2021-05-17  Serge Belyshev  <belyshev@depni.sinp.msu.ru>
      
      	* MAINTAINERS (Write After Approval): Add myself.
      5282b2ac
    • Kwok Cheung Yeung's avatar
      openmp: Notify team barrier of pending tasks in omp_fulfill_event · ba886d0c
      Kwok Cheung Yeung authored
      The team barrier should be notified of any new tasks that become runnable
      as the result of a completing task, otherwise the barrier threads might
      not resume processing available tasks, resulting in a hang.
      
      2021-05-17  Kwok Cheung Yeung  <kcy@codesourcery.com>
      
      	libgomp/
      	* task.c (omp_fulfill_event): Call gomp_team_barrier_set_task_pending
      	if new tasks generated.
      	* testsuite/libgomp.c-c++-common/task-detach-13.c: New.
      ba886d0c
    • Jonathan Wakely's avatar
      c++: Fix diagnostic for binding lvalue reference to volatile rvalue [PR 100635] · 5d93261b
      Jonathan Wakely authored
      The current diagnostic assumes the reference binding fails because the
      reference is non-const, but it can also fail if the rvalue is volatile.
      
      Use the current diagnostic for non-const cases, and a modified
      diagnostic otherwise.
      
      gcc/cp/ChangeLog:
      
      	PR c++/100635
      	* call.c (convert_like_internal): Print different diagnostic if
      	the lvalue reference is const.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/conversion/pr100635.C: New test.
      5d93261b
    • Harald Anlauf's avatar
      PR fortran/98411 - Pointless warning for static variables · 09867aa0
      Harald Anlauf authored
      Variables with explicit SAVE attribute cannot end up on the stack.
      There is no point in checking whether they should be moved off the
      stack to static storage.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/98411
      	* trans-decl.c (gfc_finish_var_decl): Add check for explicit SAVE
      	attribute.
      
      gcc/testsuite/ChangeLog:
      
      	PR fortran/98411
      	* gfortran.dg/pr98411.f90: New test.
      09867aa0
    • Thomas Rodgers's avatar
      libstdc++: Fix wrong thread waking on notify [PR100334] · 346cbaf5
      Thomas Rodgers authored
      Fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100334
      
      libstdc++-v3/ChangeLog:
      	* include/bits/atomic_wait.h (__waiter::_M_do_wait_v): loop
      	until value change observed.
      	(__waiter_base::_M_laundered): New member.
      	(__waiter_base::_M_notify): Check _M_laundered to determine
      	whether to wake one or all.
      	(__detail::__atomic_compare): Return true if call to
      	__builtin_memcmp() == 0.
      	(__waiter_base::_S_do_spin_v): Adjust predicate.
      	* testsuite/29_atomics/atomic/wait_notify/100334.cc: New
      	test.
      346cbaf5
    • Tom de Vries's avatar
      [nvptx] Handle memmodel for atomic ops · 58f7c7e0
      Tom de Vries authored
      The atomic ops in nvptx.md have memmodel arguments, which are currently
      ignored.
      
      Handle these, fixing test-case fails libgomp.c-c++-common/reduction-{5,6}.c
      on volta.
      
      Tested libgomp on x86_64-linux with nvptx accelerator.
      
      gcc/ChangeLog:
      
      2021-05-17  Tom de Vries  <tdevries@suse.de>
      
      	PR target/100497
      	* config/nvptx/nvptx-protos.h (nvptx_output_atomic_insn): Declare
      	* config/nvptx/nvptx.c (nvptx_output_barrier)
      	(nvptx_output_atomic_insn): New function.
      	(nvptx_print_operand): Add support for 'B'.
      	* config/nvptx/nvptx.md: Use nvptx_output_atomic_insn for atomic
      	insns.
      58f7c7e0
    • Jonathan Wakely's avatar
      libstdc++: Fix filesystem::path constraints for volatile [PR 100630] · 45aa7a44
      Jonathan Wakely authored
      The constraint check for filesystem::path construction uses
      decltype(__is_path_src(declval<Source>())) which mean it considers
      conversion from an rvalue.  When Source is a volatile-qualified type
      it cannot use is_path_src(const Unknown&) because a const lvalue
      reference can only bind to a non-volatile rvalue.
      
      Since the relevant path members all have a const Source& parameter,
      the constraint should be defined in terms of declval<const Source&>(),
      not declval<Source>(). This avoids the problem of volatile-qualified
      rvalues, because we no longer use an rvalue at all.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/100630
      	* include/experimental/bits/fs_path.h (__is_constructible_from):
      	Test construction from a const lvalue, not an rvalue.
      	* testsuite/27_io/filesystem/path/construct/100630.cc: New test.
      	* testsuite/experimental/filesystem/path/construct/100630.cc:
      	New test.
      45aa7a44
    • Antony Polukhin's avatar
      libstdc++: diagnose some misuses of [locale.convenience] functions [PR 89728] · fd89fc77
      Antony Polukhin authored
      This patch provides better diagnostics for common misuse of
      [locale.convenience] functions with std::string as a character type.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/89728
      	* include/bits/locale_facets.h (ctype<basic_string<C,T,A>>):
      	Declare (but do not define) partial specialization.
      	* testsuite/22_locale/ctype/is/string/89728_neg.cc: New test.
      fd89fc77
    • Jonathan Wakely's avatar
      libstdc++: Fix std::jthread assertion and re-enable skipped test · 60a156ae
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	* include/std/thread (jthread::_S_create): Fix static assert
      	message.
      	* testsuite/30_threads/jthread/95989.cc: Re-enable test.
      	* testsuite/30_threads/jthread/jthread.cc: Do not require
      	pthread effective target.
      	* testsuite/30_threads/jthread/2.cc: Moved to...
      	* testsuite/30_threads/jthread/version.cc: ...here.
      60a156ae
    • Aldy Hernandez's avatar
      Bail in bounds_of_var_in_loop if scev returns NULL. · ce812822
      Aldy Hernandez authored
      Both initial_condition_in_loop_num and evolution_part_in_loop_num
      can return NULL.  This patch exits if either one is NULL.  Presumably
      this didn't happen before, because adjust_range_with_scev was called
      far less frequently than in ranger, which can call it for every PHI.
      
      gcc/ChangeLog:
      
      	PR tree-optimization/100349
      	* vr-values.c (bounds_of_var_in_loop): Bail if scev returns
      	  NULL.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/pr100349.c: New test.
      ce812822
    • Tamar Christina's avatar
      AArch64: Have -mcpu=native and -march=native enable extensions when CPU is unknown · e91a17fe
      Tamar Christina authored
      Currently when using -mcpu=native or -march=native on a CPU that is unknown to
      the compiler the compiler currently just used -march=armv8-a and enables none
      of the extensions.
      
      To make this a bit more useful this patch changes it to still use -march=armv8.a
      but to enable the extensions.  We still cannot do tuning but at least if using
      this on a future SVE core the compiler will at the very least enable SVE etc.
      
      gcc/ChangeLog:
      
      	* config/aarch64/driver-aarch64.c (DEFAULT_ARCH): New.
      	(host_detect_local_cpu): Use it.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/aarch64/cpunative/info_16: New test.
      	* gcc.target/aarch64/cpunative/info_17: New test.
      	* gcc.target/aarch64/cpunative/native_cpu_16.c: New test.
      	* gcc.target/aarch64/cpunative/native_cpu_17.c: New test.
      e91a17fe
Loading