| Age | Commit message (Collapse) | Author | Files | Lines |
|
Andrew noticed that I added a c++ file to the wrong dir. This patch
corrects it.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/pr123074.C: Move to...
* g++.target/riscv/rvv/autovec/pr123074.C: ...here.
* gcc.target/riscv/rvv/rvv.exp: Remove 'C'.
|
|
This patch updates LOCAL_PATCHES for
commit 203d4dd09ba83121e447ce93ba98175b68d955f6
Author: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date: Wed Dec 10 09:24:53 2025 +0100
libsanitizer: Restore local sanitizer_redefine_builtins.h patch
2025-12-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
libsanitizer:
* LOCAL_PATCHES: Update.
|
|
The recent libsanitizer update broke the Solaris/SPARC build with the
native assembler: many files don't compile any longer like
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 5: error: unknown opcode ".set"
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 5: error: statement syntax
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 6: error: unknown opcode ".set"
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 6: error: statement syntax
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 7: error: unknown opcode ".set"
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 7: error: statement syntax
This happens because sanitizer_common/sanitizer_redefine_builtins.h lost
a local patch that guards use of .set in asm by HAVE_AS_SYM_ASSIGN.
This patch restores that patch.
Although the Darwin assembler accepts .set (thus HAVE_AS_SYM_ASSIGN is
defined), the __APPLE__ guard is kept to guard against the link failures
that prompted its upstreadm addition in LLVM commit
commit cfdbbb8fcc62f75dcf0b251dfab63353f3921227
Author: Dan Blackwell <dan_blackwell@apple.com>
Date: Fri Aug 15 09:13:26 2025 +0100
[sanitizer_common] Disable sanitizer_redefine_builtins on Apple platforms (#153381)
even though they didn't happen in the GCC build.
It also keeps the _AIX guard due to LLVM commit
commit d7c6cad744bc7ed28535dc6f75629902eda559ea
Author: Jake Egan <Jake.egan@ibm.com>
Date: Wed Jun 11 20:22:15 2025 -0400
[sanitizer_common] Implement interception on AIX (#138606)
Bootstrapped without regressions on sparc-sun-solaris2.11 with gas and
as, i386-pc-solaris2.11, x86_64-pc-linux-gnu, and
x86_64-apple-darwin25.1.0.
|
|
The pid_t type on 32-bit Solaris differs from gcc's builtin.
<sys/types.h> has
typedef int pid_t; /* process id type */
typedef long pid_t; /* (historical version) */
while gcc/defaults.h uses
on all targets.
This patch fixes this by providing a Solaris definition.
g++.dg/lookup/extern-c-redecl3.C had to be adjusted accordingly.
Bootstrapped without regressions on i386-pc-solaris2.11,
sparc-sun-solaris2.11, and x86_64-pc-linux-gnu.
2025-11-17 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
gcc:
* config/sol2.h (PID_TYPE): Define.
* doc/tm.texi.in (Type Layout): Document PID_TYPE.
* doc/tm.texi: Regenerate.
gcc/testsuite:
* g++.dg/lookup/extern-c-redecl3.C (pid_t): Define.
Use it for fork return type.
terms of __builtin_fork.
* g++.dg/pid_t-1.C: New test.
* gcc.dg/pid_t-1.c: Likewise.
|
|
|
|
Following Andrew Pinski's suggestions in
https://gcc.gnu.org/pipermail/gcc-patches/2025-July/689683.html, just
use the output of:
$(CC) -print-sysroot
It is just used in one spot, in an AIX code-path. I just made (within
make) a shell variable to use instead.
I don't have AIX on-hand to test this, however.
gcc/ChangeLog:
* Makefile.in: No longer include TARGET_SYSTEM_ROOT in
libgcc.mvars.
libgcc/ChangeLog:
* config/rs6000/t-slibgcc-aix: Instead of using a
TARGET_SYSTEM_ROOT make variable, just define a shell variable
as part of the rule and use that.
Suggested-by: Andrew Pinski <quic_apinski@quicinc.com>
Signed-off-by: John Ericson <git@JohnEricson.me>
|
|
My goal is to be able to build libgcc cleanly in isolation --- today one
needs to figure `make ...` misc things in the gcc subdir.
Following Andrew Pinski's suggestions in
https://gcc.gnu.org/pipermail/gcc-patches/2025-July/689683.html, this
commit moves the NO_PIE_CFLAGS logic.
gcc/ChangeLog:
* Makefile.in:: Remove NO_PIE_CFLAGS logic, since it is now in
libgcc.
* configure: Regenerate.
* configure.ac: Remove the enable_default_pie substitution, since
libgcc now has its own logic.
libgcc/ChangeLog:
* Makefile.in: Define NO_PIE_CFLAGS make variable via autoconf
substitution.
* configure: Regenerate.
* configure.ac: New configure check to define NO_PIE_CFLAGS
using the algorithm Andrew asked for in the linked mail.
Suggested-by: Andrew Pinski <quic_apinski@quicinc.com>
Signed-off-by: John Ericson <git@JohnEricson.me>
|
|
This macro deduplicates the
$CC -v 2>&1 | sed -n 's/^Thread model: //p'
check that was occurring in various runtime libs.
Additionally, as a bit of an Easter egg, this also allows overriding
what the compiler would return by setting the
`gcc_cv_target_thread_file` cache variable first. I admit that it is in
fact this Easter egg that led me to write the patch. The use-case for it
is for making multilib builds where the library sets do not all share
the same thread model easier. See also `THREAD_MODEL_SPEC` for more
about the varying thread models use-case.
Arguably one could could try to define on `THREAD_MODEL_SPEC` on more
platforms (besides e.g. AIX) but the ramifications of this are a bit
unclear. Setting `gcc_cv_target_thread_file` directly is a "low tech"
solution that will work for now for sure. Of course, since setting a
cache variable like this a hacky trick, I will not expect this to be at
all stable/guaranteed to work, going forward.
Thanks to Arsen who on IRC discussed these things with me, including in
particular making it a cache var not `--with-model` flag, to not
prematurely foster expectations that this is stable.
Suggested-by: Arsen Arsenović <arsen@aarsen.me>
config/ChangeLog:
* gthr.m4: Create new GCC_AC_THREAD_MODEL macro
libatomic/ChangeLog:
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* configure.ac: Use GCC_AC_THREAD_MODEL instead of hand-rolled
* testsuite/Makefile.in: Regenerate.
libgcc/ChangeLog:
* configure: Regenerate.
* configure.ac: Use GCC_AC_THREAD_MODEL instead of hand-rolled
libphobos/ChangeLog:
* configure: Regenerate.
* m4/druntime/os.m4: Use AC_MSG_ERROR, not private as_fn_error
libstdc++-v3/ChangeLog:
* acinclude.m4: Use GCC_AC_THREAD_MODEL instead, via AC_REQUIRE
* configure: Regenerate.
|
|
Some pre-r16-4328-g71e95e871d62e4 comments sneaked back in with some
recent commits.
libstdc++-v3/ChangeLog:
* include/bits/version.h: Regenerate.
|
|
The submdspan feature is complete and this commit sets the feature
testing macros accordingly. Also makes the feature testing macro
submdspan depend on constant_wrapper.
Also changes the value of the internal feature testing macro for padded
layouts to 202403.
libstdc++-v3/ChangeLog:
* include/bits/version.def (padded_layouts): Set to 202403.
(submdspan): Set to 202411 add dependency.
* include/bits/version.h: Regenerate.
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
|
|
In the PR we ICE accessing the loop lens in
vect_get_loop_variant_data_ptr_increment when building 510.parest.
This function only gets called when we use SELECT_VL for the loop
control, however during initialization of the loop lens partial
vectors, a prerequisite for SELECT_VL, was false while using_select_vl
was true. We reset using_partial_vectors when restarting the analysis
after forcing single-lane SLP but don't reset using_select_vl.
This patch resets it as well.
PR tree-optimization/123074
gcc/ChangeLog:
* tree-vect-loop.cc: Reset LOOP_VINFO_USING_SELECT_VL_P.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/rvv.exp: Include *.C.
* gcc.target/riscv/rvv/autovec/pr123074.C: New test.
|
|
The first argument of the call to .ACCESS_WITH_SIZE includes
"c_maybe_const_expr" which should not be passed to gimplifier.
Before passing the expression as the first argument to the call to
.ACCESS_WITH_SIZE, c_fully_fold should be called on this expression.
PR c/122982
gcc/c/ChangeLog:
* c-typeck.cc (build_access_with_size_for_counted_by): Call
c_fully_fold on the first parameter.
gcc/testsuite/ChangeLog:
* gcc.dg/pointer-counted-by-pr122982.c: New test.
|
|
Implements submdspan for layout_right_padded as described in P3663.
PR libstdc++/110352
libstdc++-v3/ChangeLog:
* include/std/mdspan
(__mdspan::_SubMdspanMapping<_LayoutSide::__right, true>): Define.
(layout_right_padded::submdspan_mapping): New friend function.
* testsuite/23_containers/mdspan/submdspan/selections/right_padded.cc:
Instantiate tests for layout_right_padded.
* testsuite/23_containers/mdspan/submdspan/submdspan_mapping.cc:
Ditto.
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
|
|
Implements submdspan for layout_left_padded as described in P3663.
PR libstdc++/110352
libstdc++-v3/ChangeLog:
* include/std/mdspan (__mdspan::__is_padded_mapping): Define.
(__mdspan::_SubMdspanMapping): Add _Padded template parameter.
(__mdspan::_SubMdspanMapping<_LayoutSide::__left, true>): Define.
(__mdspan::__submdspan_mapping_impl): Updated _Trait alias.
(layout_left_padded::submdspan_mapping): New friend method.
* testsuite/23_containers/mdspan/layout_traits.h
(LayoutTraits::layout_same_padded): New template type alias.
* testsuite/23_containers/mdspan/submdspan/selections/left_padded.cc:
Instantiate tests for layout_left_padded.
* testsuite/23_containers/mdspan/submdspan/submdspan_mapping.cc:
Ditto.
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
|
|
and 15
Add asm dump check and run test for vec_duplicate + vmslt.vv
combine to vmslt.vx, with the GR2VR cost is 0, 2 and 15.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i16.c: Add asm check
for vmslt.vx.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i32.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i64.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i8.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i16.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i32.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i64.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i8.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i16.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i32.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i64.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i8.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h: Add test
helper macros.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_binary_data.h: Add test
data for run test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i16.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i32.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i64.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i8.c: New test.
Signed-off-by: Pan Li <pan2.li@intel.com>
|
|
This patch would like to combine the vec_duplicate + vmslt.wv to the
vmslt.vx. From example as below code. The related pattern will depend
on the cost of vec_duplicate from GR2VR. Then the late-combine will
take action if the cost of GR2VR is zero, and reject the combination
if the GR2VR cost is greater than zero.
Assume we have asm code like below, GR2VR cost is 0.
Before this patch:
11 beq a3,zero,.L8
12 vsetvli a5,zero,e32,m1,ta,ma
13 vmv.v.x v2,a2
...
16 .L3:
17 vsetvli a5,a3,e32,m1,ta,ma
...
22 vmslt.vv v1,v2,v3
...
25 bne a3,zero,.L3
After this patch:
11 beq a3,zero,.L8
...
14 .L3:
15 vsetvli a5,a3,e32,m1,ta,ma
...
20 vmslt.vx v1,a2,v3
...
23 bne a3,zero,.L3
gcc/ChangeLog:
* config/riscv/predicates.md: Append operator lt to
the comparison_swappable_operator.
* config/riscv/riscv-v.cc (get_swapped_cmp_rtx_code): Add
swappable operator lt handing.
Signed-off-by: Pan Li <pan2.li@intel.com>
|
|
The following adjusts costing of vector construction from scalars for
FP modes which with 387 math can reside in FP regs which need spilling
to be reloaded to XMM. I've played on the safe side with mixed
SSE/387 math.
PR target/121230
* config/i386/i386.cc (ix86_vector_costs::add_stmt_cost):
With FP mode and 387 math cost spill/reload.
* gcc.target/i386/pr121230.c: New testcase.
|
|
The following avoids cloning / IPA CP to mess up dump counting.
PR testsuite/120167
libgomp/
* testsuite/libgomp.graphite/force-parallel-1.c: Make parloop
noipa.
|
|
I forgot to regenerate the opt urls. This patch makes up for it.
gcc/ChangeLog:
* config/riscv/riscv.opt.urls: Regenerate.
|
|
Add submdspan_mapping for layout_stride as in P3663.
PR libstdc++/110352
libstdc++-v3/ChangeLog:
* include/std/mdspan (layout_stride::mapping::submdspan_mapping): New
friend function.
* testsuite/23_containers/mdspan/submdspan/selections/stride.cc:
Instantiate tests for layout_stride.
* testsuite/23_containers/mdspan/submdspan/submdspan_neg.cc:
Ditto.
* testsuite/23_containers/mdspan/submdspan/submdspan_mapping.cc:
Add tests for layout_stride.
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
|
|
Adds submdspan_mapping for layout_right as described in P3663.
PR libstdc++/110352
libstdc++-v3/ChangeLog:
* include/std/mdspan
(__mdspan::_SubMdspanMapping<_LayoutSide::__right>): Define.
(layout_right::mapping::submdspan_mapping): New friend function.
* testsuite/23_containers/mdspan/submdspan/selections/right.cc:
Instantiate tests for layout_right.
* testsuite/23_containers/mdspan/submdspan/submdspan_mapping.cc:
Ditto.
* testsuite/23_containers/mdspan/submdspan/submdspan_neg.cc:
Ditto.
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
|
|
Implements `submdspan` and `submdspan_mapping` for layout_left as
described in P3663 (Future proofing mdspan).
When computing the offset of the submdspan, one must check that the
lower bound of the slice range isn't out-of-range. There's a few
cases when the lower bound is never out-of-range:
- full_extent and exts.extent(k) != 0,
- collapsing slice types.
If those conditions are known to hold, no checks are generated.
Similarly, if all slices are full_extent, there's no need to call
mapping(0,...,0) for standardized mappings.
The implementation prepares to use the symmetry between layout_left and
layout_right and introduces concepts like a "layout side", i.e. left,
right or unknown/strided.
The tests use an iterator to replace nested for-loops. Which also makes
it easier to write the core test logic in a rank-independent manner.
PR libstdc++/110352
libstdc++-v3/ChangeLog:
* include/std/mdspan (__mdspan::__is_submdspan_mapping_result)
(__mdspan::__submdspan_mapping_result, __mdspan::__fwd_prod)
(__mdspan::__acceptable_slice_type, __mdspan::__slice_begin)
(__mdspan::__suboffset, __mdspan::_LayoutSide, __mdspan::__mapping_side)
(__mdspan::_StridesTrait, __mdspan::__substrides_generic)
(__mdspan::__substrides_standardized, __mdspan::__substrides)
(__mdspan::__is_unit_stride_slice, __mdspan::_SliceKind)
(__mdspan::__make_slice_kind, __mdspan::__make_slice_kind_array)
(__mdspan::__is_block, __mdspan::__padded_block_begin_generic)
(__mdspan::__padded_block_begin, __mpdspan::_SubMdspanMapping)
(__mdspan::__submdspan_mapping_impl): Define.
(__mdspan::__dynamic_slice_extent, __mdspan::__static_slice_extent)
(__mdspan::__subextents): Move earlier in the file.
(layout_left::mapping::submdspan_mapping, __mdspan::__sliceable_mapping)
(__mdspan::__submapping, submdspan): Define.
* src/c++23/std.cc.in: Add submdspan.
* testsuite/23_containers/mdspan/submdspan/generic.cc: New test.
* testsuite/23_containers/mdspan/submdspan/selections/left.cc:
Instantiate selection tests for layout_left.
* testsuite/23_containers/mdspan/submdspan/selections/testcases.h: Generic
tests different selections.
* testsuite/23_containers/mdspan/submdspan/submdspan_mapping.cc: New test.
* testsuite/23_containers/mdspan/submdspan/submdspan_neg.cc: New test.
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
|
|
This reverts commit cf22e30f0cfae65dd012966cab657583e2be667e.
|
|
Splitting the tests for submdspan triggered a compiler warning. This
commit changes the implementation of __dynamic_extents. In particular,
how the span is created. Functionally, the two are equivalent.
libstdc++-v3/ChangeLog:
* include/std/mdspan (_ExtentsStorage::_M_dynamic_extents):
Create span from pointer + size, not begin and end iterators.
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
|
|
Unified Shared Memory does not appear to work well on gfx908, which is why we
disabled xnack by default. For this reason it makes sense to inform the user
as compile time, but this is causing trouble in the testsuite which assumes
that USM only fails at runtime.
This patch changes the gfx908 compile time message to a warning only (in case
some other target does this differently), and prevents the tests from
attempting to run in host-fallback mode (given that that is not what they are
trying to test). It also changes the existing warning to only fire once.
The patch assumes that effective target "omp_usm" also implies self-maps.
gcc/ChangeLog:
* config/gcn/gcn.cc (gcn_init_cumulative_args): Only warn once.
Use "required" instead of "enabled" in the warning.
* config/gcn/mkoffload.cc (process_asm): Warn, don't error.
Use "required" instead of "on" in the warning.
libgomp/ChangeLog:
* testsuite/lib/libgomp.exp (check_effective_target_omp_usm): New.
* testsuite/libgomp.c++/target-std__array-concurrent-usm.C: Require
working Unified Shared Memory to run the test.
* testsuite/libgomp.c++/target-std__bitset-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__deque-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__forward_list-concurrent-usm.C:
Likewise.
* testsuite/libgomp.c++/target-std__list-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__map-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__multimap-concurrent-usm.C:
Likewise.
* testsuite/libgomp.c++/target-std__multiset-concurrent-usm.C:
Likewise.
* testsuite/libgomp.c++/target-std__set-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__span-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__valarray-concurrent-usm.C:
Likewise.
* testsuite/libgomp.c++/target-std__vector-concurrent-usm.C: Likewise.
* testsuite/libgomp.c-c++-common/target-implicit-map-4.c: Likewise.
* testsuite/libgomp.c-c++-common/target-link-3.c: Likewise.
* testsuite/libgomp.c-c++-common/target-link-4.c: Likewise.
* testsuite/libgomp.fortran/self_maps.f90: Likewise.
|
|
The following testcase ICEs since checking has been added to TYPE_PRECISION
macro. check_bitfield_type_and_width is called when attributes haven't
been applied to the bit-field decl yet and so it still has INTEGER_TYPE
type, while at finish_struct time it already has VECTOR_TYPE.
The following patch just repeats the check_bitfield_type_and_width
in there.
Another option would be let handle_vector_size_attribute check for
bit-fields and error out there.
2025-12-09 Jakub Jelinek <jakub@redhat.com>
PR c/123018
* c-decl.cc (finish_struct): Diagnose bit-fields with vector type.
* gcc.dg/pr123018.c: New test.
|
|
This patch adds zero-length handling to gimple_fold_partial_store and
gimple_fold_partial_load and unifies them into
gimple_fold_partial_load_store.
It introduces a new function partial_load_store_mask_state that
returns
MASK_ALL_INACTIVE,
MASK_ALL_ACTIVE, or
MASK_UNKNOWN.
This result is used to either replace a load with its else value and
elide a store (when all inactive), turn the load/store into a regular
mem ref (all_active), or do nothing.
PR tree-optimization/122635
gcc/ChangeLog:
* gimple-fold.cc (enum mask_load_store_state): New enum.
(gimple_fold_partial_load_store_mem_ref): Only fold
"all active" loads/stores.
(partial_load_store_mask_state): New function to compute mask
state.
(gimple_fold_partial_load): Remove.
(gimple_fold_partial_load_store): New function.
(gimple_fold_partial_store): Remove.
(gimple_fold_call): Use new function.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/sve/pfalse-store.c: Expect more elided
stores.
* gcc.target/riscv/rvv/autovec/pr122635-1.c: New test.
* gcc.target/riscv/rvv/autovec/pr122635-2.c: New test.
* gcc.target/powerpc/p9-vec-length-epil-8.c: Expect two lxvl
less.
|
|
When adding else operands to maskload and friends we didn't bother to do
the same for len_load (as we never use the residual elements anyway).
In order to simplify handling in gimple-fold, this patch adds the else
operand now. Both, power and s390, zero out inactive elements.
gcc/ChangeLog:
* config/rs6000/predicates.md (lxvl_else_operand): New
predicate.
* config/rs6000/vsx.md: Add else operand.
* config/s390/predicates.md (vll_else_operand): New predicate.
* config/s390/vector.md: Add else operand.
* doc/md.texi: Document else operand.
* internal-fn.cc (internal_fn_len_index): Adjust IFN_LEN_LOAD.
(internal_fn_else_index): Add IFN_LEN_LOAD.
* optabs-tree.cc (target_supports_len_load_store_p): Get else
value for len_load.
* tree-vect-stmts.cc (vectorizable_load): Pun the else value
type.
|
|
This adds an -mmax-vectorization option to riscv, a verbatim copy from
aarch64. It is an option for vector code analysis. Internally it increases
scalar costs by a large factor so every vector approach will be
profitable. As opposed to -fno-vect-cost-model, we will still compare
the vector approaches amongst each other, though.
In order to handle this argument without an '=' I needed to change the
parsing flow slightly.
gcc/ChangeLog:
* config/riscv/riscv-target-attr.cc (riscv_target_attr_parser::handle_max_vect):
New parser entry.
(riscv_target_attr_parser::update_settings): Set max-vect
option.
(riscv_process_one_target_attr): Change null-arg handling.
* config/riscv/riscv.cc (riscv_override_options_internal): Set
max-vect option.
* config/riscv/riscv.opt: Add -mmax-vectorization option.
* doc/extend.texi: Document new option.
* doc/invoke.texi: Ditto.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/max-vect-1.c: New test.
* gcc.target/riscv/rvv/autovec/max-vect-2.c: New test.
|
|
Similar to 116149 we use the mode size of operand MODE_IDX but that
one could refer to a broadcast scalar. Use operand 3 for scalar
broadcast patterns instead.
PR target/123022
gcc/ChangeLog:
* config/riscv/vector.md: Add mode_idx attribute.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/pr123022-2.c: New test.
* gcc.target/riscv/rvv/autovec/pr123022.c: New test.
|
|
This implements #pragma GCC target () for riscv.
All the functionality was already there so we only need to wrap existing
functions.
PR target/115325
gcc/ChangeLog:
* config/riscv/riscv-c.cc (riscv_pragma_target_parse): New
function.
(riscv_register_pragmas): Register riscv_pragma_target_parse.
* config/riscv/riscv-protos.h (riscv_process_target_attr_for_pragma):
Declare.
(riscv_reset_previous_fndecl): Ditto.
* config/riscv/riscv-target-attr.cc (riscv_process_target_attr_for_pragma):
New function.
* config/riscv/riscv.cc (riscv_reset_previous_fndecl): Reset.
(riscv_option_save): New function.
(riscv_option_print): Ditto.
(riscv_get_interrupt_type): Adjust docs.
(TARGET_OPTION_SAVE): Implement.
(TARGET_OPTION_PRINT): Ditto.
* doc/extend.texi: Document that riscv can do target pragams.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/pragma-target-1.c: New test.
* gcc.target/riscv/pragma-target-2.c: New test.
|
|
This implements mask reductions by first counting the bits in the mask
(vcpop.m) and then comparing the resulting scalar against 0 or len.
gcc/ChangeLog:
* config/riscv/autovec.md (reduc_sbool_and_scal_<mode>): New
expander.
(reduc_sbool_ior_scal_<mode>): Ditto.
(reduc_sbool_xor_scal_<mode>): Ditto.
* config/riscv/riscv-protos.h (expand_mask_reduction): Declare.
* config/riscv/riscv-v.cc (expand_mask_reduction): New function.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-1-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-1.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-2-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-2.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-3-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-3.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-4-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-4.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-5-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-5.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-6-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-6.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-7-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-7.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-8-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-8.c: New test.
|
|
When we get a <= b ? b : a into ix86_expand_sse_fp_minmax we can
swap and invert this with -ffinite-math-only to get a < b ? a : b.
PR target/123027
* config/i386/i386-expand.cc (ix86_expand_sse_fp_minmax):
With !HONOR_NANS we can handle LE by swapping and inverting.
* gcc.target/i386/pr123027.c: New testcase.
* gcc.dg/torture/pr123027.c: Likewise.
|
|
Modules allow temploid friends to no longer be implicitly inline, as
functions defined in a class body will not be implicitly inline if
attached to a named module.
This requires us to clean up linkage handling a little bit, mostly by
replacing usages of 'DECL_TEMPLATE_INSTANTIATION' with
'DECL_TEMPLOID_INSTANTIATION' when determining if an entity has vague
linkage.
PR c++/122819
gcc/cp/ChangeLog:
* decl.cc (start_preparsed_function): Use
DECL_TEMPLOID_INSTANTIATION instead of
DECL_TEMPLATE_INSTANTIATION to check vague linkage.
* decl2.cc (vague_linkage_p): Likewise.
(c_parse_final_cleanups): Simplify condition.
* semantics.cc (expand_or_defer_fn_1): Also check for temploid
friend functions.
gcc/testsuite/ChangeLog:
* g++.dg/modules/tpl-friend-22.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
|
|
|
|
This fixes a regression introduced with r16-5258-g1d8e2d51e5c5cb.
With GCC 12+, we would not merge forwarders (with phis, vops included),
this meant that after the last cddce, degenerate phis would stay not
merged which allowed for better expansion. Now after my patch, the forwarder
block would be removed and get worse expansion. This fixes the problem
by creating the forwarder blocks in "optimized" and no other cleanupcfg
is called afterwards.
Oh this also fixes the problem at -O1 which was missed because the agressive
version of dce was not done at -O1.
Bootstrapped and tested on x86_64-linux-gnu.
PR tree-optimization/46555
gcc/ChangeLog:
* tree-cfgcleanup.cc (execute_cleanup_cfg_post_optimizing):
Don't set todo to include cleanupcfg; do it manually.
Call make_forwarders_with_degenerate_phis if optimizing.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/pr46555.c: New test.
Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
|
|
To understand what this function does, add a debug dump.
Bootstrapped and tested on x86_64-linux-gnu.
gcc/ChangeLog:
* tree-cfg.cc (make_forwarders_with_degenerate_phis): Add debug
dump.
Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
|
|
This moves make_forwarders_with_degenerate_phis to tree-cfg.cc
from tree-ssa-dce.cc to be able to use in a different pass.
Bootstrapped and tested on x86_64-linux-gnu.
gcc/ChangeLog:
* tree-ssa-dce.cc (sort_phi_args): Move to tree-cfg.cc.
(make_forwarders_with_degenerate_phis): Move to tree-cfg.cc.
(perform_tree_ssa_dce): Update for the updated return type
of make_forwarders_with_degenerate_phis.
* tree-cfg.cc (sort_phi_args): Moved from tree-ssa-dce.cc.
(make_forwarders_with_degenerate_phis): Moved from tree-ssa-dce.cc.
Update return type to bool and return true if an edge was split.
* tree-cfg.h (make_forwarders_with_degenerate_phis): New decl.
Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
|
|
This adds a missing #include for <stdlib.h> and removes redundant ones.
gcc/ada/
PR ada/123037
* rtinit.c [__MINGW32__]: Include <stdlib.h> and not <windows.h>.
* rtfinal.c [__MINGW32__]: Do not include <windows.h>.
|
|
Before this patch we missed the two cases here:
character*5 string5 ! Gives obsolescent message
character*(5) string5const ! Silent with constant
character*(2+3) string5expr ! Silent with expression
PR fortran/123025
gcc/fortran/ChangeLog:
* decl.cc (match_char_length): Add a check for the
obsolete '*' style of character declarations in the
alternate branch of checking so we dont miss two
use cases:
gcc/testsuite/ChangeLog:
* gfortran.dg/assumed_charlen_dummy.f90: These tests failed
with the change because of the default -pedantic option
used by the dg.exp mechanisms. Overide this default.
* gfortran.dg/automatic_char_len_1.f90: Ditto.
* gfortran.dg/entry_23.f: Ditto.
* gfortran.dg/finalize_59.f90: Dito.
* gfortran.dg/g77/f90-intrinsic-bit.f: Ditto.
* gfortran.dg/g77/f90-intrinsic-mathematical.f: Ditto.
* gfortran.dg/g77/f90-intrinsic-numeric.f: Ditto.
* gfortran.dg/g77/intrinsic-unix-bessel.f: Ditto.
* gfortran.dg/g77/intrinsic-unix-erf.f: Ditto.
* gfortran.dg/initialization_9.f90: Ditto.
* gfortran.dg/intrinsic_actual_4.f90: Ditto.
* gfortran.dg/namelist_assumed_char.f90: Ditto.
* gfortran.dg/pr15140.f90: Ditto.
Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
|
|
TARGET_EXPR represents semantic temporary objects and is deliberately
not handled by tsubst routines, which expect syntactic templated trees.
Add a comment and gcc_unreachable to make this explicit.
gcc/cp/ChangeLog:
* pt.cc (tsubst_expr): Add TARGET_EXPR case with explanatory
comment and gcc_unreachable.
Signed-off-by: Egas Ribeiro <egas.g.ribeiro@tecnico.ulisboa.pt>
Reviewed-by: Patrick Palka <ppalka@redhat.com>
|
|
This implements the C++23 proposal P2404R3 "Move-only types for
equality_comparable_with, totally_ordered_with, and
three_way_comparable_with". As agreed with the maintainers of libc++ and
MSVC STL, we treat this as a DR for C++20. It allows reasonable code to
compile which wasn't originally allowed in C++20, and only affects some
obscure subsumption cases for valid C++20 code.
libstdc++-v3/ChangeLog:
PR libstdc++/122946
* include/bits/version.def (concepts): Set value to 202207.
* include/bits/version.h: Regenerate.
* include/std/concepts (__comparison_common_type_with_impl)
(__comparison_common_type_with): New helper concepts.
(equality_comparable_with): Use __comparison_common_type_with.
* libsupc++/compare (three_way_comparable_with): Likewise.
(__glibcxx_want_concepts): Define to get __cpp_lib_concepts
here.
* testsuite/std/concepts/concepts.compare/move_only.cc: New
test.
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
|
|
We have __is_signed_integer and __is_unsigned_integer traits which
should have been updated by r16-2190-g4faa42ac0dee2c when making
__int128 an extended integer type (for PR libstdc++/96710). Currently
they check whether the type is a signed integer type or an unsigned
integer type, or a cv-qualified version of one of those. This doesn't
match the standard's definition, which does not include cv-qualified
types. This change ensures that signed __int128 and unsigned __int128
are included in those traits in strict -std modes, and it removes the
use of remove_cv_t so that they are not true for cv-qualified types.
This makes the traits match the meaning of "signed integer type" and
"unsigned integer type" in the standard ([basic.fundamental]).
We also have an __is_standard_integer trait, which is true if either
__is_signed_integer or __is_unsigned_integer is true, but that's also
not a match for the definition in the standard. The definitions of
"signed integer type" and "unsigned integer type" include both standard
and extended integer types, so only saying "standard" in the trait name
is misleading (even before this change, because in non-strict -std modes
the __GLIBCXX_TYPE_INT_N_0 .. __GLIBCXX_TYPE_INT_N_3 types were always
included in the trait, and they aren't standard integer types).
This change renames __is_standard_integer to the more accurate
__is_signed_or_unsigned_integer. Because the set of signed and
unsigned integer types is the same as the set of standard and extended
integer types, the trait could instead have been renamed to
__is_standard_or_extended_integer. I think it's clearer and more
self-explanatory to avoid "standard and extended" and name it for the
signed and unsigned integer types.
N.B. we don't want to call it just __is_integer_type because the integer
types includes cv-qualified types and also bool and the character types
char, wchar_t, char16_t etc.
The consequences of redefining and renaming these traits are small, and
only positive.
Apart from the uses in the __is_standard_integer trait, the only other
uses of __is_signed_integer and __is_unsigned_integer are in <format>
and those uses are unaffected by this change to add 128-bit integers to
the traits. In both uses the type argument is already cv-unqualified,
and there is already explicit handling for 128-bit integers where that
is required.
The existing uses of __is_standard_integer can simply be changed to use
the new name. This does change the behaviour of those uses of the trait,
because the __is_signed_or_unsigned_integer trait now includes
128-bit integers in strict modes. However, that is a desirable change
that fixes some bugs. Specifically, the [utility.intcmp] functions such
as std::cmp_less and the [numeric.sat.arith] functions such as
std::add_sat did not support 128-bit integers in strict modes. Since the
standard says they should be enabled for all signed and unsigned integer
types (or equivalently, for all standard and extended integer types),
those functions should all support __int128 and unsigned __int128. That
is fixed by this change. Additionally, the same changes in <charconv>,
<mdspan>, and <stdckdint.h> enable the use of 128-bit integers for those
APIs in strict modes.
Finally, this also make a drive-by fix to the enable_if constraints for
the integer overloads of std::from_chars. That used remove_cv_t and so
enabled the overload for lvalue arguments of type const char, which
won't work and should not be enabled.
libstdc++-v3/ChangeLog:
* include/bits/intcmp.h: Replace all uses of
__is_standard_integer with __is_signed_or_unsigned_integer.
* include/bits/max_size_type.h: Fix outdated comment.
* include/bits/sat_arith.h: Replace all uses of
__is_standard_integer with __is_signed_or_unsigned_integer.
* include/c_compatibility/stdckdint.h: Replace all uses of the
__cv_unqual_signed_or_unsigned_integer_type concept with
__is_signed_or_unsigned_integer.
(__cv_unqual_signed_or_unsigned_integer_type): Remove.
* include/ext/numeric_traits.h: Fix outdated comment.
* include/std/charconv (from_chars): Replace use of
__is_standard_integer with __is_signed_or_unsigned_integer.
Do not enable for cv-qualified char.
* include/std/mdspan: Likewise.
* include/std/type_traits (__is_unsigned_integer): Include
unsigned __int128 in type list.
(__is_signed_integer): Include signed __int128 in type list.
(__is_standard_integer): Rename to ...
(__is_signed_or_unsigned_integer): ... this.
* testsuite/23_containers/mdspan/extents/ctor_ints.cc: Test
with 128-bit integers.
* testsuite/23_containers/mdspan/submdspan/strided_slice.cc:
Likewise.
* testsuite/20_util/integer_comparisons/extended.cc: New test.
* testsuite/26_numerics/saturation/extended.cc: New test.
* testsuite/26_numerics/stdckdint/extended.cc: New test.
Reviewed-by: Patrick Palka <ppalka@redhat.com>
|
|
When checking a deleted explicit specialization in a SFINAE context,
we were incorrectly selecting a partial specialization because
resolve_nondeduced_context was calling mark_used. But resolving an
overload to a single function (per DR 115) does not constitute ODR-use,
so mark_used shouldn't be called there. Instead callers should call
mark_used or mark_single_function on the result to uniformly handle all
resolvable overloads (even non-template-id ones).
This turns out to fix the below testcase because it causes convert_to_void
for void(X::template g<0>) to properly propagate ODR-use failure (due to
deleted g<0>) and return error_mark_node instead of returning void_node.
PR c++/119343
gcc/cp/ChangeLog:
* pt.cc (resolve_nondeduced_context): Remove mark_used call.
gcc/testsuite/ChangeLog:
* g++.dg/template/sfinae-deleted-pr119343.C: New test.
Signed-off-by: Egas Ribeiro <egas.g.ribeiro@tecnico.ulisboa.pt>
Reviewed-by: Patrick Palka <ppalka@redhat.com>
|
|
Add support in contrib/test_installed for more variables (via
associated command-line options to the script) that gcc/Makefile.in
can set:
* ALT_CC_UNDER_TEST, ALT_CXX_UNDER_TEST and COMPAT_OPTIONS are used in
compat testing (against the same or a different compiler).
* The libiconv variable is used for testing iconv support for
particular character sets, and defaults to -liconv if not set in
site.exp, which is wrong on systems with iconv in libc; keep the
default, but add an option to override this.
Note that the dg-require-iconv testing is currently bogus in a cross
environment, and this patch does nothing to address that. The tests
using dg-require-iconv actually care about character set support on
the *host*, for character conversions carried out in the compiler,
and the libiconv setting put in site.exp by gcc/Makefile.in is a
*host* library setting. But dg-require-iconv /
check_iconv_available tests availability when compiling, linking and
executing for the *target*. If the host and target have close
enough to the same OS, this may work by accident, but otherwise it
will incorrectly enable / disable these tests based on target
information (but using a libiconv setting designed for the host)
when it should be based on host information.
* test_installed (--with-alt-cc=, --with-alt-cxx=)
(--with-compat-options=, --with-libiconv=): New options.
|
|
The problem comes from a quirk of the GNU PE-COFF linker, which wants
to make sure that .tls$ZZZ is laid out last among the TLS sections,
but first globs all .tls$* sections together. The solution matches
Clang's output.
gcc/
PR target/80881
* config/mingw/winnt.cc (mingw_pe_unique_section): Put two dollar
signs for TLS sections after the prefix.
(mingw_pe_asm_named_section): Deal with all TLS sections uniformly.
gcc/testsuite/
* gcc.dg/tls/data-sections-1.c: New test.
|
|
gcc/Changelog:
* MAINTAINERS: add ncm
|
|
Add support for C1-Nano, C1-Pro, C1-Premium and C1-Ultra.
gcc/ChangeLog:
* config/aarch64/aarch64-cores.def (AARCH64_CORE): Add C1-Nano,
C1-Pro, C1-Premium and C1-Ultra.
* config/aarch64/aarch64-tune.md: Regenerate.
* doc/invoke.texi: Document C1 cores.
|
|
The following handles (by rejecting) simplifications that end up
turning a VN NARY operation into a call which would be a VN REFERENCE
and is unexpected and not handled.
PR tree-optimization/123040
* tree-ssa-sccvn.cc (vn_nary_build_or_lookup_1): Only insert
nary results.
* g++.dg/torture/pr123040.C: New testcase.
|
|
[PR112591].
The changes the _Variadic_union implementation, in a way that the
_Unitialized<T, false> partial specialization for non-trivial types is not
necessary.
This is simply done by separating the specialization for __trivially_destructible
being true and false, and for the later defining an empty destructor (similarly
as it was done using concepts).
We also reduce the number of specialization of _Variadic_union, so specialization
(int, int) is reused by (string, int, int) and (int, int). This is done by
initialization __trivially_destructible with conjunction of
is_trivially_destructible_v for remaining components. This is only necessary
for non-trivial (false) specialization, as if both _First and _Rest... are
trivially destructible, then _Rest must also be.
The above change does not regress the fix r14-7259-g2d55d94e5df389 for
template depth, and both before and after the change template depth is 266.
I have added dg-options to the 87619.cc to catch future regressions.
This also add test for PR112591.
PR libstdc++/112591
libstdc++-v3/ChangeLog:
* include/std/variant (_Variadic_union): Separate specializations for
for union of only trivially destructible types (true as first template
argument). Unconditionally define destructor for _Variadic_union<false,
_First, _Rest...>.
* testsuite/20_util/variant/87619.cc: Add limit for the template depth.
* testsuite/20_util/variant/112591.cc: New test.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
|