1. 16 Jun, 2020 5 commits
    • arm: Correct the grouping of operands in MVE vector scatter store intrinsics (PR94735). · aac5ae14
      The operands in RTL patterns of MVE vector scatter store intrinsics are
      wrongly grouped, because of which few vector loads and stores instructions
      are wrongly getting optimized out with -O2.
      
      A new predicate "mve_scatter_memory" is defined in this patch, this predicate
      returns TRUE on matching: (mem(reg)) for MVE scatter store intrinsics.
      This patch fixes the issue by adding define_expand pattern with
      "mve_scatter_memory" predicate and calls the corresponding define_insn by
      passing register_operand as first argument. This register_operand is extracted
      from the operand with "mve_scatter_memory" predicate in define_expand pattern.
      
      	Backported from mainline
      	2020-06-04  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>
      
      gcc/
      	PR target/94735
      	* config/arm/predicates.md (mve_scatter_memory): Define to
      	match (mem (reg)) for scatter store memory.
      	* config/arm/mve.md (mve_vstrbq_scatter_offset_<supf><mode>): Modify
      	define_insn to define_expand.
      	(mve_vstrbq_scatter_offset_p_<supf><mode>): Likewise.
      	(mve_vstrhq_scatter_offset_<supf><mode>): Likewise.
      	(mve_vstrhq_scatter_shifted_offset_p_<supf><mode>): Likewise.
      	(mve_vstrhq_scatter_shifted_offset_<supf><mode>): Likewise.
      	(mve_vstrdq_scatter_offset_p_<supf>v2di): Likewise.
      	(mve_vstrdq_scatter_offset_<supf>v2di): Likewise.
      	(mve_vstrdq_scatter_shifted_offset_p_<supf>v2di): Likewise.
      	(mve_vstrdq_scatter_shifted_offset_<supf>v2di): Likewise.
      	(mve_vstrhq_scatter_offset_fv8hf): Likewise.
      	(mve_vstrhq_scatter_offset_p_fv8hf): Likewise.
      	(mve_vstrhq_scatter_shifted_offset_fv8hf): Likewise.
      	(mve_vstrhq_scatter_shifted_offset_p_fv8hf): Likewise.
      	(mve_vstrwq_scatter_offset_fv4sf): Likewise.
      	(mve_vstrwq_scatter_offset_p_fv4sf): Likewise.
      	(mve_vstrwq_scatter_offset_p_<supf>v4si): Likewise.
      	(mve_vstrwq_scatter_offset_<supf>v4si): Likewise.
      	(mve_vstrwq_scatter_shifted_offset_fv4sf): Likewise.
      	(mve_vstrwq_scatter_shifted_offset_p_fv4sf): Likewise.
      	(mve_vstrwq_scatter_shifted_offset_p_<supf>v4si): Likewise.
      	(mve_vstrwq_scatter_shifted_offset_<supf>v4si): Likewise.
      	(mve_vstrbq_scatter_offset_<supf><mode>_insn): Define insn for scatter
      	stores.
      	(mve_vstrbq_scatter_offset_p_<supf><mode>_insn): Likewise.
      	(mve_vstrhq_scatter_offset_<supf><mode>_insn): Likewise.
      	(mve_vstrhq_scatter_shifted_offset_p_<supf><mode>_insn): Likewise.
      	(mve_vstrhq_scatter_shifted_offset_<supf><mode>_insn): Likewise.
      	(mve_vstrdq_scatter_offset_p_<supf>v2di_insn): Likewise.
      	(mve_vstrdq_scatter_offset_<supf>v2di_insn): Likewise.
      	(mve_vstrdq_scatter_shifted_offset_p_<supf>v2di_insn): Likewise.
      	(mve_vstrdq_scatter_shifted_offset_<supf>v2di_insn): Likewise.
      	(mve_vstrhq_scatter_offset_fv8hf_insn): Likewise.
      	(mve_vstrhq_scatter_offset_p_fv8hf_insn): Likewise.
      	(mve_vstrhq_scatter_shifted_offset_fv8hf_insn): Likewise.
      	(mve_vstrhq_scatter_shifted_offset_p_fv8hf_insn): Likewise.
      	(mve_vstrwq_scatter_offset_fv4sf_insn): Likewise.
      	(mve_vstrwq_scatter_offset_p_fv4sf_insn): Likewise.
      	(mve_vstrwq_scatter_offset_p_<supf>v4si_insn): Likewise.
      	(mve_vstrwq_scatter_offset_<supf>v4si_insn): Likewise.
      	(mve_vstrwq_scatter_shifted_offset_fv4sf_insn): Likewise.
      	(mve_vstrwq_scatter_shifted_offset_p_fv4sf_insn): Likewise.
      	(mve_vstrwq_scatter_shifted_offset_p_<supf>v4si_insn): Likewise.
      	(mve_vstrwq_scatter_shifted_offset_<supf>v4si_insn): Likewise.
      
      gcc/testsuite/
      	PR target/94735
      	* gcc.target/arm/mve/intrinsics/mve_vstore_scatter_base.c: New test.
      	* gcc.target/arm/mve/intrinsics/mve_vstore_scatter_base_p.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/mve_vstore_scatter_offset.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/mve_vstore_scatter_offset_p.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/mve_vstore_scatter_shifted_offset.c:
      	Likewise.
      	* gcc.target/arm/mve/intrinsics/mve_vstore_scatter_shifted_offset_p.c:
      	Likewise.
      Srinath Parvathaneni committed
    • arm: Fix unintentional fall throughs in arm.c · 1aabb312
      This small patch fix some unintentional fall-throughs in
      `mve_vector_mem_operand'.
      
      	Backported from mainline
      	2020-05-28  Andrea Corallo  <andrea.corallo@arm.com>
      
      gcc/
      	* config/arm/arm.c (mve_vector_mem_operand): Fix unwanted
      	fall-throughs.
      Srinath Parvathaneni committed
    • arm: Fix the wrong code-gen generated by MVE vector load/store intrinsics (PR94959). · 32c348ce
      Few MVE intrinsics like vldrbq_s32, vldrhq_s32 etc., the assembler instructions
      generated by current compiler are wrong.
      eg: vldrbq_s32 generates an assembly instructions `vldrb.s32 q0,[ip]`.
      But as per Arm-arm second argument in above instructions must also be a low
      register (<= r7). This patch fixes this issue by creating a new predicate
      "mve_memory_operand" and constraint "Ux" which allows low registers as arguments
      to the generated instructions depending on the mode of the argument. A new constraint
      "Ul" is created to handle loading to PC-relative addressing modes for vector
      store/load intrinsiscs.
      All the corresponding MVE intrinsic generating wrong code-gen as vldrbq_s32
      are modified in this patch.
      
      	Backported from mainline
      	2020-05-20  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>
      
      gcc/
      	PR target/94959
      	* config/arm/arm-protos.h (arm_mode_base_reg_class): Function
      	declaration.
      	(mve_vector_mem_operand): Likewise.
      	* config/arm/arm.c (thumb2_legitimate_address_p): For MVE target check
      	the load from memory to a core register is legitimate for give mode.
      	(mve_vector_mem_operand): Define function.
      	(arm_print_operand): Modify comment.
      	(arm_mode_base_reg_class): Define.
      	* config/arm/arm.h (MODE_BASE_REG_CLASS): Modify to add check for
      	TARGET_HAVE_MVE and expand to arm_mode_base_reg_class on TRUE.
      	* config/arm/constraints.md (Ux): Likewise.
      	(Ul): Likewise.
      	* config/arm/mve.md (mve_mov): Replace constraint Us with Ux and also
      	add support for missing Vector Store Register and Vector Load Register.
      	Add a new alternative to support load from memory to PC (or label) in
      	vector store/load.
      	(mve_vstrbq_<supf><mode>): Modify constraint Us to Ux.
      	(mve_vldrbq_<supf><mode>): Modify constriant Us to Ux, predicate to
      	mve_memory_operand and also modify the MVE instructions to emit.
      	(mve_vldrbq_z_<supf><mode>): Modify constraint Us to Ux.
      	(mve_vldrhq_fv8hf): Modify constriant Us to Ux, predicate to
      	mve_memory_operand and also modify the MVE instructions to emit.
      	(mve_vldrhq_<supf><mode>): Modify constriant Us to Ux, predicate to
      	mve_memory_operand and also modify the MVE instructions to emit.
      	(mve_vldrhq_z_fv8hf): Likewise.
      	(mve_vldrhq_z_<supf><mode>): Likewise.
      	(mve_vldrwq_fv4sf): Likewise.
      	(mve_vldrwq_<supf>v4si): Likewise.
      	(mve_vldrwq_z_fv4sf): Likewise.
      	(mve_vldrwq_z_<supf>v4si): Likewise.
      	(mve_vld1q_f<mode>): Modify constriant Us to Ux.
      	(mve_vld1q_<supf><mode>): Likewise.
      	(mve_vstrhq_fv8hf): Modify constriant Us to Ux, predicate to
      	mve_memory_operand.
      	(mve_vstrhq_p_fv8hf): Modify constriant Us to Ux, predicate to
      	mve_memory_operand and also modify the MVE instructions to emit.
      	(mve_vstrhq_p_<supf><mode>): Likewise.
      	(mve_vstrhq_<supf><mode>): Modify constriant Us to Ux, predicate to
      	mve_memory_operand.
      	(mve_vstrwq_fv4sf): Modify constriant Us to Ux.
      	(mve_vstrwq_p_fv4sf): Modify constriant Us to Ux and also modify the MVE
      	instructions to emit.
      	(mve_vstrwq_p_<supf>v4si): Likewise.
      	(mve_vstrwq_<supf>v4si): Likewise.Modify constriant Us to Ux.
      	* config/arm/predicates.md (mve_memory_operand): Define.
      
      gcc/testsuite/
      	PR target/94959
      	* gcc.target/arm/mve/intrinsics/mve_vector_float2.c: Modify.
      	* gcc.target/arm/mve/intrinsics/mve_vldr.c: New test.
      	* gcc.target/arm/mve/intrinsics/mve_vldr_z.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/mve_vstr.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/mve_vstr_p.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vld1q_f16.c: Modify.
      	* gcc.target/arm/mve/intrinsics/vld1q_f32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vld1q_s16.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vld1q_s32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vld1q_s8.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vld1q_u16.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vld1q_u32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vld1q_u8.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vld1q_z_f16.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vld1q_z_f32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vld1q_z_s16.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vld1q_z_s32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vld1q_z_s8.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vld1q_z_u16.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vld1q_z_u32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vld1q_z_u8.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrbq_s8.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrbq_u8.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrbq_z_s8.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrbq_z_u8.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_s64.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_u64.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_s64.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_u64.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrhq_f16.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrhq_s16.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrhq_s32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrhq_u16.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrhq_u32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrhq_z_f16.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrhq_z_s16.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrhq_z_s32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrhq_z_u16.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrhq_z_u32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrwq_f32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_f32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_s32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_u32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_f32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_s32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrwq_gather_base_wb_z_u32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrwq_s32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrwq_u32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrwq_z_f32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrwq_z_s32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vldrwq_z_u32.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vuninitializedq_float.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vuninitializedq_float1.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vuninitializedq_int.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/vuninitializedq_int1.c: Likewise.
      
      Co-Authored-By: Andre Vieira  <andre.simoesdiasvieira@arm.com>
      Srinath Parvathaneni committed
    • testsuite: Add offloading_enabled check and use it for xfail (PR95622) · 7d249d84
      gcc/testsuite/ChangeLog:
      
      	PR middle-end/95622
      	* lib/target-supports.exp (check_effective_target_offloading_enabled):
      	New.
      	* c-c++-common/goacc/kernels-alias-ipa-pta-2.c: Use it for xfail.
      	* c-c++-common/goacc/kernels-alias-ipa-pta-4.c: Likewise.
      	* c-c++-common/goacc/kernels-alias-ipa-pta.c: Likewise.
      
      Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
      (cherry picked from commit e70fbee1a3dd9fdeb661366dbf3096d76c4e2d6e)
      Tobias Burnus committed
    • Daily bump. · 32f2eef9
      GCC Administrator committed
  2. 15 Jun, 2020 4 commits
  3. 14 Jun, 2020 14 commits
    • coroutines: Handle lambda closure pointers like 'this'. · fbd1bae3
      It was agreed amongst the implementors that the correct
      interpretation of the standard is that lambda closure pointers
      should be treated in the same manner as class object pointers.
      
      gcc/cp/ChangeLog:
      
      	* coroutines.cc (instantiate_coro_traits): Pass a reference
      	to lambda closure objects to traits instantiation.
      	(morph_fn_to_coro): Likewise for promise parameter
      	preview and allocator lookup.
      
      (cherry picked from commit 1c140cfbfa4b465a29ef26f1fdfef04c671e3c9c)
      Iain Sandoe committed
    • PR fortran/95544 - Fix ICE in NULL() argument to intrinsics · b0feef39
      Fortran 2018: An argument to an intrinsic procedure other than ASSOCIATED,
      NULL, or PRESENT shall be a data object.  An EXPR_NULL is not a data
      object.  Add checks for intrinsics.
      
      2020-06-11  Steven G. Kargl  <kargl@gcc.gnu.org>
      	    Harald Anlauf  <anlauf@gmx.de>
      
      gcc/fortran/
      	PR fortran/95544
      	* check.c (invalid_null_arg): Rename to gfc_invalid_null_arg.
      	(gfc_check_associated, gfc_check_kind, gfc_check_merge)
      	(gfc_check_shape, gfc_check_size, gfc_check_spread)
      	(gfc_check_transfer): Adjust.
      	(gfc_check_len_lentrim, gfc_check_trim): Check for NULL() argument.
      	* gfortran.h: Declare gfc_invalid_null_arg ().
      	* intrinsic.c (check_arglist): Check for NULL() argument.
      
      (cherry picked from commit 7fd614ee818983274eb5e47cbb8ec68b20994963)
      Harald Anlauf committed
    • PR fortran/93366 - ICE on invalid, reject invalid use of NULL() as argument · 29410519
      gcc/fortran/ChangeLog:
      
      2020-05-05  Steve Kargl  <kargl@gcc.gnu.org>
      	    Harald Anlauf  <anlauf@gmx.de>
      
      	PR fortran/93366
      	* check.c (gfc_check_associated, invalid_null_arg): Factorize
      	check for presence of invalid NULL() argument.
      	(gfc_check_kind, gfc_check_merge, gfc_check_shape)
      	(gfc_check_sizeof, gfc_check_spread, gfc_check_transfer): Use this
      	check for presence of invalid NULL() arguments.
      
      gcc/testsuite/ChangeLog:
      
      2020-05-05  Harald Anlauf  <anlauf@gmx.de>
      
      	PR fortran/93366
      	* gfortran.dg/pr93366.f90: New test.
      
      (cherry picked from commit 5a26ea7e0f8b9a00a2eb0a5e8f70efa04056f167)
      Harald Anlauf committed
    • PR fortran/95503 - Fix ICE in gfc_is_simply_contiguous, at fortran/expr.c:5844 · 8c810281
      The check for assigning a pointer that cannot be determined to be simply
      contiguous at compile time to a contiguous pointer does not need to be
      invoked if the lhs of the assignment is known to have conflicting attributes.
      
      2020-06-11  Harald Anlauf  <anlauf@gmx.de>
      
      gcc/fortran/
      	PR fortran/95503
      	* expr.c (gfc_check_pointer_assign): Skip contiguity check of rhs
      	of pointer assignment if lhs cannot be simply contiguous.
      
      gcc/testsuite/
      	PR fortran/95503
      	* gfortran.dg/pr95503.f90: New test.
      
      (cherry picked from commit 87af4f40453a9c84363bde5d9a58466de7fbee2e)
      Harald Anlauf committed
    • When avoiding double deallocation, look at namespace, expression and component. · 0c39742d
      Our finalization handling is a mess.  Really, we should get to try and get
      this fixed for gcc 11.
      
      In the meantime, here is a patch which fixes a regression I introduced
      when fixing a regression with a memory leak.  The important thing
      here is to realize that we do not need to finalize (and deallocate)
      multiple times for the same expression and the same component
      in the same namespace.  It might cause code size regressions, but
      better big code than wrong code...
      
      Backported from r11-1296-g1af22e455584ef5fcad2b4474c1efc3fd26f6cb3 .
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/94109
      	* class.c (finalize_component): Return early if finalization has
      	already happened for expression and component within namespace.
      	* gfortran.h (gfc_was_finalized): New type.
      	(gfc_namespace): Add member was_finalzed.
      	(gfc_expr): Remove finalized.
      	* symbol.c (gfc_free_namespace): Free was_finalized.
      
      gcc/testsuite/ChangeLog:
      
      	PR fortran/94109
      	* gfortran.dg/finalize_34.f90: Adjust free counts.
      	* gfortran.dg/finalize_36.f90: New test.
      Thomas Koenig committed
    • c++: Fix initlist-array12.C · a44761a6
      	* g++.dg/cpp0x/initlist-array12.C: Fix the definition of
      	initializer_list for ilp32 target.
      
      (cherry picked from commit 4833c1adc3c7b125bf1c59e8bd8d802ac3b0d205)
      Marek Polacek committed
    • c-family: Fix up MEM_REF printing [PR95580] · b2229175
      The C FE in the MEM_REF printing ICEs if the type of the first argument
      (which due to useless pointer conversions can be an arbitrary type) is a
      pointer to an incomplete type.  The code just wants to avoid printing a cast
      if it is a pointer to single byte elements.
      
      2020-06-09  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c/95580
      	* c-pretty-print.c (c_pretty_printer::unary_expression): Handle the
      	case when MEM_REF's first argument has type pointer to incomplete type.
      
      	* gcc.dg/pr95580.c: New test.
      
      (cherry picked from commit d6dbb71e468d0db561cc9eca99eeaca1efb81c11)
      Jakub Jelinek committed
    • forwprop: Ignore scalar mode vectors in simplify_vector_constructor [PR95528] · c75a2abc
      As mentioned in the PR, the problem is that at least the x86 backend asumes
      that the vec_unpack* and vec_pack* optabs with integral modes are for the
      AVX512-ish vector masks rather than for very small vectors done in GPRs.
      The only other target that seems to have a scalar mode vec_{,un}pack* optab
      is aarch64 as discussed in the PR, so there is also a condition for that.
      All other targets have just vector mode optabs.
      
      2020-06-08  Jakub Jelinek  <jakub@redhat.com>
      
      	PR target/95528
      	* tree-ssa-forwprop.c (simplify_vector_constructor): Don't use
      	VEC_UNPACK*_EXPR or VEC_PACK_TRUNC_EXPR with scalar modes unless the
      	type is vector boolean.
      
      	* g++.dg/opt/pr95528.C: New test.
      
      (cherry picked from commit 8be374e02761c9d63d2753d71e4bd4874a1577b1)
      Jakub Jelinek committed
    • c++: Try to complete decomp types [PR95328] · 808f30b0
      Two years ago Paolo has added the
        else if (processing_template_decl && !COMPLETE_TYPE_P (type))
          pedwarn (...);
      lines into cp_finish_decomp.  For type dependent decl we punt much earlier,
      but even for types which aren't type dependent COMPLETE_TYPE_P might be
      false as this testcase shows, so this patch tries to complete_type first
      (the reason for writing it that way is that it is then followed by another
      else if and if complete_type returns error_mark_node, we shouldn't report
      anything, as a bug should have been reported already.
      
      2020-05-28  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c++/95328
      	* decl.c (cp_finish_decomp): Call complete_type before checking
      	COMPLETE_TYPE_P.
      
      	* g++.dg/cpp1z/decomp53.C: New test.
      
      (cherry picked from commit 3d8d5ddb539a5254c7ef83414377f4c74c7701d4)
      Jakub Jelinek committed
    • openmp: Ensure copy ctor for composite distribute parallel for class iterators… · 6d6df84d
      openmp: Ensure copy ctor for composite distribute parallel for class iterators is instantiated [PR95197]
      
      During gimplification omp_finish_clause langhook is called in several places
      to add the language specific info to the clause like what default/copy ctors,
      dtors and assignment operators should be used.
      
      Unfortunately, if it refers to some not yet instantiated method, during
      gimplification it is too late and the methods will not be instantiated
      anymore.  For other cases, the genericizer has code to detect those and
      instantiate whatever is needed, this change adds the same for
      distribute parallel for class iterators where we under the hood need
      a copy constructor for the iterator to implement it.
      
      2020-05-26  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c++/95197
      	* gimplify.c (find_combined_omp_for): Move to omp-general.c.
      	* omp-general.h (find_combined_omp_for): Declare.
      	* omp-general.c: Include tree-iterator.h.
      	(find_combined_omp_for): New function, moved from gimplify.c.
      
      	* cp-gimplify.c: Include omp-general.h.
      	(cp_genericize_r) <case OMP_DISTRIBUTE>: For class iteration
      	variables in composite distribute parallel for, instantiate copy
      	ctor of their types.
      
      (cherry picked from commit f1f862aec2c3b93dbd6adfc35b0e1b6034e59c21)
      Jakub Jelinek committed
    • openmp: Fix placement of 2nd+ preparation statement for PHIs in simd clone lowering [PR95108] · e09d6265
      For normal stmts, preparation statements are inserted before the stmt, so if we need multiple,
      they are in the correct order, but for PHIs we emit them after labels in the entry successor
      bb, and we used to emit them in the reverse order that way.
      
      2020-05-14  Jakub Jelinek  <jakub@redhat.com>
      
      	PR middle-end/95108
      	* omp-simd-clone.c (struct modify_stmt_info): Add after_stmt member.
      	(ipa_simd_modify_stmt_ops): For PHIs, only add before first stmt in
      	entry block if info->after_stmt is NULL, otherwise add after that stmt
      	and update it after adding each stmt.
      	(ipa_simd_modify_function_body): Initialize info.after_stmt.
      
      	* gcc.dg/gomp/pr95108.c: New test.
      
      (cherry picked from commit d0fb9ffc1b8f3b86bbdf0e915cec2136141b329b)
      Jakub Jelinek committed
    • Fix -fcompare-debug issue in purge_dead_edges [PR95080] · 16710ff9
      The following testcase fails with -fcompare-debug, the bug used to be latent
      since introduction of -fcompare-debug.
      The loop at the start of purge_dead_edges behaves differently between -g0
      and -g - if the last insn is a DEBUG_INSN, then it skips not just
      DEBUG_INSNs but also NOTEs until it finds some other real insn (or bb head),
      while with -g0 it will not skip any NOTEs, so if we have
      real_insn
      note
      debug_insn // not present with -g0
      then with -g it might remove useless REG_EH_REGION from real_insn, while
      with -g0 it will not.
      
      Yet another option would be not skipping NOTE_P in the loop; I couldn't find
      in history rationale for why it is done.
      
      2020-05-13  Jakub Jelinek  <jakub@redhat.com>
      
      	PR debug/95080
      	* cfgrtl.c (purge_dead_edges): Skip over debug and note insns even
      	if the last insn is a note.
      
      	* g++.dg/opt/pr95080.C: New test.
      
      (cherry picked from commit 18edc195442291525e04f0fa4d5ef972155117da)
      Jakub Jelinek committed
    • testsuite: Re-add gdc.test prefix in test names (PR testsuite/95575) · 892b4f74
      gcc/testsuite/ChangeLog:
      
      	PR testsuite/95575
      	* lib/gdc-utils.exp (gdc-do-test): Re-add $subdir link and inclusion
      	in filename.
      
      (cherry picked from commit 4a557dc45650bbe500276680674afa18d291fdcc)
      Iain Buclaw committed
    • Daily bump. · 94ccc380
      GCC Administrator committed
  4. 13 Jun, 2020 3 commits
    • coroutines: Make call argument handling more robust [PR95440] · b8849820
      build_new_method_call is supposed to be able to handle a null
      arguments list pointer (when the method has no parms).  There
      were a couple of places where uses of the argument list pointer
      were not defended against NULL.
      
      gcc/cp/ChangeLog:
      
      	PR c++/95440
      	* call.c (add_candidates): Use vec_safe_length() for
      	testing the arguments list.
      	(build_new_method_call_1): Use vec_safe_is_empty() when
      	checking for an empty args list.
      
      gcc/testsuite/ChangeLog:
      
      	PR c++/95440
      	* g++.dg/coroutines/pr95440.C: New test.
      
      (cherry picked from commit a9eec9625ea7165292958be04899b057804192fb)
      Iain Sandoe committed
    • c++: constrained class template friend [PR93467] · 652ec7e8
      This fixes two issues in our handling of constrained class template
      friend declarations.
      
      The first issue is that we fail to set the constraints on the injected
      class template declaration during tsubst_friend_class.
      
      The second issue is that the template parameter levels within the parsed
      constraints of a class template friend declaration are shifted if the
      enclosing class is a template, and this shift leads to spurious
      constraint mismatch errors in associate_classtype_constraints if the
      friend declaration refers to an already declared class template.
      
      gcc/cp/ChangeLog:
      
      	PR c++/93467
      	* constraint.cc (associate_classtype_constraints): If there is a
      	discrepancy between the current template depth and the template
      	depth of the original declaration, then adjust the template
      	parameter depth within the current constraints appropriately.
      	* pt.c (tsubst_friend_class): Substitute into and set the
      	constraints on the injected declaration.
      
      gcc/testsuite/ChangeLog:
      
      	PR c++/93467
      	* g++.dg/cpp2a/concepts-friend6.C: New test.
      	* g++.dg/cpp2a/concepts-friend7.C: New test.
      
      (cherry picked from commit 11c7261128ad3ee136508703b20e45cbe04f8dd0)
      Patrick Palka committed
    • Daily bump. · 3af22062
      GCC Administrator committed
  5. 12 Jun, 2020 5 commits
    • go.test: update issue4085b.go to version from Go 1.13 · 703f9d86
      This lets the test pass on AIX.
      
      Not updating to master because we get slightly different error messages,
      so that is a more complex change.
      Ian Lance Taylor committed
    • coroutines: Correct handling of references in parm copies [PR95350]. · 284f809e
      Adjust to handle rvalue refs the same way as clang, and to correct
      the handling of moves when a copy CTOR is present.  This is one area
      where we could make things easier for the end-user (as was implemented
      before this change), however there needs to be agreement about when the
      full statement containing a coroutine call ends (i.e. when the ramp
      terminates or when the coroutine terminates).
      
      gcc/cp/ChangeLog:
      
      	PR c++/95350
      	* coroutines.cc (struct param_info): Remove rv_ref field.
      	(build_actor_fn): Remove specifial rvalue ref handling.
      	(morph_fn_to_coro): Likewise.
      
      gcc/testsuite/ChangeLog:
      
      	PR c++/95350
      	* g++.dg/coroutines/torture/func-params-08.C: Adjust test to
      	reflect that all rvalue refs are dangling.
      	* g++.dg/coroutines/torture/func-params-09-awaitable-parms.C:
      	Likewise.
      	* g++.dg/coroutines/pr95350.C: New test.
      
      (cherry picked from commit 88f48e2967ead9be262483618238efa9c7c842ec)
      Iain Sandoe committed
    • asan: fix RTX emission for ilp32 · e1d68582
      gcc/ChangeLog:
      
      	PR sanitizer/95634
      	* asan.c (asan_emit_stack_protection): Fix emission for ilp32
      	by using Pmode instead of ptr_mode.
      
      Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
      (cherry picked from commit 8cff672cb9a132d3d3158c2edfc9a64b55292b80)
      Martin Liska committed
    • Add missing store in emission of asan_stack_free. · 036b288c
      gcc/ChangeLog:
      
      2020-05-19  Martin Liska  <mliska@suse.cz>
      
      	PR sanitizer/94910
      	* asan.c (asan_emit_stack_protection): Emit
      	also **SavedFlagPtr(FakeStack, class_id) = 0 in order to release
      	a stack frame.
      
      (cherry picked from commit 8b6731e674c76cb48a417f2eef74ced92a17f469)
      Martin Liska committed
    • Daily bump. · d78c4732
      GCC Administrator committed
  6. 11 Jun, 2020 9 commits
    • c++: Fix ICE in check_local_shadow with enum [PR95560] · 23dd4256
      Another indication that perhaps this warning is emitted too early.  We
      crash because same_type_p gets a null type: we have an enumerator
      without a fixed underlying type and finish_enum_value_list hasn't yet
      run.  So check if the type is null before calling same_type_p.
      
      	PR c++/95560
      	* name-lookup.c (check_local_shadow): Check if types are
      	non-null before calling same_type_p.
      
      	* g++.dg/warn/Wshadow-local-3.C: New test.
      Marek Polacek committed
    • c++: explicit(bool) malfunction with dependent expression [PR95066] · ae275b98
      I forgot to set DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P when merging two
      function declarations and as a sad consequence, we never tsubsted
      the dependent explicit-specifier in tsubst_function_decl, leading to
      disregarding the explicit-specifier altogether, and wrongly accepting
      this test.
      
      	PR c++/95066
      	* decl.c (duplicate_decls): Set DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P.
      
      	* g++.dg/cpp2a/explicit16.C: New test.
      Marek Polacek committed
    • c++: ICE with -Wall and constexpr if [PR94937] · de946847
      An ICE arises here because we call cp_get_callee_fndecl_nofold in a
      template, and we've got a CALL_EXPR whose CALL_EXPR_FN is a BASELINK.
      This tickles the INDIRECT_TYPE_P assert in cp_get_fndecl_from_callee.
      
      Fixed by turning the assert into a condition and returning NULL_TREE
      in that case.
      
      	PR c++/94937
      	* cvt.c (cp_get_fndecl_from_callee): Return NULL_TREE if the function
      	type is not INDIRECT_TYPE_P.
      	* decl.c (omp_declare_variant_finalize_one): Call
      	cp_get_callee_fndecl_nofold instead of looking for the function decl
      	manually.
      
      	* g++.dg/cpp1z/constexpr-if34.C: New test.
      	* g++.dg/cpp2a/is-constant-evaluated10.C: New test.
      Marek Polacek committed
    • c++: Fix bogus -Wparentheses warning [PR95344] · 4c07da7b
      Since r267272, which added location wrappers, cp_fold loses
      TREE_NO_WARNING on a MODIFY_EXPR that finish_parenthesized_expr set, and
      that results in a bogus -Wparentheses warning.
      
      I.e., previously we had "b = 1" but now we have "VIEW_CONVERT_EXPR<bool>(b) = 1"
      and cp_fold_maybe_rvalue folds away the location wrapper and so we do
      2718             x = fold_build2_loc (loc, code, TREE_TYPE (x), op0, op1);
      in cp_fold and the flag is lost.
      
      	PR c++/95344
      	* cp-gimplify.c (cp_fold) <case MODIFY_EXPR>: Don't set
      	TREE_THIS_VOLATILE here.
      	(cp_fold): Set it here along with TREE_NO_WARNING.
      
      	* c-c++-common/Wparentheses-2.c: New test.
      Marek Polacek committed
    • c++: ICE when shortening right shift [PR94955] · 18436d87
      Since r10-6527 fold_for_warn calls maybe_constant_value, which means it
      can fold more than it previously could.  In this testcase it means that
      cp_build_binary_op/RSHIFT_EXPR set short_shift because now we were able
      to fold op1 to an INTEGER_CST.  But then when actually performing the
      shortening we crashed because cp_fold_rvalue wasn't able to fold as much
      as f_f_w and so tree_int_cst_sgn crashed on a NOP_EXPR.  Therefore the
      calls should probably match.
      
      	PR c++/94955
      	* typeck.c (cp_build_binary_op): Use fold_for_warn instead of
      	cp_fold_rvalue.
      
      	* g++.dg/cpp0x/constexpr-shift2.C: New test.
      Marek Polacek committed
    • c++: Sorry about type-dependent arg for __builtin_has_attribute [PR90915] · 53e91f86
      Until 92104 is fixed, let's sorry rather than crash.
      
      	PR c++/90915
      	* parser.c (cp_parser_has_attribute_expression): Sorry on a
      	type-dependent argument.
      
      	* g++.dg/ext/builtin-has-attribute.C: New test.
      Marek Polacek committed
    • PR fortran/95611 - ICE in access_attr_decl, at fortran/decl.c:9075 · 3b9a3b48
      When reporting a duplicate access specification of an operator, refer to
      the proper symbol.
      
      2020-06-11  Harald Anlauf <anlauf@gmx.de>
      
      gcc/fortran/
      	PR fortran/95611
      	* decl.c (access_attr_decl): Use correct symbol in error message.
      
      Co-Authored-By: Steven G. Kargl  <kargl@gcc.gnu.org>
      (cherry picked from commit 393ccb72566dc004b9ab5c3b8fb6fdca6c095812)
      Harald Anlauf committed
    • coroutines: Ensure distinct DTOR trees [PR95137]. · 800dac8f
      Part of the PR notes that there are UBSAN fails for the coroutines
      test suite.  These are primarily related to the use of the same DTOR
      tree in the two edges from the await block.  Fixed by building a new
      tree for each.
      
      gcc/cp/ChangeLog:
      
      	PR c++/95137
      	* coroutines.cc (expand_one_await_expression): Build separate
      	DTOR trees for the awaitable object on the destroy and resume
      	paths.
      
      (cherry picked from commit 006f28aefeb3be575239beddc7febe56dff463a2)
      Iain Sandoe committed
    • PR fortran/95091 - Buffer overflows with submodules and long symbols · 605e9b1a
      Add cast to fix bootstrap error with -Werror=sign-compare.
      
      gcc/fortran/
      	PR fortran/95091
      	* class.c (gfc_hash_value): Add cast.
      
      (cherry picked from commit 5aaccde3db39fac7e7f6677ceccc1eadd9c6a424)
      Harald Anlauf committed