1. 23 Jun, 2020 11 commits
    • middle-end/95493 - bogus MEM_ATTRS for variable array access · 7d919c33
      The following patch avoids keeping the inherited MEM_ATTRS when
      set_mem_attributes_minus_bitpos is called with a variable ARRAY_REF.
      The inherited ones may not reflect the correct offset and neither
      does the updated alias-set match the inherited MEM_EXPR.  This all
      ends up confusing path-based alias-analysis, causing wrong-code.
      
      The fix is to stop not adopting a MEM_EXPR for certain kinds of
      expressions and instead handle everything we can.  There's still
      the constant kind trees case which I'm too lazy to look into right
      now.  I did refrain from adding SSA_NAME there and instead avoided
      calling set_mem_attributes_minus_bitpos when debug expression
      expansion ended up expanding a SSA definition RHS which should
      already have taken care of setting the appropriate MEM_ATTRS.
      
      It also avoids calling set_mem_attributes on the
      DECL_INITIAL of a CONST_DECL which seems pointless since there
      cannot be a sensible MEM_EXPR derived from that.  We're overwriting
      both other possibly useful info, alias-set and alignment immediately
      so the following patch simply removes the call instead of making
      the function deal with even more (unexpected) trees that are not
      memory accesses.
      
      2020-06-23  Richard Biener  <rguenther@suse.de>
      
      	PR middle-end/95493
      	PR middle-end/95690
      	* cfgexpand.c (expand_debug_expr): Avoid calling
      	set_mem_attributes_minus_bitpos when we were expanding
      	an SSA name.
      	* emit-rtl.c (set_mem_attributes_minus_bitpos): Remove
      	ARRAY_REF special-casing, add CONSTRUCTOR to the set of
      	special-cases we do not want MEM_EXPRs for.  Assert
      	we end up with reasonable MEM_EXPRs.
      	* varasm.c (build_constant_desc): Remove set_mem_attributes call.
      
      	* g++.dg/torture/pr95493.C: New testcase.
      	* g++.dg/torture/pr95493-1.C: Likewise.
      	* gfortran.dg/pr95690.f90: Likewise.
      Richard Biener committed
    • Handle AR_FULL vs. AR_FULL in dependency checking. · 2e4d8070
      Previously, handling of full vs. full references failed to take
      AR_FULL vs. AR_FULL into account.  A change in dependency
      checking in gcc 10 created a code path that could lead there;
      with this patch, this is now correctly handled.
      
      gcc/fortran/ChangeLog:
      
      2020-06-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
      	PR fortran/95812
      	* dependency.c (ref_same_as_full_array): Handle case of AR_FULL
      	vs. AR_FULL.
      
      gcc/testsuite/ChangeLog:
      
      2020-06-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
      	PR fortran/95812
      	* gfortran.dg/dependency_59.f90: New test.
      
      (cherry picked from commit abcde0a658e17dbbabcb396eaae5a3612e07d401)
      Thomas Koenig committed
    • tree-optimization/95487 - use a truth type for scatter masks · 2eed94cb
      This makes sure to get a truth type for scatter masks even when they
      are invariant.
      
      2020-06-03  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/95487
      	* tree-vect-stmts.c (vectorizable_store): Use a truth type
      	for the scatter mask.
      
      	* g++.dg/vect/pr95487.cc: New testcase.
      Richard Biener committed
    • tree-optimization/95308 - really avoid forward propagating of &TMR · 7e64ef0d
      This fixes a hole that still allowed forwarding of TARGET_MEM_REF
      addresses.
      
      2020-05-25  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/95308
      	* tree-ssa-forwprop.c (pass_forwprop::execute): Generalize
      	test for TARGET_MEM_REFs.
      
      	* g++.dg/torture/pr95308.C: New testcase.
      Richard Biener committed
    • c/95141 - fix bogus integer overflow warning · cc08609b
      This fixes an integer overflow warning that ultimatively happens because
      of TREE_OVERFLOW propagating through transforms and the existing guard
      against this,
      
      375           if (TREE_OVERFLOW_P (ret)
      376               && !TREE_OVERFLOW_P (op0)
      377               && !TREE_OVERFLOW_P (op1))
      378             overflow_warning (EXPR_LOC_OR_LOC (expr, input_location,
      
      being insufficient.  Rather than trying to use sth like walk_tree to
      exhaustively walk operands (with the possibility of introducing
      quadraticness when folding larger expressions recursively) the
      following amends the above with an ad-hoc test for a binary op0
      with a possibly constant op1.
      
      2020-05-30  Richard Biener  <rguenther@suse.de>
      
      	PR c/95141
      gcc/c
      	* c-fold.c (c_fully_fold_internal): Enhance guard on
      	overflow_warning.
      
      gcc/testsuite
      	* gcc.dg/pr95141.c: New testcase.
      Richard Biener committed
    • tree-optimization/95133 - avoid abnormal edges in path splitting · 1d93c1bd
      When path splitting tries to detect a CFG diamond make sure it
      is composed of normal (non-EH, not abnormal) edges.  Otherwise
      CFG manipulation later may fail.
      
      2020-05-15  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/95133
      	* gimple-ssa-split-paths.c
      	(find_block_to_duplicate_for_splitting_paths): Check for
      	normal edges.
      
      	* gcc.dg/pr95133.c: New testcase.
      Richard Biener committed
    • middle-end/95118 - fix printing of denormal zero · fe19d514
      This fixes printing a REAL_CST generated from value-numbering
      punning some bits to a real which turns out as zero with big
      negative exponent.  This causes the loop in real_to_decimal_for_mode to
      never terminate.
      
      2020-05-14  Richard Biener  <rguenther@suse.de>
      
      	PR middle-end/95118
      	* real.c (real_to_decimal_for_mode): Make sure we handle
      	a zero with nonzero exponent.
      
      	* gcc.dg/pr95118.c: New testcase.
      Richard Biener committed
    • tree-optimization/95049 - fix not terminating RPO VN iteration · 80416aac
      This rejects lattice changes from one constant to another.
      
      2020-05-11  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/95049
      	* tree-ssa-sccvn.c (set_ssa_val_to): Reject lattice transition
      	between different constants.
      
      	* gcc.dg/torture/pr95049.c: New testcase.
      Richard Biener committed
    • middle-end/94964 - avoid EH loop entry with CP_SIMPLE_PREHEADERS · fb2b8bf3
      Loop optimizers expect to be able to insert on the preheader
      edge w/o splitting it thus avoid ending up with a preheader
      that enters the loop via an EH edge (or an abnormal edge).
      
      2020-05-06  Richard Biener  <rguenther@suse.de>
      
      	PR middle-end/94964
      	* cfgloopmanip.c (create_preheader): Require non-complex
      	preheader edge for CP_SIMPLE_PREHEADERS.
      Richard Biener committed
    • Fortran : ICE in resolve_fl_procedure PR95708 · 56dfd92c
      Now issues an error "Intrinsic procedure 'num_images' not
      allowed in PROCEDURE" instead of an ICE.
      
      2020-06-22  Steven G. Kargl  <kargl@gcc.gnu.org>
      
      gcc/fortran/
      
      	PR fortran/95708
      	* intrinsic.c (add_functions): Replace CLASS_INQUIRY with
      	CLASS_TRANSFORMATIONAL for intrinsic num_images.
      	(make_generic): Replace ACTUAL_NO with ACTUAL_YES for
      	intrinsic team_number.
      	* resolve.c (resolve_fl_procedure): Check pointer ts.u.derived
      	exists before using it.
      
      2020-06-22  Mark Eggleston  <markeggleston@gcc.gnu.org>
      
      gcc/testsuite/
      
      	PR fortran/95708
      	* gfortran.dg/pr95708.f90: New test.
      
      (cherry picked from commit 647340c92a042e8e6f7d004637f07060dbde49c0)
      Mark Eggleston committed
    • Daily bump. · d4cfbaf5
      GCC Administrator committed
  2. 22 Jun, 2020 10 commits
    • Update gcc sv.po. · 21846c7d
      	* sv.po: Update.
      Joseph Myers committed
    • c++: Refinements to "more constrained". · c3d4dbc6
      P2113 from the last C++ meeting clarified that we only compare constraints
      on functions or function templates that have equivalent template parameters
      and function parameters.
      
      I'm not currently implementing the complicated handling of reversed
      comparison operators here; thinking about it now, it seems like a lot of
      complexity to support a very weird usage.  If I write two similar comparison
      operators to be distinguished by their constraints, why would I write one
      reversed?  If they're two unrelated operators, they're very unlikely to be
      similar enough for the complexity to help.  I've started a discussion on the
      committee reflector about changing these rules.
      
      This change breaks some greedy_ops tests in libstdc++ that were relying on
      comparing constraints on unrelated templates, which seems pretty clearly
      wrong, so I'm removing those tests for now.
      
      gcc/cp/ChangeLog:
      
      	* call.c (joust): Only compare constraints for non-template
      	candidates with matching parameters.
      	* pt.c (tsubst_pack_expansion): Fix getting a type parameter
      	pack.
      	(more_specialized_fn): Only compare constraints for candidates with
      	matching parameters.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/concepts-return-req1.C: Expect error.
      	* g++.dg/cpp2a/concepts-p2113a.C: New test.
      	* g++.dg/cpp2a/concepts-p2113b.C: New test.
      
      libstdc++-v3/ChangeLog:
      
      	* testsuite/24_iterators/move_iterator/rel_ops_c++20.cc:
      	Remove greedy_ops tests.
      	* testsuite/24_iterators/reverse_iterator/rel_ops_c++20.cc:
      	Remove greedy_ops tests.
      Jason Merrill committed
    • c++: implicit operator== adjustments from P2002. · 1271bdf0
      P2002R1, adopted at the February C++ meeting, made several refinements to
      the wording for operator<=>.  This implements clarifications in how the
      implicit operator== is declared: as a duplicate of the operator<=>, with
      only the return type and name changed.  To that end I factored out the
      declaration copying from build_clone.  For GCC 10 I'm leaving build_clone
      alone, to reduce the chance of non-C++20-mode regressions.
      
      The decl.c changes are a hack to avoid complaining about constraints on a
      non-template friend that isn't defined in the class.  In this case the
      defaulted comparison operator should be considered defined, but we weren't
      setting funcdef_flag properly.  For GCC 11 I fixed it properly.
      
      gcc/cp/ChangeLog:
      
      	* cp-tree.h (copy_fndecl_with_name): Declare.
      	* class.c (copy_fndecl_with_name): Copy from build_clone.
      	(add_implicitly_declared_members): Add op== to TYPE_FIELDS.
      	* method.c (implicitly_declare_fn): Use copy_fndecl_with_name.
      	* decl.c (grokfndecl): Add initialized parm.
      	(grokdeclarator): Pass it down.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/spaceship-synth9.C: New test.
      Jason Merrill committed
    • PR fortran/95707 - ICE in finish_equivalences, at fortran/trans-common.c:1319 · 4dd2fd9c
      With submodules and equivalence declarations, name mangling may result in
      long internal symbols overflowing internal buffers.  We now check that
      we do not exceed the enlarged buffer sizes.
      
      gcc/fortran/
      	PR fortran/95707
      	* gfortran.h (gfc_common_head): Enlarge buffer.
      	* trans-common.c (gfc_sym_mangled_common_id): Enlarge temporary
      	buffers, and add check on length on mangled name to prevent
      	overflow.
      
      (cherry picked from commit 3345e74299687de6144b87c0632018cafd4ccf3b)
      Harald Anlauf committed
    • PR fortran/95688 - ICE in gfc_get_string, at fortran/iresolve.c:70 · 905aaaa6
      With submodules, name mangling of character pointer declarations produces long
      internal symbols that overflowed a static internal buffer.  Adjust the buffer
      size.
      
      gcc/fortran/
      	PR fortran/95688
      	* iresolve.c (gfc_get_string): Enlarge static buffer size.
      
      (cherry picked from commit cd6546ac0e8fb2f4ff2a4bb2db2363ca02bdb7ba)
      Harald Anlauf committed
    • PR fortran/95687 - ICE in get_unique_hashed_string, at fortran/class.c:508 · f067cc55
      With submodules and PDTs, name mangling of interfaces may result in long
      internal symbols overflowing a previously static internal buffer.  We now
      set the buffer size dynamically.
      
      gcc/fortran/
      	PR fortran/95687
      	* class.c (get_unique_type_string): Return a string with dynamic
      	length.
      	(get_unique_hashed_string, gfc_hash_value): Use dynamic result
      	from get_unique_type_string instead of static buffer.
      
      (cherry picked from commit ac932bfcd21e9523fa2b880ae8138aef79da7f54)
      Harald Anlauf committed
    • PR fortran/95689 - ICE in check_sym_interfaces, at fortran/interface.c:2015 · ece7b4d5
      With submodules, name mangling of interfaces may result in long internal
      symbols overflowing an internal buffer.  We now check that we do not
      exceed the enlarged buffer size.
      
      gcc/fortran/
      	PR fortran/95689
      	* interface.c (check_sym_interfaces): Enlarge temporary buffer,
      	and add check on length on mangled name to prevent overflow.
      
      (cherry picked from commit 62c0c0ea7bfb6f8f6b8d767b05120cafb6823da6)
      Harald Anlauf committed
    • PR fortran/95587 - ICE in gfc_target_encode_expr, at fortran/target-memory.c:362 · c00ca04b
      EQUIVALENCE objects are subject to constraints listed in the Fortran 2018
      standard, section 8.10.1.1.  These constraints are to be checked
      also for CLASS variables.
      
      gcc/fortran/
      	PR fortran/95587
      	* match.c (gfc_match_equivalence): Check constraints on
      	EQUIVALENCE objects also for CLASS variables.
      
      (cherry picked from commit 5eb947601bdce59f2ff26694327ad173c51c2724)
      Harald Anlauf committed
    • Enable CET in cross compiler if possible · 2c7ae013
      Don't perform CET run-time check for host when cross compiling.  Instead,
      enable CET in cross compiler if possible so that it will run on both CET
      and non-CET hosts.
      
      config/
      
      	PR bootstrap/94998
      	* cet.m4 (GCC_CET_HOST_FLAGS): Enable CET in cross compiler if
      	possible.
      
      libiberty/
      
      	PR bootstrap/94998
      	* configure: Regenerated.
      
      lto-plugin/
      
      	PR bootstrap/94998
      	* configure: Regenerated.
      
      (cherry picked from commit d17cdc17c90ce77cb90c569322c1f241d3530cec)
      H.J. Lu committed
    • Daily bump. · 2b7784f5
      GCC Administrator committed
  3. 21 Jun, 2020 2 commits
    • coroutines: Update handling and failure for g-r-o-o-a-f [PR95505] · a59a15bc
      The actual issue is that (in the testcase) std::nothrow is not
      available.  So update the handling of the get-return-on-alloc-fail
      to include the possibility that std::nothrow might not be
      available.
      
      gcc/cp/ChangeLog:
      
      	PR c++/95505
      	* coroutines.cc (morph_fn_to_coro): Update handling of
      	get-return-object-on-allocation-fail and diagnose missing
      	std::nothrow.
      
      gcc/testsuite/ChangeLog:
      
      	PR c++/95505
      	* g++.dg/coroutines/pr95505.C: New test.
      
      (cherry picked from commit 445d8da5fbd10e32f8ea470bd9ac02faba8fd718)
      Iain Sandoe committed
    • Daily bump. · e80ee62b
      GCC Administrator committed
  4. 20 Jun, 2020 2 commits
    • Add missing unit dependence vector in data dependence analysis · 63c00a0c
      Current data dependence analysis misses unit distant vector if DRs in
      DDR have the same invariant access functions.  This adds the vector as
      the constant access function case.
      
      Also fix typo in testcase.
      
      Backport from master.
      
      2020-06-20  Bin Cheng  <bin.cheng@linux.alibaba.com>
      
      gcc/
      	PR tree-optimization/94969
      	* tree-data-ref.c (constant_access_functions): Rename to...
      	(invariant_access_functions): ...this.  Add parameter.  Check for
      	invariant access function, rather than constant.
      	(build_classic_dist_vector): Call above function.
      	* tree-loop-distribution.c (pg_add_dependence_edges): Add comment.
      
      gcc/testsuite/
      	PR tree-optimization/94969
      	* gcc.dg/tree-ssa/pr94969.c: New test.
      
      2020-06-20  Jakub Jelinek  <jakub@redhat.com>
      
      gcc/testsuite/
      	PR tree-optimization/95110
      	* gcc.dg/tree-ssa/pr94969.c: Swap scan-tree-dump-not arguments.
      Bin Cheng committed
    • Daily bump. · f8602c3c
      GCC Administrator committed
  5. 19 Jun, 2020 5 commits
    • c++: Allow defaulted comparison outside class. · f8e16e23
      Implementing P2085, another refinement to the operator<=> specification from
      the Prague meeting.  It was deemed desirable to be able to have a non-inline
      defaulted definition of a comparison operator just like you can with other
      defaulted functions.
      
      gcc/cp/ChangeLog:
      
      	* method.c (early_check_defaulted_comparison): Allow defaulting
      	comparison outside class.  Complain if non-member operator isn't a
      	friend.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/spaceship-friend1.C: New test.
      	* g++.dg/cpp2a/spaceship-err4.C: Adjust diagnostic.
      Jason Merrill committed
    • c++: More P2002 operator<=> refinements. · 78b19135
      * Disallow && references.
      * Allow empty unions.
      * Improve diagnostics for a subobject comparison with
        non-comparison-category type.
      
      gcc/cp/ChangeLog:
      
      	* method.c (early_check_defaulted_comparison): Check for &&.
      	(build_comparison_op): Allow empty union.  Diagnose non-category
      	type.
      	(common_comparison_type): Remove handling for non-category type.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/spaceship-ref1.C: New test.
      	* g++.dg/cpp2a/spaceship-synth-neg4.C: New test.
      	* g++.dg/cpp2a/spaceship-union1.C: New test.
      Jason Merrill committed
    • c++: Fix consteval operator handling. · 9014cb7c
      We were crashing trying to find the CALL_EXPR in the result of a call to a
      consteval operator.
      
      gcc/cp/ChangeLog:
      
      	* call.c (build_new_op_1): Don't look for a CALL_EXPR when
      	calling a consteval function.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/consteval17.C: New test.
      Jason Merrill committed
    • Introduce flag_cunroll_grow_size for cunroll and avoid enable it at -O2 · 60bd3f20
      Currently GIMPLE complete unroller(cunroll) is checking
      flag_unroll_loops and flag_peel_loops to see if allow size growth.
      Beside affects curnoll, flag_unroll_loops also controls RTL unroler.
      To have more freedom to control cunroll and RTL unroller, this patch
      introduces flag_cunroll_grow_size.  With this patch, we can control
      cunroll and RTL unroller indepently. And enable flag_cunroll_grow_size
      only if -funroll-loops or -fpeel-loops or -O3 is specified explicitly.
      
      gcc/ChangeLog
      2020-06-19  Jiufu Guo  <guojiufu@linux.ibm.com>
      
      	PR target/95018
      	* common.opt (flag_cunroll_grow_size): New flag.
      	* toplev.c (process_options): Set flag_cunroll_grow_size.
      	* tree-ssa-loop-ivcanon.c (pass_complete_unroll::execute):
      	Use flag_cunroll_grow_size.
      	* config/rs6000/rs6000.c (rs6000_option_override_internal):
      	Override flag_cunroll_grow_size.
      guojiufu committed
    • Daily bump. · eb13d29d
      GCC Administrator committed
  6. 18 Jun, 2020 6 commits
    • identify lfs prefixed case PR95347 · 6e81b0cf
      The same problem also arises for plfs where prefixed_load_p()
      doesn't recognize it so we get just lfs in the asm output
      with an @pcrel address.
      
      	Backport from master
      	2020-06-03  Aaron Sawdey  <acsawdey@linux.ibm.com>
      
      	PR target/95347
      	* config/rs6000/rs6000.c (is_stfs_insn): Rename to
      	is_lfs_stfs_insn and make it recognize lfs as well.
      	(prefixed_store_p): Use is_lfs_stfs_insn().
      	(prefixed_load_p): Use is_lfs_stfs_insn() to recognize lfs.
      Aaron Sawdey committed
    • Correctly identify stfs if prefixed · 541e8c4d
      Because reg_to_non_prefixed() only looks at the register being used, it
      doesn't get the right answer for stfs, which leads to us not seeing
      that it has a PCREL symbol ref.  This patch works around this by
      introducing a helper function that inspects the insn to see if it is in
      fact a stfs. Then if we use NON_PREFIXED_DEFAULT, address_to_insn_form()
      can see that it has the PCREL symbol ref.
      
      	Backport from master
      	2020-06-02  Aaron Sawdey  <acsawdey@linux.ibm.com>
      
      	PR target/95347
      	* config/rs6000/rs6000.c (prefixed_store_p): Add special case
      	for stfs.
      	(is_stfs_insn): New helper function.
      Aaron Sawdey committed
    • forwprop: simplify_vector_constructor follow-up fix [PR95713] · 0c7d18d5
      As the following testcase shows, the exception for the aarch64
      vec_pack_trunc_di is not sufficient on x86, the halfvectype
      "vectors" have SImode but the x86 vec_pack_trunc_si meant for
      the bool bitmasks combines 2x SImode into DImode, while in the
      testcase the halfvectype is 1x SImode "vector" with SImode and
      result is 2x HImode "vector" with SImode.
      
      Richard Sandiford's reply:
      FWIW, since the aarch64 case was only found by inspection and might
      not be useful, personally I'd prefer to drop that case after all.
      
      2020-06-18  Jakub Jelinek  <jakub@redhat.com>
      
      	PR target/95713
      	* tree-ssa-forwprop.c (simplify_vector_constructor): Don't allow
      	scalar mode halfvectype other than vector boolean for
      	VEC_PACK_TRUNC_EXPR.
      
      	* gcc.dg/pr95713.c: New test.
      
      (cherry picked from commit 9a875db43cd4210843c480c8df26a1d6624d057d)
      Jakub Jelinek committed
    • [PATCH][GCC] arm: Fix the MVE ACLE vaddq_m polymorphic variants. · dccc54d2
      Hello,
      
      This patch fixes the MVE ACLE vaddq_m polymorphic variants by modifying the corresponding
      intrinsic parameters and vaddq_m polymorphic variant's _Generic case entries in "arm_mve.h"
      header file.
      
      2020-06-04  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>
      
      gcc/
      	* config/arm/arm_mve.h (__arm_vaddq_m_n_s8): Correct the intrinsic
      	arguments.
      	(__arm_vaddq_m_n_s32): Likewise.
      	(__arm_vaddq_m_n_s16): Likewise.
      	(__arm_vaddq_m_n_u8): Likewise.
      	(__arm_vaddq_m_n_u32): Likewise.
      	(__arm_vaddq_m_n_u16): Likewise.
      	(__arm_vaddq_m): Modify polymorphic variant.
      
      gcc/testsuite/
      	* gcc.target/arm/mve/intrinsics/mve_vaddq_m.c: New test.
      
      (cherry picked from commit dc39db873670bea8d8e655444387ceaa53a01a79)
      Srinath Parvathaneni committed
    • [PATCH][GCC] arm: Fix MVE scalar shift intrinsics code-gen. · 824d48ec
      This patch modifies the MVE scalar shift RTL patterns. The current patterns
      have wrong constraints and predicates due to which the values returned from
      MVE scalar shift instructions are overwritten in the code-gen.
      
      example:
      $ cat x.c
      int32_t  foo(int64_t acc, int shift)
      {
        return sqrshrl_sat48 (acc, shift);
      }
      
      Code-gen before applying this patch:
      $ arm-none-eabi-gcc -march=armv8.1-m.main+mve -mfloat-abi=hard -O2 -S
      $  cat x.s
      foo:
         push    {r4, r5}
         sqrshrl r0, r1, #48, r2   ----> (a)
         mov     r0, r4  ----> (b)
         pop     {r4, r5}
         bx      lr
      
      Code-gen after applying this patch:
      foo:
         sqrshrl r0, r1, #48, r2
         bx      lr
      
      In the current compiler the return value (r0) from sqrshrl (a) is getting
      overwritten by the mov statement (b).
      This patch fixes above issue.
      
      2020-06-12  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>
      
      gcc/
      	* config/arm/mve.md (mve_uqrshll_sat<supf>_di): Correct the predicate
      	and constraint of all the operands.
      	(mve_sqrshrl_sat<supf>_di): Likewise.
      	(mve_uqrshl_si): Likewise.
      	(mve_sqrshr_si): Likewise.
      	(mve_uqshll_di): Likewise.
      	(mve_urshrl_di): Likewise.
      	(mve_uqshl_si): Likewise.
      	(mve_urshr_si): Likewise.
      	(mve_sqshl_si): Likewise.
      	(mve_srshr_si): Likewise.
      	(mve_srshrl_di): Likewise.
      	(mve_sqshll_di): Likewise.
      	* config/arm/predicates.md (arm_low_register_operand): Define.
      
      gcc/testsuite/
      	* gcc.target/arm/mve/intrinsics/mve_scalar_shifts1.c: New test.
      	* gcc.target/arm/mve/intrinsics/mve_scalar_shifts2.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/mve_scalar_shifts3.c: Likewise.
      	* gcc.target/arm/mve/intrinsics/mve_scalar_shifts4.c: Likewise.
      
      (cherry picked from commit 6af598703f919b56f628c496843cdfe6f0cb8276)
      Srinath Parvathaneni committed
    • Daily bump. · 934a5fa5
      GCC Administrator committed
  7. 17 Jun, 2020 4 commits
    • Add 'dg-do run' to 'libgomp.fortran/use_device_ptr-optional-3.f90' [PR94848] · 61c896d8
      Fix-up for r279858/commit f760c0c7 "Fortran]
      OpenMP/OpenACC – fix more issues with OPTIONAL".
      
      With offloading enabled, we then saw:
      
          PASS: libgomp.fortran/use_device_ptr-optional-3.f90   -O0  (test for excess errors)
          PASS: libgomp.fortran/use_device_ptr-optional-3.f90   -O0  execution test
          PASS: libgomp.fortran/use_device_ptr-optional-3.f90   -O1  (test for excess errors)
          PASS: libgomp.fortran/use_device_ptr-optional-3.f90   -O1  execution test
          FAIL: libgomp.fortran/use_device_ptr-optional-3.f90   -O2  (test for excess errors)
          UNRESOLVED: libgomp.fortran/use_device_ptr-optional-3.f90   -O2  compilation failed to produce executable
          FAIL: libgomp.fortran/use_device_ptr-optional-3.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess errors)
          UNRESOLVED: libgomp.fortran/use_device_ptr-optional-3.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  compilation failed to produce executable
          FAIL: libgomp.fortran/use_device_ptr-optional-3.f90   -O3 -g  (test for excess errors)
          UNRESOLVED: libgomp.fortran/use_device_ptr-optional-3.f90   -O3 -g  compilation failed to produce executable
          FAIL: libgomp.fortran/use_device_ptr-optional-3.f90   -Os  (test for excess errors)
          UNRESOLVED: libgomp.fortran/use_device_ptr-optional-3.f90   -Os  compilation failed to produce executable
      
       ... due to:
      
          /tmp/cciVc43I.o:(.gnu.offload_vars+0x10): undefined reference to `A.12.4064'
          [...]
      
      ..., but after the recent PR94848, PR95551 changes, that problem is now gone.
      
      	libgomp/
      	PR lto/94848
      	* testsuite/libgomp.fortran/use_device_ptr-optional-3.f90: Add
      	'dg-do run'.
      
      (cherry picked from commit 5864930754f63e2dcef9606f2514ae20e80f436e)
      Thomas Schwinge committed
    • hurd: libgcc unwinding support over signal trampolines · a2b187c1
      	libgcc/
      	* config.host (md_unwind_header) <i[34567]86-*-gnu*>: Set to
      	'i386/gnu-unwind.h'
      	* config/i386/gnu-unwind.h: New file.
      
      Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
      (cherry picked from commit 5e2eebc80d6eeca24745c27a925afdb64292ed22)
      Samuel Thibault committed
    • [HSA] Avoid ICE when "HSA does not implement indirect calls" · ad3f0ec1
      Made apparent by recent commit dc703151d4f4560e647649506d5b4ceb0ee11e90
      "openmp: Implement discovery of implicit declare target to clauses":
      
          +FAIL: libgomp.c/target-39.c (internal compiler error)
          +FAIL: libgomp.c/target-39.c (test for excess errors)
          +UNRESOLVED: libgomp.c/target-39.c compilation failed to produce executable
      
      This is in a '--enable-offload-targets=[...],hsa' build, with '-foffload=hsa'
      enabled (by default).
      
          during GIMPLE pass: hsagen
          source-gcc/libgomp/testsuite/libgomp.c/target-39.c: In function ‘main._omp_fn.0.hsa.0’:
          source-gcc/libgomp/testsuite/libgomp.c/target-39.c:23:11: internal compiler error: Segmentation fault
             23 |   #pragma omp target map(from:err)
                |           ^~~
          [...]
      
      GDB:
      
          Program received signal SIGSEGV, Segmentation fault.
          fndecl_built_in_p (node=0x0, name=BUILT_IN_PREFETCH) at [...]/source-gcc/gcc/tree.h:6267
          6267      return (fndecl_built_in_p (node, BUILT_IN_NORMAL)
          (gdb) bt
          #0  fndecl_built_in_p (node=0x0, name=BUILT_IN_PREFETCH) at [...]/source-gcc/gcc/tree.h:6267
          #1  0x0000000000b19739 in gen_hsa_insns_for_call (stmt=stmt@entry=0x7ffff693b200, hbb=hbb@entry=0x2b152c0) at [...]/source-gcc/gcc/hsa-gen.c:5304
          #2  0x0000000000b1aca7 in gen_hsa_insns_for_gimple_stmt (stmt=0x7ffff693b200, hbb=hbb@entry=0x2b152c0) at [...]/source-gcc/gcc/hsa-gen.c:5770
          #3  0x0000000000b1bd21 in gen_body_from_gimple () at [...]/source-gcc/gcc/hsa-gen.c:5999
          #4  0x0000000000b1dbd2 in generate_hsa (kernel=<optimized out>) at [...]/source-gcc/gcc/hsa-gen.c:6596
          #5  0x0000000000b1de66 in (anonymous namespace)::pass_gen_hsail::execute (this=0x2a2aac0) at [...]/source-gcc/gcc/hsa-gen.c:6680
          #6  0x0000000000d06f90 in execute_one_pass (pass=pass@entry=0x2a2aac0) at [...]/source-gcc/gcc/passes.c:2502
          [...]
          (gdb) up
          #1  0x0000000000b19739 in gen_hsa_insns_for_call (stmt=stmt@entry=0x7ffff693b200, hbb=hbb@entry=0x2b152c0) at /home/thomas/tmp/source/gcc/build/track-slim-omp/source-gcc/gcc/hsa-gen.c:5304
          5304          if (fndecl_built_in_p (function_decl, BUILT_IN_PREFETCH))
          (gdb) print function_decl
          $1 = (tree) 0x0
          (gdb) list
          5299      if (!gimple_call_builtin_p (stmt, BUILT_IN_NORMAL))
          5300        {
          5301          tree function_decl = gimple_call_fndecl (stmt);
          5302          /* Prefetch pass can create type-mismatching prefetch builtin calls which
          5303             fail the gimple_call_builtin_p test above.  Handle them here.  */
          5304          if (fndecl_built_in_p (function_decl, BUILT_IN_PREFETCH))
          5305            return;
          5306
          5307          if (function_decl == NULL_TREE)
          5308            {
      
      The problem is present already since 2016-11-23 commit
      56b1c60e (r242761) "Merge from HSA branch to
      trunk", and the fix obvious enough.
      
      	gcc/
      	* hsa-gen.c (gen_hsa_insns_for_call): Move 'function_decl ==
      	NULL_TREE' check earlier.
      	gcc/testsuite/
      	* c-c++-common/gomp/hsa-indirect-call-1.c: New file.
      
      (cherry picked from commit 973bce0fb50bbfd91f47238b82b99935525716ad)
      Thomas Schwinge committed
    • PR fortran/95088 - Buffer overflows with PDTs, submodules and long symbols · 55838f7f
      With PDTs (parameterized derived types) and submodules, name mangling
      results in variably long internal symbols.  Instead of using a fixed-size
      intermediate buffer, which is actually not really needed, just use a
      pointer to strings.
      
      2020-06-14  Harald Anlauf  <anlauf@gmx.de>
      
      gcc/fortran/
      	PR fortran/95088
      	* class.c (get_unique_type_string): Replace use of fixed size
      	buffer by internally passing a pointer to strings.
      
      (cherry picked from commit 3ee9d82484bdc0ae5b1b21f4a3d8ff46d40e36fd)
      Harald Anlauf committed