1. 23 Jul, 2020 2 commits
  2. 22 Jul, 2020 1 commit
  3. 21 Jul, 2020 2 commits
  4. 20 Jul, 2020 2 commits
  5. 19 Jul, 2020 1 commit
  6. 18 Jul, 2020 1 commit
  7. 17 Jul, 2020 2 commits
  8. 16 Jul, 2020 2 commits
    • Stefan Schulze Frielinghaus's avatar
      S/390: Emit vector alignment hints for z13 if AS accepts them · 710f7d97
      Stefan Schulze Frielinghaus authored
      Squashed with commit f842bdd7a97e9fef7513a266d641cac72d5f97cc
      
      gcc/ChangeLog:
      
      	* config.in: Regenerate.
      	* config/s390/s390.c (print_operand): Emit vector alignment hints
      	for target z13, if AS accepts them.  For other targets the logic
      	stays the same.
      	* config/s390/s390.h (TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS): Define
      	macro.
      	* configure: Regenerate.
      	* configure.ac: Check HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/s390/vector/align-1.c: Change target architecture
      	to z13.
      	* gcc.target/s390/vector/align-2.c: Change target architecture
      	to z13.
      
      (cherry picked from commit 929fd91b)
      710f7d97
    • GCC Administrator's avatar
      Daily bump. · 25f8c710
      GCC Administrator authored
      25f8c710
  9. 15 Jul, 2020 4 commits
    • Richard Sandiford's avatar
      c++: Treat GNU and Advanced SIMD vectors as distinct [PR95726] · 932e9140
      Richard Sandiford authored
      This is a release branch version of
      r11-1741-g:31427b97 and
      r11-2022-g:efe99cca.
      
      The trunk versions of the patch made GNU and Advanced SIMD vectors
      distinct (but inter-convertible) in all cases.  However, the
      traditional behaviour is that the types are distinct in template
      arguments but not otherwise.
      
      Following a suggestion from Jason, this patch puts the check
      for different vector types under comparing_specializations.
      In order to keep the backport as simple as possible, the patch
      hard-codes the name of the attribute in the frontend rather than
      adding a new branch-only target hook.
      
      I didn't find a test that tripped the assert on the branch,
      even with the --param in the PR, so instead I tested this by
      forcing the hash function to only hash the tree code.  That made
      the static assertion in the test fail without the patch but pass
      with it.
      
      This means that the tests pass for unmodified sources even
      without the patch (unless you're very unlucky).
      
      gcc/
      	PR target/95726
      	* config/aarch64/aarch64.c (aarch64_attribute_table): Add
      	"Advanced SIMD type".
      	* config/aarch64/aarch64-builtins.c: Include stringpool.h and
      	attribs.h.
      	(aarch64_init_simd_builtin_types): Add an "Advanced SIMD type"
      	attribute to each Advanced SIMD type.
      	* config/arm/arm.c (arm_attribute_table): Add "Advanced SIMD type".
      	* config/arm/arm-builtins.c: Include stringpool.h and attribs.h.
      	(arm_init_simd_builtin_types): Add an "Advanced SIMD type"
      	attribute to each Advanced SIMD type.
      
      gcc/cp/
      	PR target/95726
      	* typeck.c (structural_comptypes): When comparing template
      	specializations, differentiate between vectors that have and
      	do not have an "Advanced SIMD type" attribute.
      
      gcc/testsuite/
      	PR target/95726
      	* g++.target/aarch64/pr95726.C: New test.
      	* g++.target/arm/pr95726.C: Likewise.
      932e9140
    • Jakub Jelinek's avatar
      fix _mm512_{,mask_}cmp*_p[ds]_mask at -O0 [PR96174] · 9a9e1ed8
      Jakub Jelinek authored
      The _mm512_{,mask_}cmp_p[ds]_mask and also _mm_{,mask_}cmp_s[ds]_mask
      intrinsics have an argument which must have a constant passed to it
      and so use an inline version only for ifdef __OPTIMIZE__ and have
      a #define for -O0.  But the _mm512_{,mask_}cmp*_p[ds]_mask intrinsics
      don't need a constant argument, they are essentially the first
      set with the constant added to them implicitly based on the comparison
      name, and so there is no #define version for them (correctly).
      But their inline versions are defined in between the first and s[ds]
      set and so inside of ifdef __OPTIMIZE__, which means that with -O0
      they aren't defined at all.
      
      This patch fixes that by moving those after the #ifdef __OPTIMIZE #else
      use #define #endif block.
      
      2020-07-15  Jakub Jelinek  <jakub@redhat.com>
      
      	PR target/96174
      	* config/i386/avx512fintrin.h (_mm512_cmpeq_pd_mask,
      	_mm512_mask_cmpeq_pd_mask, _mm512_cmplt_pd_mask,
      	_mm512_mask_cmplt_pd_mask, _mm512_cmple_pd_mask,
      	_mm512_mask_cmple_pd_mask, _mm512_cmpunord_pd_mask,
      	_mm512_mask_cmpunord_pd_mask, _mm512_cmpneq_pd_mask,
      	_mm512_mask_cmpneq_pd_mask, _mm512_cmpnlt_pd_mask,
      	_mm512_mask_cmpnlt_pd_mask, _mm512_cmpnle_pd_mask,
      	_mm512_mask_cmpnle_pd_mask, _mm512_cmpord_pd_mask,
      	_mm512_mask_cmpord_pd_mask, _mm512_cmpeq_ps_mask,
      	_mm512_mask_cmpeq_ps_mask, _mm512_cmplt_ps_mask,
      	_mm512_mask_cmplt_ps_mask, _mm512_cmple_ps_mask,
      	_mm512_mask_cmple_ps_mask, _mm512_cmpunord_ps_mask,
      	_mm512_mask_cmpunord_ps_mask, _mm512_cmpneq_ps_mask,
      	_mm512_mask_cmpneq_ps_mask, _mm512_cmpnlt_ps_mask,
      	_mm512_mask_cmpnlt_ps_mask, _mm512_cmpnle_ps_mask,
      	_mm512_mask_cmpnle_ps_mask, _mm512_cmpord_ps_mask,
      	_mm512_mask_cmpord_ps_mask): Move outside of __OPTIMIZE__ guarded
      	section.
      
      	* gcc.target/i386/avx512f-vcmppd-3.c: New test.
      	* gcc.target/i386/avx512f-vcmpps-3.c: New test.
      
      (cherry picked from commit 12d69dbf)
      9a9e1ed8
    • Richard Biener's avatar
      Revert "LTO: pick up -fcf-protection flag for the link step" · 76641cd8
      Richard Biener authored
      This reverts commit 8147c741.
      
      2020-07-15  Richard Biener  <rguenther@suse.de>
      
      	PR bootstrap/96203
      	* lto-opts.c: Revert changes.
      	* lto-wrapper.c: Likewise.
      76641cd8
    • GCC Administrator's avatar
      Daily bump. · 42195da6
      GCC Administrator authored
      42195da6
  10. 14 Jul, 2020 7 commits
    • Marek Polacek's avatar
      c++: Make convert_like complain about bad ck_ref_bind again [PR95789] · 315b87f6
      Marek Polacek authored
      convert_like issues errors about bad_p conversions at the beginning
      of the function, but in the ck_ref_bind case, it only issues them
      after we've called convert_like on the next conversion.
      
      This doesn't work as expected since r10-7096 because when we see
      a conversion from/to class type in a template, we return early, thereby
      missing the error, and a bad_p conversion goes by undetected.  That
      made the attached test to compile even though it should not.
      
      I had thought that I could just move the ck_ref_bind/bad_p errors
      above to the rest of them, but that regressed diagnostics because
      expr then wasn't converted yet by the nested convert_like_real call.
      
      So, for bad_p conversions, do the normal processing, but still return
      the IMPLICIT_CONV_EXPR to avoid introducing trees that the template
      processing can't handle well.  This I achieved by adding a wrapper
      function.
      
      gcc/cp/ChangeLog:
      
      	PR c++/95789
      	PR c++/96104
      	PR c++/96179
      	* call.c (convert_like_real_1): Renamed from convert_like_real.
      	(convert_like_real): New wrapper for convert_like_real_1.
      
      gcc/testsuite/ChangeLog:
      
      	PR c++/95789
      	PR c++/96104
      	PR c++/96179
      	* g++.dg/conversion/ref4.C: New test.
      	* g++.dg/conversion/ref5.C: New test.
      	* g++.dg/conversion/ref6.C: New test.
      
      (cherry picked from commit 8e64d182)
      315b87f6
    • Kwok Cheung Yeung's avatar
      libgomp: Fix hang when profiling OpenACC programs with CUDA 9.0 nvprof · a1c022d1
      Kwok Cheung Yeung authored
      The version of nvprof in CUDA 9.0 causes a hang when used to profile an
      OpenACC program.  This is because it calls acc_get_device_type from
      a callback called during device initialization, which then attempts
      to acquire acc_device_lock while it is already taken, resulting in
      deadlock.  This works around the issue by returning acc_device_none
      from acc_get_device_type without attempting to acquire the lock when
      initialization has not completed yet.
      
      2020-07-14  Tom de Vries  <tom@codesourcery.com>
      	    Cesar Philippidis  <cesar@codesourcery.com>
      	    Thomas Schwinge  <thomas@codesourcery.com>
      	    Kwok Cheung Yeung  <kcy@codesourcery.com>
      
      	libgomp/
      	* oacc-init.c (acc_init_state_lock, acc_init_state, acc_init_thread):
      	New variable.
      	(acc_init_1): Set acc_init_thread to pthread_self ().  Set
      	acc_init_state to initializing at the start, and to initialized at the
      	end.
      	(self_initializing_p): New function.
      	(acc_get_device_type): Return acc_device_none if called by thread that
      	is currently executing acc_init_1.
      	* libgomp.texi (acc_get_device_type): Update documentation.
      	(Implementation Status and Implementation-Defined Behavior): Likewise.
      	* testsuite/libgomp.oacc-c-c++-common/acc_prof-init-2.c: New.
      
      (cherry picked from commit b52643ab)
      a1c022d1
    • Richard Sandiford's avatar
      ipa-devirt: Fix crash in obj_type_ref_class [PR95114] · 74d4c8bd
      Richard Sandiford authored
      The testcase has failed since r9-5035, because obj_type_ref_class
      tries to look up an ODR type when no ODR type information is
      available.  (The information was available earlier in the
      compilation, but was freed during pass_ipa_free_lang_data.)
      We then crash dereferencing the null get_odr_type result.
      
      The test passes with -O2.  However, it fails again if -fdump-tree-all
      is used, since obj_type_ref_class is called indirectly from the
      dump routines.
      
      Other code creates ODR type entries on the fly by passing “true”
      as the insert parameter.  But obj_type_ref_class can't do that
      unconditionally, since it should have no side-effects when used
      from the dumping code.
      
      Following a suggestion from Honza, this patch adds parameters
      to say whether the routines are being called from dump routines
      and uses those to derive the insert parameter.
      
      gcc/
      	PR middle-end/95114
      	* tree.h (virtual_method_call_p): Add a default-false parameter
      	that indicates whether the function is being called from dump
      	routines.
      	(obj_type_ref_class): Likewise.
      	* tree.c (virtual_method_call_p): Likewise.
      	* ipa-devirt.c (obj_type_ref_class): Likewise.  Lazily add ODR
      	type information for the type when the parameter is false.
      	* tree-pretty-print.c (dump_generic_node): Update calls to
      	virtual_method_call_p and obj_type_ref_class accordingly.
      
      gcc/testsuite/
      	PR middle-end/95114
      	* g++.target/aarch64/pr95114.C: New test.
      74d4c8bd
    • Richard Sandiford's avatar
      value-range: Fix handling of POLY_INT_CST anti-ranges [PR96146] · b9475357
      Richard Sandiford authored
      The range infrastructure has code to decompose POLY_INT_CST ranges
      to worst-case integer bounds.  However, it had the fundamental flaw
      (obvious in hindsight) that it applied to anti-ranges too, meaning
      that a range 2+2X would end up with a range of ~[2, +INF], i.e.
      [-INF, 1].  This patch decays to varying in that case instead.
      
      I'm still a bit uneasy about this.  ISTM that in terms of
      generality:
      
        SSA_NAME => POLY_INT_CST => INTEGER_CST
                 => ADDR_EXPR
      
      I.e. an SSA_NAME could store a POLY_INT_CST and a POLY_INT_CST
      could store an INTEGER_CST (before canonicalisation).  POLY_INT_CST
      is also “as constant as” ADDR_EXPR (well, OK, only some ADDR_EXPRs
      are run-time rather than link-time constants, whereas all POLY_INT_CSTs
      are, but still).  So it seems like we should at least be able to treat
      POLY_INT_CST as symbolic.  On the other hand, I don't have any examples
      in which that would be useful.
      
      gcc/
      	PR tree-optimization/96146
      	* value-range.cc (value_range::set): Only decompose POLY_INT_CST
      	bounds to integers for VR_RANGE.  Decay to VR_VARYING for anti-ranges
      	involving POLY_INT_CSTs.
      
      gcc/testsuite/
      	PR tree-optimization/96146
      	* gcc.target/aarch64/sve/acle/general/pr96146.c: New test.
      b9475357
    • Jakub Jelinek's avatar
      expr: Unbreak build of mesa [PR96194] · de707582
      Jakub Jelinek authored
      > > The store to the whole of each volatile object was picked apart
      > > like there had been an individual assignment to each of the
      > > fields.  Reads were added as part of that; see PR for details.
      > > The reads from volatile memory were a clear bug; individual
      > > stores questionable.  A separate patch clarifies the docs.
      
      This breaks building of mesa on both the trunk and 10 branch.
      
      The problem is that the middle-end may never create temporaries of non-POD
      (TREE_ADDRESSABLE) types, those can be only created when the language says
      so and thus only the FE is allowed to create those.
      
      This patch just reverts the behavior to what we used to do before for the
      stores to volatile non-PODs.  Perhaps we want to do something else, but
      definitely we can't create temporaries of the non-POD type.  It is up to
      discussions on what should happen in those cases.
      
      2020-07-14  Jakub Jelinek  <jakub@redhat.com>
      
      	PR middle-end/96194
      	* expr.c (expand_constructor): Don't create temporary for store to
      	volatile MEM if exp has an addressable type.
      
      	* g++.dg/opt/pr96194.C: New test.
      
      (cherry picked from commit b1d389d6)
      de707582
    • Matthias Klose's avatar
      LTO: pick up -fcf-protection flag for the link step · 8147c741
      Matthias Klose authored
      2020-07-14  Matthias Klose  <doko@ubuntu.com>
      
      	PR lto/95604
      	* lto-wrapper.c (merge_and_complain): Add decoded options as parameter,
      	error on different values for -fcf-protection.
      	(append_compiler_options): Pass -fcf-protection option.
      	(find_and_merge_options): Add decoded options as parameter,
      	pass decoded_options to merge_and_complain.
      	(run_gcc): Pass decoded options to find_and_merge_options.
      	* lto-opts.c (lto_write_options): Pass -fcf-protection option.
      
      (cherry picked from commit 6a48d124)
      8147c741
    • GCC Administrator's avatar
      Daily bump. · 13d817af
      GCC Administrator authored
      13d817af
  11. 13 Jul, 2020 16 commits
    • Aaron Sawdey's avatar
      rs6000: clean up testsuite power10_hw check · d6e9f27f
      Aaron Sawdey authored
      Because the check for power10_hw is not called
      check_effective_target_power10_hw, it needs to be looked
      for by is-effective-target-keyword. Also reorder things
      in is-effective-target to put power10_hw with the other
      ppc stuff.
      
      2020-07-13  Aaron Sawdey  <acsawdey@linux.ibm.com>
      
      gcc/testsuite/
      
      	* lib/target-supports.exp (is-effective-target):
      	Reorder to put powerpc stuff together.
      	(is-effective-target-keyword): Add power10_hw.
      
      (cherry picked from commit 94c7c67b)
      d6e9f27f
    • Aaron Sawdey's avatar
      rs6000: add effective-target test ppc_mma_hw · 1aae91e6
      Aaron Sawdey authored
      Add a test for dejagnu to determine if execution of MMA instructions is
      supported in the test environment. Add an execution test to make sure
      that __builtin_cpu_supports("mma") is true if we can execute MMA
      instructions.
      
      2020-07-13  Aaron Sawdey  <acsawdey@linux.ibm.com>
      
      gcc/testsuite/
      
      	* lib/target-supports.exp (check_ppc_mma_hw_available):
      	New function.
      	(is-effective-target): Add ppc_mma_hw.
      	(is-effective-target-keyword): Add ppc_mma_hw.
      	* gcc.target/powerpc/mma-supported.c: New file.
      	* gcc.target/powerpc/mma-single-test.c: Require ppc_mma_hw.
      	* gcc.target/powerpc/mma-double-test.c: Require ppc_mma_hw.
      
      (cherry picked from commit 305ab735)
      1aae91e6
    • Szabolcs Nagy's avatar
      aarch64: Add missing ACLE support for PAC-RET · a4d20889
      Szabolcs Nagy authored
      Define the __ARM_FEATURE_PAC_DEFAULT feature test
      macro when PAC-RET branch protection is enabled.
      
      2020-07-13  Szabolcs Nagy  <szabolcs.nagy@arm.com>
      
      gcc/ChangeLog:
      
      	* config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins): Add
      	__ARM_FEATURE_PAC_DEFAULT support.
      
      (cherry picked from commit a1faa8e2)
      a4d20889
    • Szabolcs Nagy's avatar
      doc: Clarify __builtin_return_address [PR94891] · 7e5bb3ce
      Szabolcs Nagy authored
      The expected semantics and valid usage of __builtin_return_address is
      not clear since it exposes implementation internals that are normally
      not meaningful to portable c code.
      
      This documentation change tries to clarify the semantics in case the
      return address is stored in a mangled form. This affects AArch64 when
      pointer authentication is used for the return address signing (i.e.
      -mbranch-protection=pac-ret).
      
      2020-07-13  Szabolcs Nagy  <szabolcs.nagy@arm.com>
      
      gcc/ChangeLog:
      
      	PR target/94891
      	* doc/extend.texi: Update the text for  __builtin_return_address.
      
      (cherry picked from commit 6a391e06)
      7e5bb3ce
    • Szabolcs Nagy's avatar
      libgcc: fix the handling of return address mangling [PR94891] · c24e8063
      Szabolcs Nagy authored
      Mangling, currently only used on AArch64 for return address signing,
      is an internal representation that should not be exposed via
      
        __builtin_return_address return value,
        __builtin_eh_return handler argument,
        _Unwind_DebugHook handler argument.
      
      Note that a mangled address might not even fit into a void *, e.g.
      with AArch64 ilp32 ABI the return address is stored as 64bit, so
      the mangled return address cannot be accessed via _Unwind_GetPtr.
      
      This patch changes the unwinder hooks as follows:
      
      MD_POST_EXTRACT_ROOT_ADDR is removed: root address comes from
      __builtin_return_address which is not mangled.
      
      MD_POST_EXTRACT_FRAME_ADDR is renamed to MD_DEMANGLE_RETURN_ADDR,
      it now operates on _Unwind_Word instead of void *, so the hook
      should work when return address signing is enabled on AArch64 ilp32.
      (But for that __builtin_aarch64_autia1716 should be fixed to operate
      on 64bit input instead of a void *.)
      
      MD_POST_FROB_EH_HANDLER_ADDR is removed: it is the responsibility of
      __builtin_eh_return to do the mangling if necessary.
      
      2020-07-13  Szabolcs Nagy  <szabolcs.nagy@arm.com>
      
      libgcc/ChangeLog:
      
      	PR target/94891
      	* config/aarch64/aarch64-unwind.h (MD_POST_EXTRACT_ROOT_ADDR): Remove.
      	(MD_POST_FROB_EH_HANDLER_ADDR): Remove.
      	(MD_POST_EXTRACT_FRAME_ADDR): Rename to ...
      	(MD_DEMANGLE_RETURN_ADDR): This.
      	(aarch64_post_extract_frame_addr): Rename to ...
      	(aarch64_demangle_return_addr): This.
      	(aarch64_post_frob_eh_handler_addr): Remove.
      	* unwind-dw2.c (uw_update_context): Demangle return address.
      	(uw_frob_return_addr): Remove.
      
      (cherry picked from commit b097c7a2)
      c24e8063
    • Szabolcs Nagy's avatar
      aarch64: fix __builtin_eh_return with pac-ret [PR94891] · eb41624d
      Szabolcs Nagy authored
      Currently __builtin_eh_return takes a signed return address, which can
      cause ABI and API issues: 1) pointer representation problems if the
      address is passed around before eh return, 2) the source code needs
      pac-ret specific changes and needs to know if pac-ret is used in the
      current frame, 3) signed address may not be representible as void *
      (with ilp32 abi).
      
      Using address signing to protect eh return is ineffective because the
      instruction sequence in the unwinder that starts from the address
      signing and ends with a ret can be used as a return to anywhere gadget.
      Using indirect branch istead of ret with bti j landing pads at the
      target can reduce the potential of such gadget, which also implies
      that __builtin_eh_return should not take a signed address.
      
      This is a big hammer fix to the ABI and API issues: it turns pac-ret
      off for the caller completely (not just on the eh return path).  To
      harden the caller against ROP attacks, it should use indirect branch
      instead of ret, this is not attempted so the patch remains small and
      backportable.
      
      2020-07-13  Szabolcs Nagy  <szabolcs.nagy@arm.com>
      
      gcc/ChangeLog:
      
      	PR target/94891
      	* config/aarch64/aarch64.c (aarch64_return_address_signing_enabled):
      	Disable return address signing if __builtin_eh_return is used.
      
      gcc/testsuite/ChangeLog:
      
      	PR target/94891
      	* gcc.target/aarch64/return_address_sign_1.c: Update test.
      	* gcc.target/aarch64/return_address_sign_b_1.c: Likewise.
      
      (cherry picked from commit 2bc95be3)
      eb41624d
    • Szabolcs Nagy's avatar
      aarch64: fix return address access with pac [PR94891][PR94791] · e14149f6
      Szabolcs Nagy authored
      This is a big hammer fix for __builtin_return_address (PR target/94891)
      returning signed addresses (sometimes, depending on wether lr happens
      to be signed or not at the time of call which depends on optimizations),
      and similarly -pg may pass signed return address to _mcount
      (PR target/94791).
      
      At the time of return address expansion we don't know if it's signed or
      not so it is done unconditionally.
      
      2020-07-13  Szabolcs Nagy  <szabolcs.nagy@arm.com>
      
      gcc/ChangeLog:
      
      	PR target/94891
      	PR target/94791
      	* config/aarch64/aarch64-protos.h (aarch64_return_addr_rtx): Declare.
      	* config/aarch64/aarch64.c (aarch64_return_addr_rtx): New.
      	(aarch64_return_addr): Use aarch64_return_addr_rtx.
      	* config/aarch64/aarch64.h (PROFILE_HOOK): Likewise.
      
      (cherry picked from commit 463a54e5)
      e14149f6
    • Szabolcs Nagy's avatar
      aarch64: Fix BTI support in libitm · 59a74e7e
      Szabolcs Nagy authored
      sjlj.S did not have the GNU property note markup and the BTI c
      instructions that are necessary when it is built with branch
      protection.
      
      The notes are only added when libitm is built with branch
      protection, because old linkers mishandle the note (merge
      them incorrectly or emit warnings), the BTI instructions
      are added unconditionally.
      
      2020-07-09  Szabolcs Nagy  <szabolcs.nagy@arm.com>
      
      libitm/ChangeLog:
      
      	* config/aarch64/sjlj.S: Add BTI marking and related definitions,
      	and add BTI c to function entries.
      
      (cherry picked from commit 319078da)
      59a74e7e
    • Szabolcs Nagy's avatar
      aarch64: Fix BTI support in libgcc [PR96001] · 8475641c
      Szabolcs Nagy authored
      lse.S did not have the GNU property note markup and the BTI c
      instructions that are necessary when it is built with branch
      protection.
      
      The notes are only added when libgcc is built with branch
      protection, because old linkers mishandle the note (merge
      them incorrectly or emit warnings), the BTI instructions
      are added unconditionally.
      
      Note: BTI c is only necessary at function entry if the function
      may be called indirectly, currently lse functions are not called
      indirectly, but BTI is added for ABI reasons e.g. to allow
      linkers later to emit stub code with indirect jump.
      
      2020-07-09  Szabolcs Nagy  <szabolcs.nagy@arm.com>
      
      libgcc/ChangeLog:
      
      	PR target/96001
      	* config/aarch64/lse.S: Add BTI marking and related definitions,
      	and add BTI c to function entries.
      
      (cherry picked from commit f0f62fa0)
      8475641c
    • Szabolcs Nagy's avatar
      aarch64: Fix noexecstack note in libgcc · 62e8c4b4
      Szabolcs Nagy authored
      lse.S did not have GNU stack note, this may cause missing
      PT_GNU_STACK in binaries on Linux and FreeBSD.
      
      2020-07-09  Szabolcs Nagy  <szabolcs.nagy@arm.com>
      
      libgcc/ChangeLog:
      
      	* config/aarch64/lse.S: Add stack note.
      
      (cherry picked from commit e73ec755)
      62e8c4b4
    • Szabolcs Nagy's avatar
      aarch64: Fix noexecstack note in libitm · f57bc8a6
      Szabolcs Nagy authored
      sjlj.S only had the note on Linux, but it is supposed
      to have it on FreeBSD too.
      
      2020-07-09  Szabolcs Nagy  <szabolcs.nagy@arm.com>
      
      libitm/ChangeLog:
      
      	* config/aarch64/sjlj.S: Add stack note if __FreeBSD__ is defined.
      
      (cherry picked from commit 463ba375)
      f57bc8a6
    • Szabolcs Nagy's avatar
      aarch64: Add missing ACLE support for BTI · 4e8b45f2
      Szabolcs Nagy authored
      Define the __ARM_FEATURE_BTI_DEFAULT feature test
      macro when BTI branch protection is enabled.
      
      2020-07-09  Szabolcs Nagy  <szabolcs.nagy@arm.com>
      
      gcc/ChangeLog:
      
      	* config/aarch64/aarch64-c.c (aarch64_update_cpp_builtins): Add
      	__ARM_FEATURE_BTI_DEFAULT support.
      
      (cherry picked from commit 63b6808e)
      4e8b45f2
    • Julian Brown's avatar
      openacc: Don't strip TO_PSET/POINTER for enter/exit data · fdf78749
      Julian Brown authored
      
      OpenACC 2.6 specifies that the array descriptor (when present) must be
      copied to the target before attaching pointers in Fortran. This patch
      reverses the stripping of GOMP_MAP_TO_PSET and GOMP_MAP_POINTER that
      was introduced by the "OpenACC reference count overhaul" patch.
      
      2020-07-10  Julian Brown  <julian@codesourcery.com>
      	    Thomas Schwinge  <thomas@codesourcery.com>
      
      gcc/
      	* gimplify.c (gimplify_scan_omp_clauses): Do not strip
      	GOMP_MAP_TO_PSET/GOMP_MAP_POINTER for OpenACC enter/exit data
      	directives (see also PR92929).
      
      gcc/testsuite/
      	* gfortran.dg/goacc/finalize-1.f: Update expected dump output.
      
      libgomp/
      	* testsuite/libgomp.oacc-fortran/dynamic-pointer-1.f90: New test.
      
      Co-Authored-By: default avatarThomas Schwinge <thomas@codesourcery.com>
      (cherry picked from commit b20097c6)
      fdf78749
    • Julian Brown's avatar
      openacc: Adjust dynamic reference count semantics · b8be66d1
      Julian Brown authored
      
      This patch adjusts how dynamic reference counts work so that they match
      the semantics of the source program more closely, instead of representing
      "excess" reference counts beyond those that represent pointers in the
      internal libgomp splay-tree data structure. This allows some corner
      cases to be handled more gracefully.
      
      2020-07-10  Julian Brown  <julian@codesourcery.com>
      	    Thomas Schwinge  <thomas@codesourcery.com>
      
      	libgomp/
      	* libgomp.h (struct splay_tree_key_s): Change virtual_refcount to
      	dynamic_refcount.
      	(struct gomp_device_descr): Remove GOMP_MAP_VARS_OPENACC_ENTER_DATA.
      	* oacc-mem.c (acc_map_data): Substitute virtual_refcount for
      	dynamic_refcount.
      	(acc_unmap_data): Update comment.
      	(goacc_map_var_existing, goacc_enter_datum): Adjust for
      	dynamic_refcount semantics.
      	(goacc_exit_datum_1, goacc_exit_datum): Re-add some error checking.
      	Adjust for dynamic_refcount semantics.
      	(goacc_enter_data_internal): Implement "present" case of dynamic
      	memory-map handling here.  Update "non-present" case for
      	dynamic_refcount semantics.
      	(goacc_exit_data_internal): Use goacc_exit_datum_1.
      	* target.c (gomp_map_vars_internal): Remove
      	GOMP_MAP_VARS_OPENACC_ENTER_DATA handling.  Update for dynamic_refcount
      	handling.
      	(gomp_unmap_vars_internal): Remove virtual_refcount handling.
      	(gomp_load_image_to_device): Substitute dynamic_refcount for
      	virtual_refcount.
      	* testsuite/libgomp.oacc-c-c++-common/pr92843-1.c: Remove XFAILs.
      	* testsuite/libgomp.oacc-c-c++-common/refcounting-1.c: New test.
      	* testsuite/libgomp.oacc-c-c++-common/refcounting-2.c: New test.
      	* testsuite/libgomp.oacc-c-c++-common/struct-3-1-1.c: New test.
      	* testsuite/libgomp.oacc-fortran/deep-copy-6.f90: Remove XFAILs and
      	trace output.
      	* testsuite/libgomp.oacc-fortran/deep-copy-6-no_finalize.F90: Remove
      	trace output.
      	* testsuite/libgomp.oacc-fortran/dynamic-incr-structural-1.f90: New
      	test.
      	* testsuite/libgomp.oacc-c-c++-common/structured-dynamic-lifetimes-4.c:
      	Remove stale comment.
      	* testsuite/libgomp.oacc-fortran/mdc-refcount-1-1-1.f90: Remove XFAILs.
      	* testsuite/libgomp.oacc-fortran/mdc-refcount-1-1-2.F90: Likewise.
      	* testsuite/libgomp.oacc-fortran/mdc-refcount-1-2-1.f90: Likewise.
      	* testsuite/libgomp.oacc-fortran/mdc-refcount-1-2-2.f90: Likewise.
      	* testsuite/libgomp.oacc-fortran/mdc-refcount-1-3-1.f90: Likewise.
      	* testsuite/libgomp.oacc-fortran/mdc-refcount-1-4-1.f90: Adjust XFAIL.
      
      Co-Authored-By: default avatarThomas Schwinge <thomas@codesourcery.com>
      (cherry picked from commit 6f5b4b64)
      b8be66d1
    • Julian Brown's avatar
      openacc: Helper functions for enter/exit data using single mapping · bafecb52
      Julian Brown authored
      
      This patch factors out the parts of goacc_enter_datum and
      goacc_exit_datum that can be shared with goacc_enter_data_internal
      and goacc_exit_data_internal respectively (in the next patch),
      without overloading function return values or complicating code paths
      unnecessarily.
      
      2020-07-10  Julian Brown  <julian@codesourcery.com>
      	    Thomas Schwinge  <thomas@codesourcery.com>
      
      libgomp/
      	* oacc-mem.c (goacc_map_var_existing): New function.
      	(goacc_enter_datum): Use above function.
      	(goacc_exit_datum_1): New function.
      	(goacc_exit_datum): Use above function.
      
      Co-Authored-By: default avatarThomas Schwinge <thomas@codesourcery.com>
      (cherry picked from commit cb7effde)
      bafecb52
    • Julian Brown's avatar
      openacc: Set bias to zero for explicit attach/detach clauses in C and C++ · 2974e1ee
      Julian Brown authored
      This is a fix for the pointer (or array) size inadvertently being used
      for the bias with attach and detach mapping kinds, for both C and C++.
      
      2020-07-09  Julian Brown  <julian@codesourcery.com>
      	    Thomas Schwinge  <thomas@codesourcery.com>
      
      gcc/c/
      	PR middle-end/95270
      	* c-typeck.c (c_finish_omp_clauses): Set OMP_CLAUSE_SIZE (bias) to zero
      	for standalone attach/detach clauses.
      
      gcc/cp/
      	PR middle-end/95270
      	* semantics.c (finish_omp_clauses): Likewise.
      
      include/
      	PR middle-end/95270
      	* gomp-constants.h (gomp_map_kind): Expand comment for attach/detach
      	mapping kinds.
      
      gcc/testsuite/
      	PR middle-end/95270
      	* c-c++-common/goacc/mdc-1.c: Update expected dump output for zero
      	bias.
      
      libgomp/
      	PR middle-end/95270
      	* testsuite/libgomp.oacc-c-c++-common/pr95270-1.c: New test.
      	* testsuite/libgomp.oacc-c-c++-common/pr95270-2.c: New test.
      
      (cherry picked from commit 0d00fe40)
      2974e1ee