1. Nov 23, 2021
    • Kito Cheng's avatar
      RISC-V: Min V support · abd288ee
      Kito Cheng authored
      abd288ee
    • Kito Cheng's avatar
      RISC-V: Allow extension name contain number · 85133014
      Kito Cheng authored
      85133014
    • Kito Cheng's avatar
      RISC-V: Cost model for ZBS extension. · 202c2ad0
      Kito Cheng authored
      gcc/ChangeLog:
      
      	* config/riscv/riscv.c (riscv_rtx_costs): Handle cost model
      	for zbs extension.
      202c2ad0
    • Jim Wilson's avatar
      RISC-V: Implement instruction patterns for ZBS extension. · 1fe73064
      Jim Wilson authored
      
      
      2021-10-25  Jim Wilson  <jimw@sifive.com>
      	    Kito Cheng  <kito.cheng@sifive.com>
      
      gcc/ChangeLog:
      
      	* config/riscv/bitmanip.md (shiftm1): New.
      	(*bset<mode>): Ditto.
      	(*bset<mode>_mask): Ditto.
      	(*bset<mode>_1): Ditto.
      	(*bset<mode>_1_mask): Ditto.
      	(*bseti<mode>): Ditto.
      	(*bclr<mode>): Ditto.
      	(*bclri<mode>): Ditto.
      	(*binv<mode>): Ditto.
      	(*binvi<mode>): Ditto.
      	(*bext<mode>): Ditto.
      	(*bexti): Ditto.
      	* config/riscv/predicates.md (splittable_const_int_operand):
      	Handle bseti.
      	(single_bit_mask_operand): New.
      	(not_single_bit_mask_operand): Ditto.
      	(const31_operand): Ditto.
      	(const63_operand): Ditto.
      	* config/riscv/riscv.c (riscv_build_integer_1): Handle bseti.
      	(riscv_output_move): Ditto.
      	(riscv_print_operand): Handle new operand type: T and S.
      	* config/riscv/riscv.h (SINGLE_BIT_MASK_OPERAND): New.
      
      2021-10-25  Jia-Wei Chen  <jiawei@iscas.ac.cn>
      	    Shi-Hua Liao  <shihua@iscas.ac.cn>
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/zba-slliuw.c: Apply zbs to this testcase.
      	* gcc.target/riscv/zbs-bclr.c: New.
      	* gcc.target/riscv/zbs-bext.c: Ditto.
      	* gcc.target/riscv/zbs-binv.c: Ditto.
      	* gcc.target/riscv/zbs-bset.c: Ditto.
      
      Co-authored-by: default avatarKito Cheng <kito.cheng@sifive.com>
      Co-authored-by: default avatarJia-Wei Chen <jiawei@iscas.ac.cn>
      Co-authored-by: default avatarShi-Hua Liao <shihua@iscas.ac.cn>
      1fe73064
    • Jim Wilson's avatar
      RISC-V: Use li and rori to load constants. · 72704da4
      Jim Wilson authored
      gcc/ChangeLog:
      
      	* config/riscv/riscv.c (riscv_build_integer_1): Build integer
      	with rotate.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/zbb-li-rotr.c: New.
      72704da4
    • Kito Cheng's avatar
      RISC-V: Cost model for zbb extension. · be01cc5f
      Kito Cheng authored
      2021-10-25  Kito Cheng  <kito.cheng@sifive.com>
      
      gcc/ChangeLog:
      
      	* config/riscv/riscv.c (riscv_extend_cost): Handle cost model
      	for zbb extension.
      	(riscv_rtx_costs): Ditto.
      be01cc5f
    • Jim Wilson's avatar
      RISC-V: Implement instruction patterns for ZBB extension. · 4dec6cd8
      Jim Wilson authored
      
      
      2021-10-25  Jim Wilson  <jimw@sifive.com>
      	    Kito Cheng  <kito.cheng@sifive.com>
      	    Jia-Wei Chen  <jiawei@iscas.ac.cn>
      
      gcc/ChangeLog:
      
      	* config/riscv/bitmanip.md (bitmanip_bitwise): New.
      	(bitmanip_minmax): New.
      	(clz_ctz_pcnt): New.
      	(bitmanip_optab): New.
      	(bitmanip_insn): New.
      	(*<optab>_not<mode>): New.
      	(*xor_not<mode>): New.
      	(<bitmanip_optab>si2): New.
      	(*<bitmanip_optab>disi2): New.
      	(<bitmanip_optab>di2): New.
      	(*zero_extendhi<GPR:mode>2_bitmanip): New.
      	(*extend<SHORT:mode><SUPERQI:mode>2_zbb): New.
      	(*zero_extendhi<GPR:mode>2_zbb): New.
      	(rotrsi3): New.
      	(rotrdi3): New.
      	(rotrsi3_sext): New.
      	(rotlsi3): New.
      	(rotldi3): New.
      	(rotlsi3_sext): New.
      	(bswap<mode>2): New.
      	(<bitmanip_optab><mode>3): New.
      	* config/riscv/riscv.md (type): Add rotate.
      	(zero_extendhi<GPR:mode>2): Change to define_expand pattern.
      	(*zero_extendhi<GPR:mode>2): New.
      	(extend<SHORT:mode><SUPERQI:mode>2): Change to define_expand pattern.
      	(*extend<SHORT:mode><SUPERQI:mode>2): New.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/zbb-andn-orn-xnor-01.c: New.
      	* gcc.target/riscv/zbb-andn-orn-xnor-02.c: Ditto.
      	* gcc.target/riscv/zbb-min-max.c: Ditto.
      	* gcc.target/riscv/zbb-rol-ror-01.c: Ditto.
      	* gcc.target/riscv/zbb-rol-ror-02.c: Ditto.
      	* gcc.target/riscv/zbb-rol-ror-03.c: Ditto.
      	* gcc.target/riscv/zbbw.c: Ditto.
      
      Co-authored-by: default avatarKito Cheng <kito.cheng@sifive.com>
      Co-authored-by: default avatarJia-Wei Chen <jiawei@iscas.ac.cn>
      4dec6cd8
    • Kito Cheng's avatar
      RISC-V: Cost model for zba extension. · 13c4656a
      Kito Cheng authored
      gcc/ChangeLog:
      
      	* config/riscv/riscv.c (riscv_extend_cost): Handle cost model
      	for zba extension.
      	(riscv_rtx_costs): Ditto.
      13c4656a
    • Jim Wilson's avatar
      RISC-V: Implement instruction patterns for ZBA extension. · b5c884d1
      Jim Wilson authored
      
      
      2021-10-25  Jim Wilson  <jimw@sifive.com>
      	    Kito Cheng  <kito.cheng@sifive.com>
      	    Jia-Wei Chen  <jiawei@iscas.ac.cn>
      
      gcc/ChangeLog:
      
      	* config/riscv/bitmanip.md (*zero_extendsidi2_bitmanip): New.
      	(*shNadd): Ditto.
      	(*shNadduw): Ditto.
      	(*add.uw): Ditto.
      	(*slliuw): Ditto.
      	(riscv_rtx_costs): Ditto.
      	* config/riscv/riscv.md: Include bitmanip.md
      	(type): Add bitmanip bype.
      	(zero_extendsidi2): Change to define_expand pattern.
      	(*zero_extendsidi2_internal): New.
      	(zero_extendsidi2_shifted): Disable for ZBA.
      
      2021-10-25  Kito Cheng  <kito.cheng@sifive.com>
      	    Jia-Wei Chen  <jiawei@iscas.ac.cn>
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/zba-adduw.c: New.
      	* gcc.target/riscv/zba-shNadd-01.c: Ditto.
      	* gcc.target/riscv/zba-shNadd-02.c: Ditto.
      	* gcc.target/riscv/zba-shNadd-03.c: Ditto.
      	* gcc.target/riscv/zba-slliuw.c: Ditto.
      	* gcc.target/riscv/zba-zextw.c: Ditto.
      
      Co-authored-by: default avatarKito Cheng <kito.cheng@sifive.com>
      Co-authored-by: default avatarJia-Wei Chen <jiawei@iscas.ac.cn>
      b5c884d1
    • Kito Cheng's avatar
      RISC-V: Minimal support of bitmanip extension · 2b8e4027
      Kito Cheng authored
      2021-10-25  Kito Cheng  <kito.cheng@sifive.com>
      
      gcc/ChangeLog:
      
      	* common/config/riscv/riscv-common.c (riscv_ext_version_table):
      	Add zba, zbb, zbc and zbs.
      	(riscv_ext_flag_table): Ditto.
      	* config/riscv/riscv-opts.h (MASK_ZBA): New.
      	(MASK_ZBB): Ditto.
      	(MASK_ZBC): Ditto.
      	(MASK_ZBS): Ditto.
      	(TARGET_ZBA): Ditto.
      	(TARGET_ZBB): Ditto.
      	(TARGET_ZBC): Ditto.
      	(TARGET_ZBS): Ditto.
      	* config/riscv/riscv.opt (riscv_zb_subext): New.
      2b8e4027
  2. Jun 23, 2021
  3. Jun 22, 2021
    • Jakub Jelinek's avatar
      testsuite: Add -fchecking to dg-ice tests · 484239a4
      Jakub Jelinek authored
      In --enable-checking=release builds (which is the default on release
      branches), I'm getting various extra FAILs that don't appear in
      --enable-checking=yes builds.
      
      XPASS: g++.dg/cpp0x/constexpr-52830.C  -std=c++14 (internal compiler error)
      FAIL: g++.dg/cpp0x/constexpr-52830.C  -std=c++14 (test for excess errors)
      XPASS: g++.dg/cpp0x/constexpr-52830.C  -std=c++17 (internal compiler error)
      FAIL: g++.dg/cpp0x/constexpr-52830.C  -std=c++17 (test for excess errors)
      XPASS: g++.dg/cpp0x/constexpr-52830.C  -std=c++2a (internal compiler error)
      FAIL: g++.dg/cpp0x/constexpr-52830.C  -std=c++2a (test for excess errors)
      FAIL: g++.dg/cpp0x/vt-88982.C  -std=c++14 (test for excess errors)
      FAIL: g++.dg/cpp0x/vt-88982.C  -std=c++17 (test for excess errors)
      FAIL: g++.dg/cpp0x/vt-88982.C  -std=c++2a (test for excess errors)
      FAIL: g++.dg/cpp1y/auto-fn61.C  -std=c++14 (test for excess errors)
      FAIL: g++.dg/cpp1y/auto-fn61.C  -std=c++17 (test for excess errors)
      FAIL: g++.dg/cpp1y/auto-fn61.C  -std=c++2a (test for excess errors)
      FAIL: g++.dg/cpp1z/constexpr-lambda26.C  -std=c++17 (test for excess errors)
      FAIL: g++.dg/cpp1z/constexpr-lambda26.C  -std=c++2a (test for excess errors)
      FAIL: g++.dg/cpp2a/nontype-class39.C  -std=c++2a (test for excess errors)
      FAIL: c-c++-common/goacc/kernels-decompose-ice-1.c  -std=c++14 (test for excess errors)
      FAIL: c-c++-common/goacc/kernels-decompose-ice-1.c  -std=c++17 (test for excess errors)
      FAIL: c-c++-common/goacc/kernels-decompose-ice-1.c  -std=c++2a (test for excess errors)
      FAIL: c-c++-common/goacc/kernels-decompose-ice-1.c  -std=c++98 (test for excess errors)
      FAIL: c-c++-common/goacc/kernels-decompose-ice-2.c  -std=c++14 (test for excess errors)
      FAIL: c-c++-common/goacc/kernels-decompose-ice-2.c  -std=c++17 (test for excess errors)
      FAIL: c-c++-common/goacc/kernels-decompose-ice-2.c  -std=c++2a (test for excess errors)
      FAIL: c-c++-common/goacc/kernels-decompose-ice-2.c  -std=c++98 (test for excess errors)
      
      These are tests that have dg-ice and most of those ICEs are checking ICEs
      which go away in release checking when -fno-checking is the default.
      
      The following patch adds -fchecking option to those.
      
      2021-04-21  Jakub Jelinek  <jakub@redhat.com>
      
      	* g++.dg/cpp1z/constexpr-lambda26.C: Add dg-additional-options
      	-fchecking.
      	* g++.dg/cpp1y/auto-fn61.C: Likewise.
      	* g++.dg/cpp2a/nontype-class39.C: Likewise.
      	* g++.dg/cpp0x/constexpr-52830.C: Likewise.
      	* g++.dg/cpp0x/vt-88982.C: Likewise.
      	* c-c++-common/goacc/kernels-decompose-ice-1.c: Add -fchecking to
      	dg-additional-options.
      	* c-c++-common/goacc/kernels-decompose-ice-2.c: Likewise.
      484239a4
  4. Jun 21, 2021
    • Richard Sandiford's avatar
      varasm: Two SECTION_RETAIN fixes [PR100130] · 3ef4e867
      Richard Sandiford authored
      switch_to_section warns if we try to output a retain decl in a
      section without a retain flag, or if we try to output a non-retain
      decl in a section with a retain flag.  However, the warning only
      applied if we were trying to “switch” to the current section.
      This works if all decls that use a section are generated consecutively,
      but not if there is an unrelated decl in between.
      
      This patch makes the check unconditional, but suppresses the warning
      if we're writing the section's named.decl (i.e. the decl from which
      the section name and original flags were derived).
      
      Also, the warning didn't fire for -fsection-anchors, for two reasons:
      we allowed retain and non-retain decls to be put into the same block,
      and we didn't pass a decl to switch_to_section.
      
      Although these are arguably separate bugs, it isn't easy to fix them
      independently without temporarily regressing -fsection-anchor targets.
      
      gcc/
      	PR middle-end/100130
      	* varasm.c (get_block_for_decl): Make sure that any use of the
      	retain attribute matches the section's retain flag.
      	(switch_to_section): Check for retain mismatches even when
      	changing sections, but do not warn if the given decl is the
      	section's named.decl.
      	(output_object_block): Pass the first decl in the block (if any)
      	to switch_to_section.
      
      gcc/testsuite/
      	PR middle-end/100130
      	* c-c++-common/attr-retain-10.c: New test.
      	* c-c++-common/attr-retain-11.c: Likewise.
      3ef4e867
    • Kito Cheng's avatar
      d0a7ad16
    • Bernd Edlinger's avatar
      Fix a test failure in g++.dg/modules/omp-1_c.C · 9d923e3f
      Bernd Edlinger authored
      Adjust the line number due to previous commit,
      which added a line for dg-require-effective-target.
      
      2021-05-20  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
      	* g++.dg/modules/omp-1_c.C: Fix testcase.
      9d923e3f
    • Kito Cheng's avatar
      testuite: Check pthread for omp module testing · c108c540
      Kito Cheng authored
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/modules/omp-1_a.C: Check pthread is available.
      	* g++.dg/modules/omp-1_b.C: Ditto.
      	* g++.dg/modules/omp-1_c.C: Ditto.
      	* g++.dg/modules/omp-2_a.C: Ditto.
      	* g++.dg/modules/omp-2_b.C: Ditto.
      c108c540
  5. Apr 27, 2021
  6. Apr 26, 2021
  7. Apr 25, 2021
  8. Apr 24, 2021
  9. Apr 23, 2021
    • Tobias Burnus's avatar
      testsuite/substr_{9,10}.f90: Move to gfortran.dg/ · 7a7fc01b
      Tobias Burnus authored
      gcc/testsuite/
      	* substr_9.f90: Move to ...
      	* gfortran.dg/substr_9.f90: ... here.
      	* substr_10.f90: Move to ...
      	* gfortran.dg/substr_10.f90: ... here.
      
      (cherry picked from commit ac456fd9)
      7a7fc01b
    • Jonathan Wakely's avatar
      libstdc++: Fix semaphore to work with system_clock timeouts · ee8b08ad
      Jonathan Wakely authored
      The __cond_wait_until_impl function takes a steady_clock timeout, but
      then sometimes tries to compare it to a time from the system_clock,
      which won't compile.  Additionally, that function gets called with
      system_clock timeouts, which also won't compile. This makes the function
      accept timeouts for either clock, and compare to the time from the right
      clock.
      
      This fixes the compilation error that was causing two tests to fail on
      non-futex targets, so we can revert the r12-11 change to disable them.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/atomic_timed_wait.h (__cond_wait_until_impl):
      	Handle system_clock as well as steady_clock.
      	* testsuite/30_threads/semaphore/try_acquire_for.cc: Re-enable.
      	* testsuite/30_threads/semaphore/try_acquire_until.cc:
      	Re-enable.
      
      (cherry picked from commit 69245887)
      ee8b08ad
    • Jonathan Wakely's avatar
      libstdc++: Add options for libatomic to test · dcf46d72
      Jonathan Wakely authored
      This fixes a linker error on AIX:
      
      FAIL: 30_threads/semaphore/try_acquire_posix.cc (test for excess errors)
      Excess errors:
      ld: 0711-317 ERROR: Undefined symbol: .__atomic_fetch_add_8
      ld: 0711-317 ERROR: Undefined symbol: .__atomic_load_8
      ld: 0711-317 ERROR: Undefined symbol: .__atomic_fetch_sub_8
      ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
      collect2: error: ld returned 8 exit status
      
      libstdc++-v3/ChangeLog:
      
      	* testsuite/30_threads/semaphore/try_acquire_posix.cc: Add
      	options for libatomic.
      
      (cherry picked from commit 58871c03)
      dcf46d72
    • GCC Administrator's avatar
      Daily bump. · a750d7d4
      GCC Administrator authored
      a750d7d4
  10. Apr 22, 2021
    • Thomas Rodgers's avatar
      libstdc++: Fix "bare" notifications dropped by waiters check · c9da0703
      Thomas Rodgers authored
      For types that track whether or not there extant waiters (e.g.
      semaphore) internally, the __atomic_notify_address_bare() call was
      introduced to avoid the overhead of loading the atomic count of
      waiters. For platforms that don't have Futex, however, there was
      still a check for waiters, and seeing that there are none (because
      in the bare case, the count is not incremented), the notification
      is dropped. This commit addresses that case.
      
      libstdc++-v3/ChangeLog:
      	* include/bits/atomic_wait.h: Always notify waiters in the
      	case of 'bare' address notification.
      
      (cherry picked from commit 2d856af6f9f38fd730754e5024aa82aab3948069)
      c9da0703
    • Jonathan Wakely's avatar
      libstdc++: Remove #error from <semaphore> implementation [PR 100179] · 718fcebe
      Jonathan Wakely authored
      This removes the #error from <bits/semaphore_base.h> for the case where
      neither __atomic_semaphore nor __platform_semaphore is defined.
      
      Also rename the _GLIBCXX_REQUIRE_POSIX_SEMAPHORE macro to
      _GLIBCXX_USE_POSIX_SEMAPHORE for consistency with the similar
      _GLIBCXX_USE_CXX11_ABI macro that can be used to request an alternative
      (ABI-changing) implementation.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/100179
      	* include/bits/semaphore_base.h: Remove #error.
      	* include/std/semaphore: Do not define anything unless one of
      	the implementations is available.
      
      (cherry picked from commit 4b2db807)
      718fcebe
    • Jakub Jelinek's avatar
      libstdc++: Add workaround for ia32 floating atomics miscompilations [PR100184] · a21f3b38
      Jakub Jelinek authored
      gcc on ia32 miscompiles various atomics involving floating point,
      unfortunately I'm afraid it is too late to fix that for 11.1 and
      as I'm quite lost on it, it might take a while for 12 too
      (disabling all the 8 peephole2s would be easiest, but then we'd
      run into optimization regressions).
      
      While 1.cc just FAILs, with dejagnu 1.6.1 wait_notify.cc hangs the
      make check even after the timeout fires.  The following patch therefore
      xfails the former and skips the latter.
      
      Tested on x86_64-linux where
      make check RUNTESTFLAGS='conformance.exp=atomic_float/*.cc'
      is still
                      === libstdc++ Summary ===
      
       # of expected passes            8
      and on i686-linux, where it is now
                      === libstdc++ Summary ===
      
       # of expected passes            5
       # of expected failures          1
       # of unsupported tests          1
      
      2021-04-22  Jakub Jelinek  <jakub@redhat.com>
      
      	PR target/100182
      	* testsuite/29_atomics/atomic_float/1.cc: Add dg-xfail-run-if for
      	ia32.
      	* testsuite/29_atomics/atomic_float/wait_notify.cc: Add dg-skip-if for
      	ia32.
      
      (cherry picked from commit 0f458814)
      a21f3b38
    • Tobias Burnus's avatar
      gfortran.dg/pr68078.f90: Avoid increasing RLIMIT_AS · 3d8c8b61
      Tobias Burnus authored
      pr68078.f90 tests out-of-memory handling and calls set_vm_limit to set the
      soft limit.  However, setrlimit was then called with hard limit RLIM_INFINITY,
      which failed when the current hard limit was lower.
      
      gcc/testsuite/
      	* gfortran.dg/set_vm_limit.c (set_vm_limit): Call getrlimit, use
      	obtained hard limit, and only call setrlimit if new softlimit is lower.
      
      (cherry picked from commit faf7d413)
      3d8c8b61
    • Richard Biener's avatar
      testsuite/100176 - fix struct-layout-1_generate.c compile · 42f2d16e
      Richard Biener authored
      With -Werror=return-type we run into compile fails complaining about
      missing return stmts.
      
      2021-04-21  Richard Biener  <rguenther@suse.de>
      
      	PR testsuite/100176
      	* objc.dg/gnu-encoding/struct-layout-encoding-1_generate.c: Add
      	missing return.
      
      (cherry picked from commit 56688433)
      42f2d16e
    • Richard Biener's avatar
      Avoid -latomic for amdgcn offloading · 74bd25f9
      Richard Biener authored
      libatomic isn't built for amdgcn but reduction-16.c adds it
      via -foffload=-latomic when offloading for nvptx is enabled.
      The following avoids linker errors when offloading to amdgcn is enabled
      as well.
      
      2021-04-21  Richard Biener  <rguenther@suse.de>
      
      libgomp/
      	* testsuite/libgomp.c-c++-common/reduction-16.c: Use -latomic
      	only on nvptx-none.
      
      (cherry picked from commit d42088e4)
      74bd25f9
    • Thomas Rodgers's avatar
      [libstdc++] Fix test timeout in stop_calback/destroy.cc · c0ffafb3
      Thomas Rodgers authored
      A change was made to __atomic_semaphore::_S_do_try_acquire() to
      (ideally) let the compare_exchange reload the value of __old rather than
      always reloading it twice. This causes _M_acquire to spin indefinitely
      if the value of __old is already 0.
      
      libstdc++-v3/ChangeLog:
      	* include/bits/semaphore_base.h: Always reload __old in
      	__atomic_semaphore::_S_do_try_acquire().
      	* testsuite/30_threads/stop_token/stop_callback/destroy.cc:
      	re-enable testcase.
      
      (cherry picked from commit 7eeb8c04)
      c0ffafb3
    • GCC Administrator's avatar
      Daily bump. · 3a8437df
      GCC Administrator authored
      3a8437df
  11. Apr 21, 2021