]> gcc.gnu.org Git - gcc.git/log
gcc.git
4 months agoRISC-V: Add Zfbfmin extension
Xiao Zeng [Wed, 15 May 2024 05:56:42 +0000 (13:56 +0800)]
RISC-V: Add Zfbfmin extension

1 In the previous patch, the libcall for BF16 was implemented:
<https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=8c7cee80eb50792e57d514be1418c453ddd1073e>

2 Riscv provides Zfbfmin extension, which completes the "Scalar BF16 Converts":
<https://github.com/riscv/riscv-bfloat16/blob/main/doc/riscv-bfloat16-zfbfmin.adoc>

3 Implemented replacing libcall with Zfbfmin extension instruction.

4 Reused previous testcases in:
<https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=8c7cee80eb50792e57d514be1418c453ddd1073e>
gcc/ChangeLog:

* config/riscv/iterators.md: Add mode_iterator between
floating-point modes and BFmode.
* config/riscv/riscv.cc (riscv_output_move): Handle BFmode move
for zfbfmin.
* config/riscv/riscv.md (trunc<mode>bf2): New pattern for BFmode.
(extendbfsf2): Dotto.
(*movhf_hardfloat): Add BFmode.
(*mov<mode>_hardfloat): Dotto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/zfbfmin-bf16_arithmetic.c: New test.
* gcc.target/riscv/zfbfmin-bf16_comparison.c: New test.
* gcc.target/riscv/zfbfmin-bf16_float_libcall_convert.c: New test.
* gcc.target/riscv/zfbfmin-bf16_integer_libcall_convert.c: New test.

4 months agoDaily bump.
GCC Administrator [Wed, 5 Jun 2024 00:16:55 +0000 (00:16 +0000)]
Daily bump.

4 months agoc++: Add testcase for PR103338
Simon Martin [Tue, 4 Jun 2024 09:59:31 +0000 (11:59 +0200)]
c++: Add testcase for PR103338

The case in that PR used to ICE until commit f04dc89. This patch simply adds
the case to the testsuite.

Successfully tested on x86_64-pc-linux-gnu.

PR c++/103388

gcc/testsuite/ChangeLog:

* g++.dg/parse/crash73.C: New test.

4 months agoFortran: fix ALLOCATE with SOURCE=, zero-length character [PR83865]
Harald Anlauf [Mon, 3 Jun 2024 20:02:06 +0000 (22:02 +0200)]
Fortran: fix ALLOCATE with SOURCE=, zero-length character [PR83865]

gcc/fortran/ChangeLog:

PR fortran/83865
* trans-stmt.cc (gfc_trans_allocate): Restrict special case for
source-expression with zero-length character to rank 0, so that
the array shape is not discarded.

gcc/testsuite/ChangeLog:

PR fortran/83865
* gfortran.dg/allocate_with_source_32.f90: New test.

4 months agoAdd missing space after seen_error in gcc/cp/pt.cc
Simon Martin [Tue, 4 Jun 2024 15:27:25 +0000 (17:27 +0200)]
Add missing space after seen_error in gcc/cp/pt.cc

I realized that I committed a change with a missing space after seen_error.
This fixes it, as well as another occurrence in the same file.

Apologies for the mistake - I'll commit this as obvious.

gcc/cp/ChangeLog:

* pt.cc (tsubst_expr): Add missing space after seen_error.
(dependent_type_p): Likewise.

4 months agoFix PR c++/111106: missing ; causes internal compiler error
Simon Martin [Fri, 24 May 2024 15:00:17 +0000 (17:00 +0200)]
Fix PR c++/111106: missing ; causes internal compiler error

We currently fail upon the following because an assert in dependent_type_p
fails for f's parameter

=== cut here ===
consteval int id (int i) { return i; }
constexpr int
f (auto i) requires requires { id (i) } { return i; }
void g () { f (42); }
=== cut here ===

This patch fixes this by relaxing the assert to pass during error recovery.

Successfully tested on x86_64-pc-linux-gnu.

PR c++/111106

gcc/cp/ChangeLog:

* pt.cc (dependent_type_p): Don't fail assert during error recovery.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/consteval37.C: New test.

4 months agolibstdc++: Only define std::span::at for C++26 [PR115335]
Jonathan Wakely [Tue, 4 Jun 2024 14:06:44 +0000 (15:06 +0100)]
libstdc++: Only define std::span::at for C++26 [PR115335]

In r14-5689-g1fa85dcf656e2f I added std::span::at and made the correct
changes to the __cpp_lib_span macro (with tests for the correct value in
C++20/23/26). But I didn't make the declaration of std::span::at
actually depend on the macro, so it was defined for C++20 and C++23, not
only for C++26. This fixes that oversight.

libstdc++-v3/ChangeLog:

PR libstdc++/115335
* include/std/span (span::at): Guard with feature test macro.

4 months agoranger: Improve CLZ fold_range [PR115337]
Jakub Jelinek [Tue, 4 Jun 2024 14:16:49 +0000 (16:16 +0200)]
ranger: Improve CLZ fold_range [PR115337]

cfn_ctz::fold_range includes special cases for the case where .CTZ has
two arguments and so is well defined at zero, and the second argument is
equal to prec or -1, but cfn_clz::fold_range does that only for the prec
case.  -1 is fairly common as well though, because the <stdbit.h> builtins
do use it now, so I think it is worth special casing that.
If we don't know anything about the argument, the difference for
.CLZ (arg, -1) is that previously the result was varying, now it will be
[-1, prec-1].  If we knew arg can't be zero, it used to be optimized before
as well into e.g. [0, prec-1] or similar.

2024-06-04  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/115337
* gimple-range-op.cc (cfn_clz::fold_range): For
m_gimple_call_internal_p handle as a special case also second argument
of -1 next to prec.

4 months agofold-const: Handle CTZ like CLZ in tree_call_nonnegative_warnv_p [PR115337]
Jakub Jelinek [Tue, 4 Jun 2024 13:52:09 +0000 (15:52 +0200)]
fold-const: Handle CTZ like CLZ in tree_call_nonnegative_warnv_p [PR115337]

I think we can handle CTZ exactly like CLZ in tree_call_nonnegative_warnv_p.
Like CLZ, if it is UB at zero, the result range is [0, prec-1] and if it is
well defined at zero, the second argument provides the value at zero.

2024-06-04  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/115337
* fold-const.cc (tree_call_nonnegative_warnv_p): Handle
CASE_CFN_CTZ like CASE_CFN_CLZ.

4 months agofold-const, gimple-fold: Some formatting cleanups
Jakub Jelinek [Tue, 4 Jun 2024 13:51:31 +0000 (15:51 +0200)]
fold-const, gimple-fold: Some formatting cleanups

While looking into PR115337, I've spotted some badly formatted code,
which the following patch fixes.

2024-06-04  Jakub Jelinek  <jakub@redhat.com>

* fold-const.cc (tree_call_nonnegative_warnv_p): Formatting fixes.
(tree_invalid_nonnegative_warnv_p): Likewise.
* gimple-fold.cc (gimple_call_nonnegative_warnv_p): Likewise.

4 months agofold-const: Fix up CLZ handling in tree_call_nonnegative_warnv_p [PR115337]
Jakub Jelinek [Tue, 4 Jun 2024 13:49:41 +0000 (15:49 +0200)]
fold-const: Fix up CLZ handling in tree_call_nonnegative_warnv_p [PR115337]

The function currently incorrectly assumes all the __builtin_clz* and .CLZ
calls have non-negative result.  That is the case of the former which is UB
on zero and has [0, prec-1] return value otherwise, and is the case of the
single argument .CLZ as well (again, UB on zero), but for two argument
.CLZ is the case only if the second argument is also nonnegative (or if we
know the argument can't be zero, but let's do that just in the ranger IMHO).

The following patch does that.

2024-06-04  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/115337
* fold-const.cc (tree_call_nonnegative_warnv_p) <CASE_CFN_CLZ>:
If arg1 is non-NULL, RECURSE on it, otherwise return true.

* gcc.dg/bitint-106.c: New test.

4 months agotestsuite: i386: Require ifunc support in gcc.target/i386/avx10_1-25.c etc.
Rainer Orth [Tue, 4 Jun 2024 11:33:46 +0000 (13:33 +0200)]
testsuite: i386: Require ifunc support in gcc.target/i386/avx10_1-25.c etc.

Two new AVX10.1 tests FAIL on Solaris/x86:

FAIL: gcc.target/i386/avx10_1-25.c (test for excess errors)
FAIL: gcc.target/i386/avx10_1-26.c (test for excess errors)

Excess errors:
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.target/i386/avx10_1-25.c:6:9: error: the call requires 'ifunc', which is not supported by this target

Fixed by requiring ifunc support.

Tested on i386-pc-solaris2.11 and x86_64-pc-linux-gnu.

2024-06-04  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc/testsuite:
* gcc.target/i386/avx10_1-25.c: Require ifunc support.
* gcc.target/i386/avx10_1-26.c: Likewise.

4 months agobuiltins: Force SAVE_EXPR for __builtin_{add,sub,mul}_overflow and __builtin{add...
Jakub Jelinek [Tue, 4 Jun 2024 10:28:01 +0000 (12:28 +0200)]
builtins: Force SAVE_EXPR for __builtin_{add,sub,mul}_overflow and __builtin{add,sub}c [PR108789]

The following testcase is miscompiled, because we use save_expr
on the .{ADD,SUB,MUL}_OVERFLOW call we are creating, but if the first
two operands are not INTEGER_CSTs (in that case we just fold it right away)
but are TREE_READONLY/!TREE_SIDE_EFFECTS, save_expr doesn't actually
create a SAVE_EXPR at all and so we lower it to
*arg2 = REALPART_EXPR (.ADD_OVERFLOW (arg0, arg1)), \
IMAGPART_EXPR (.ADD_OVERFLOW (arg0, arg1))
which evaluates the ifn twice and just hope it will be CSEd back.
As *arg2 aliases *arg0, that is not the case.
The builtins are really never const/pure as they store into what
the third arguments points to, so after handling the INTEGER_CST+INTEGER_CST
case, I think we should just always use SAVE_EXPR.  Just building SAVE_EXPR
by hand and setting TREE_SIDE_EFFECTS on it doesn't work, because
c_fully_fold optimizes it away again, so the following patch marks the
ifn calls as TREE_SIDE_EFFECTS (but doesn't do it for the
__builtin_{add,sub,mul}_overflow_p case which were designed for use
especially in constant expressions and don't really evaluate the
realpart side, so we don't really need a SAVE_EXPR in that case).

2024-06-04  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/108789
* builtins.cc (fold_builtin_arith_overflow): For ovf_only,
don't call save_expr and don't build REALPART_EXPR, otherwise
set TREE_SIDE_EFFECTS on call before calling save_expr.
(fold_builtin_addc_subc): Set TREE_SIDE_EFFECTS on call before
calling save_expr.

* gcc.c-torture/execute/pr108789.c: New test.

4 months agoinvoke.texi: Clarify -march=lujiazui
Jakub Jelinek [Tue, 4 Jun 2024 10:20:13 +0000 (12:20 +0200)]
invoke.texi: Clarify -march=lujiazui

I was recently searching which exact CPUs are affected by the PR114576
wrong-code issue and went from the PTA_* bitmasks in GCC, so arrived
at the goldmont, goldmont-plus, tremont and lujiazui CPUs (as -march=
cases which do enable -maes and don't enable -mavx).
But when double-checking that against the invoke.texi documentation,
that was true for the first 3, but lujiazui said it supported AVX.
I was really confused by that, until I found the
https://gcc.gnu.org/pipermail/gcc-patches/2022-October/604407.html
explanation.  So, seems the CPUs do have AVX and F16C but -march=lujiazui
doesn't enable those and even activelly attempts to filter those out from
the announced CPUID features, in glibc as well as e.g. in libgcc.

Thus, I think we should document what actually happens, otherwise
users could assume that
gcc -march=lujiazui predefines __AVX__ and __F16C__, which it doesn't.

2024-06-04  Jakub Jelinek  <jakub@redhat.com>

* doc/invoke.texi (lujiazui): Clarify that while the CPUs do support
AVX and F16C, -march=lujiazui actually doesn't enable those.

4 months agolibstdc++: Fix simd<char> conversion for -fno-signed-char for Clang
Matthias Kretz [Mon, 3 Jun 2024 10:02:07 +0000 (12:02 +0200)]
libstdc++: Fix simd<char> conversion for -fno-signed-char for Clang

The special case for Clang in the trait producing a signed integer type
lead to the trait returning 'char' where it should have been 'signed
char'. This workaround was introduced because on Clang the return type
of vector compares was not convertible to '_SimdWrapper<
__int_for_sizeof_t<...' unless '__int_for_sizeof_t<char>' was an alias
for 'char'. In order to not rewrite the complete mask type code (there
is code scattered around the implementation assuming signed integers),
this needs to be 'signed char'; so the special case for Clang needs to
be removed.
The conversion issue is now solved in _SimdWrapper, which now
additionally allows conversion from vector types with compatible
integral type.

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:

PR libstdc++/115308
* include/experimental/bits/simd.h (__int_for_sizeof): Remove
special cases for __clang__.
(_SimdWrapper): Change constructor overload set to allow
conversion from vector types with integral conversions via bit
reinterpretation.

4 months agoDo single-lane SLP discovery for reductions
Richard Biener [Fri, 23 Feb 2024 10:45:50 +0000 (11:45 +0100)]
Do single-lane SLP discovery for reductions

The following performs single-lane SLP discovery for reductions.
It requires a fixup for outer loop vectorization where a check
for multiple types needs adjustments as otherwise bogus pointer
IV increments happen when there are multiple copies of vector stmts
in the inner loop.

For the reduction epilog handling this extends the optimized path
to cover the trivial single-lane SLP reduction case.

The fix for PR65518 implemented in vect_grouped_load_supported for
non-SLP needs a SLP counterpart that I put in get_group_load_store_type.

I've decided to adjust three testcases for appearing single-lane
SLP instances instead of not dumping "vectorizing stmts using SLP"
for single-lane instances as that also requires testsuite adjustments.

* tree-vect-slp.cc (vect_build_slp_tree_2): Only multi-lane
discoveries are reduction chains and need special backedge
treatment.
(vect_analyze_slp): Fall back to single-lane SLP discovery
for reductions.  Make sure to try single-lane SLP reduction
for all reductions as fallback.
(vectorizable_load): Avoid outer loop SLP vectorization with
multi-copy vector stmts in the inner loop.
(vectorizable_store): Likewise.
* tree-vect-loop.cc (vect_create_epilog_for_reduction): Allow
direct opcode and shift reduction also for SLP reductions
with a single lane.
* tree-vect-stmts.cc (get_group_load_store_type): For SLP also
check for the PR65518 single-element interleaving case as done in
vect_grouped_load_supported.

* gcc.dg/vect/slp-24.c: Expect another SLP instance for the
reduction.
* gcc.dg/vect/slp-24-big-array.c: Likewise.
* gcc.dg/vect/slp-reduc-6.c: Remove scan for zero SLP instances.

4 months agoAvoid inserting after a GIMPLE_COND with SLP and early break
Richard Biener [Mon, 27 May 2024 12:40:27 +0000 (14:40 +0200)]
Avoid inserting after a GIMPLE_COND with SLP and early break

When vectorizing an early break loop with LENs (do we miss some
check here to disallow this?) we can end up deciding to insert
stmts after a GIMPLE_COND when doing SLP scheduling and trying
to be conservative with placing of stmts only dependent on
the implicit loop mask/len.  The following avoids this, I guess
it's not perfect but it does the job fixing some observed
RISC-V regression.

* tree-vect-slp.cc (vect_schedule_slp_node): For mask/len
loops make sure to not advance the insertion iterator
beyond a GIMPLE_COND.

4 months agotestsuite: analyzer: Skip tests with non-numeric macros on Solaris [PR107750]
Rainer Orth [Tue, 4 Jun 2024 07:04:25 +0000 (09:04 +0200)]
testsuite: analyzer: Skip tests with non-numeric macros on Solaris [PR107750]

A couple of gcc.dg/analyzer/fd-*.c tests still FAIL on Solaris.  The
reason is always the same: they use macros that don't expand to simple
numbers, something which c/c-parser.cc
(ana::c_translation_unit::consider_macro) cannot handle:

* <sys/socket.h>:

* <sys/fcntl.h>:

To avoid the resulting noise, this patch skips the affected tests.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
x86_64-pc-linux-gnu.

2024-06-03  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc/testsuite:
PR analyzer/107750
* gcc.dg/analyzer/fd-accept.c: Skip on *-*-solaris2*.
* gcc.dg/analyzer/fd-access-mode-target-headers.c: Likewise.
* gcc.dg/analyzer/fd-connect.c: Likewise.
* gcc.dg/analyzer/fd-datagram-socket.c: Likewise.
* gcc.dg/analyzer/fd-listen.c: Likewise.
* gcc.dg/analyzer/fd-socket-misuse.c: Likewise.
* gcc.dg/analyzer/fd-stream-socket-active-open.c: Likewise.
* gcc.dg/analyzer/fd-stream-socket-passive-open.c: Likewise.
* gcc.dg/analyzer/fd-stream-socket.c: Likewise.

4 months agoAdjust testcase for -march=cascadelake
liuhongt [Tue, 4 Jun 2024 02:13:09 +0000 (10:13 +0800)]
Adjust testcase for -march=cascadelake

gcc/testsuite/ChangeLog:

PR target/115299
* gcc.target/i386/pr86722.c: Also scan for blendvpd.

4 months agoDaily bump.
GCC Administrator [Tue, 4 Jun 2024 00:17:57 +0000 (00:17 +0000)]
Daily bump.

4 months agors6000: Fix up PCH in --enable-host-pie builds [PR115324]
Jakub Jelinek [Mon, 3 Jun 2024 21:11:06 +0000 (23:11 +0200)]
rs6000: Fix up PCH in --enable-host-pie builds [PR115324]

PCH doesn't work properly in --enable-host-pie configurations on
powerpc*-linux*.
The problem is that the rs6000_builtin_info and rs6000_instance_info
arrays mix pointers to .rodata/.data (bifname and attr_string point
to string literals in .rodata section, and the next member is either NULL
or &rs6000_instance_info[XXX]) and GC member (tree fntype).
Now, for normal GC this works just fine, we emit
  {
    &rs6000_instance_info[0].fntype,
    1 * (RS6000_INST_MAX),
    sizeof (rs6000_instance_info[0]),
    &gt_ggc_mx_tree_node,
    &gt_pch_nx_tree_node
  },
  {
    &rs6000_builtin_info[0].fntype,
    1 * (RS6000_BIF_MAX),
    sizeof (rs6000_builtin_info[0]),
    &gt_ggc_mx_tree_node,
    &gt_pch_nx_tree_node
  },
GC roots which are strided and thus cover only the fntype members of all
the elements of the two arrays.
For PCH though it actually results in saving those huge arrays (one is
130832 bytes, another 81568 bytes) into the .gch files and loading them back
in full.  While the bifname and attr_string and next pointers are marked as
GTY((skip)), they are actually saved to point to the .rodata and .data
sections of the process which writes the PCH, but because cc1/cc1plus etc.
are position independent executables with --enable-host-pie, when it is
loaded from the PCH file, it can point in a completely different addresses
where nothing is mapped at all or some random different thing appears at.
While gengtype supports the callback option, that one is meant for
relocatable function pointers and doesn't work in the case of GTY arrays
inside of .data section anyway.

So, either we'd need to add some further GTY extensions, or the following
patch instead reworks it such that the fntype members which were the only
reason for PCH in those arrays are moved to separate arrays.

Size-wise in .data sections it is (in bytes):

                             vanilla    patched
rs6000_builtin_info          130832     110704
rs6000_instance_info          81568      40784
rs6000_overload_info           7392       7392
rs6000_builtin_info_fntype        0      10064
rs6000_instance_info_fntype       0      20392
sum                          219792     189336

where previously we saved/restored for PCH those 130832+81568 bytes, now we
save/restore just 10064+20392 bytes, so this change is beneficial for the
data section size.

Unfortunately, it grows the size of the rs6000_init_generated_builtins
function, vanilla had 218328 bytes, patched has 228668.

When I applied
 void
 rs6000_init_generated_builtins ()
 {
+  bifdata *rs6000_builtin_info_p;
+  tree *rs6000_builtin_info_fntype_p;
+  ovlddata *rs6000_instance_info_p;
+  tree *rs6000_instance_info_fntype_p;
+  ovldrecord *rs6000_overload_info_p;
+  __asm ("" : "=r" (rs6000_builtin_info_p) : "0" (rs6000_builtin_info));
+  __asm ("" : "=r" (rs6000_builtin_info_fntype_p) : "0" (rs6000_builtin_info_fntype));
+  __asm ("" : "=r" (rs6000_instance_info_p) : "0" (rs6000_instance_info));
+  __asm ("" : "=r" (rs6000_instance_info_fntype_p) : "0" (rs6000_instance_info_fntype));
+  __asm ("" : "=r" (rs6000_overload_info_p) : "0" (rs6000_overload_info));
+  #define rs6000_builtin_info rs6000_builtin_info_p
+  #define rs6000_builtin_info_fntype rs6000_builtin_info_fntype_p
+  #define rs6000_instance_info rs6000_instance_info_p
+  #define rs6000_instance_info_fntype rs6000_instance_info_fntype_p
+  #define rs6000_overload_info rs6000_overload_info_p
+
hack by hand, the size of the function is 209700 though, so if really
wanted, we could add __attribute__((__noipa__)) to the function when
building with recent enough GCC and pass pointers to the first elements
of the 5 arrays to the function as arguments.  If you want such a change,
could that be done incrementally?

2024-06-03  Jakub Jelinek  <jakub@redhat.com>

PR target/115324
* config/rs6000/rs6000-gen-builtins.cc (write_decls): Remove
GTY markup from struct bifdata and struct ovlddata and remove their
fntype members.  Change next member in struct ovlddata and
first_instance member of struct ovldrecord to have int type rather
than struct ovlddata *.  Remove GTY markup from rs6000_builtin_info
and rs6000_instance_info arrays, declare new
rs6000_builtin_info_fntype and rs6000_instance_info_fntype arrays,
which have GTY markup.
(write_bif_static_init): Adjust for the above changes.
(write_ovld_static_init): Likewise.
(write_init_bif_table): Likewise.
(write_init_ovld_table): Likewise.
* config/rs6000/rs6000-builtin.cc (rs6000_init_builtins): Likewise.
* config/rs6000/rs6000-c.cc (find_instance): Likewise.  Make static.
(altivec_resolve_overloaded_builtin): Adjust for the above changes.

4 months agoc++: Fix parsing of abstract-declarator starting with ... followed by opening paren...
Jakub Jelinek [Mon, 3 Jun 2024 21:07:08 +0000 (23:07 +0200)]
c++: Fix parsing of abstract-declarator starting with ... followed by opening paren [PR115012]

The C++26 P2662R3 Pack indexing paper mentions that both GCC
and MSVC don't handle T...[10] parameter declaration when T
is a pack.  And apparently neither T...(args).
While the former will change meaning in C++26, T...(args) is still
valid even in C++26.

The following patch handles just the T...(args) case in
cp_parser_direct_declarator.

2024-06-03  Jakub Jelinek  <jakub@redhat.com>

PR c++/115012
* parser.cc (cp_parser_direct_declarator): Handle
abstract declarator starting with ... followed by opening paren.

* g++.dg/cpp0x/variadic185.C: New test.

4 months agodiagnostics: add SARIF property artifact.roles (3.24.6)
David Malcolm [Mon, 3 Jun 2024 20:51:54 +0000 (16:51 -0400)]
diagnostics: add SARIF property artifact.roles (3.24.6)

Add the property "roles" (SARIF v2.1 3.24.6) to artifacts.

Populate it with:
* "analysisTarget" for the top-level input file
* "resultFile" for any other file a diagnostic is reported in
* "tracedFile" for any file a diagnostic event is reported in

gcc/ChangeLog:
* diagnostic-format-sarif.cc: Include "ordered-hash-map.h" and
"sbitmap.h".
(enum class diagnostic_artifact_role): New.
(class sarif_artifact): New.
(sarif_builder::maybe_make_artifact_content_object): Make public.
(sarif_builder::m_filenames): Replace with...
(sarif_builder::m_filename_to_artifact_map): ...this.
(sarif_artifact::add_role): New.
(sarif_artifact::populate_contents): New.
(get_artifact_role_string): New.
(sarif_artifact::populate_roles): New.
(sarif_result::on_nested_diagnostic): Pass role to
make_location_object.
(sarif_ice_notification::sarif_ice_notification): Likewise.
(sarif_builder::sarif_builder): Add "main_input_filename_" param.
Mark it as the artifact that the tool was instructed to scan.
(sarif_builder::make_result_object): Pass role to
make_locations_arr.
(sarif_builder::make_locations_arr): Add "role" param and pass it
to make_location_object.
(sarif_builder::make_location_object): Add "role" param and pass
it to maybe_make_physical_location_object.
(sarif_builder::maybe_make_physical_location_object): Add "role"
param and pass it to call to get_or_create_artifact, rather than
adding to now-removed "m_filenames".  Flag the artifact for its
contents to be embedded.
(sarif_builder::make_thread_flow_location_object): Pass role to
make_location_object.
(sarif_builder::make_run_object): Update for change from
m_filename to m_filename_to_artifact_map.  Call populate_contents
and populate_roles on each artifact_obj.
(sarif_builder::make_artifact_object): Convert to...
(sarif_builder::get_or_create_artifact): ...this, moving addition
of contents to make_run_object, and conditionalizing setting of
sourceLanguage on "role".
(sarif_output_format::sarif_output_format): Add
"main_input_filename_" param and pass to m_builder's ctor.
(sarif_stream_output_format::sarif_stream_output_format):
Likewise.
(sarif_file_output_format::sarif_file_output_format): Likewise.
(diagnostic_output_format_init_sarif_stderr): Add
"main_input_filename_" param and pass to ctor.
(diagnostic_output_format_init_sarif_file): Likewise.
(diagnostic_output_format_init_sarif_stream): Likewise.
* diagnostic.cc (diagnostic_output_format_init): Add
"main_input_filename_" param and pass to the
diagnostic_output_format_init_sarif_* calls.
* diagnostic.h (diagnostic_output_format_init): Add
main_input_filename_" param to decl.
(diagnostic_output_format_init_sarif_stderr): Likewise.
(diagnostic_output_format_init_sarif_file): Likewise.
(diagnostic_output_format_init_sarif_stream): Likewise.
* gcc.cc (driver_handle_option): Pass main input filename to
diagnostic_output_format_init.
* opts.cc (common_handle_option): Likewise.

gcc/testsuite/ChangeLog:
* c-c++-common/analyzer/sarif-path-role.c: New test.
* c-c++-common/analyzer/sarif-path-role.h: New header for above
test.
* c-c++-common/diagnostic-format-sarif-file-1.c: Verify the
artifact's "role" property.
* c-c++-common/diagnostic-format-sarif-file-header-role.c: New
test.
* c-c++-common/diagnostic-format-sarif-file-header-role.h: New
header for above test.
* c-c++-common/diagnostic-format-sarif-file-no-results.c: New
test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
4 months agolibstdc++: Reuse temporary buffer utils in <stacktrace>
Jonathan Wakely [Sat, 1 Jun 2024 09:45:55 +0000 (10:45 +0100)]
libstdc++: Reuse temporary buffer utils in <stacktrace>

The non-throwing allocation logic in std::stacktrace duplicates the
logic in <bits/stl_tempbuf.h>, so we can just reuse those utilities.

libstdc++-v3/ChangeLog:

* include/std/stacktrace (basic_stacktrace::_Impl::_M_allocate):
Use __detail::__get_temporary_buffer.
(basic_stacktrace::_Impl::_M_deallocate): Use
__detail::__return_temporary_buffer.

4 months agolibstdc++: Handle extended alignment in std::get_temporary_buffer [PR105258]
Jonathan Wakely [Wed, 13 Apr 2022 12:03:44 +0000 (13:03 +0100)]
libstdc++: Handle extended alignment in std::get_temporary_buffer [PR105258]

This adds extended alignment support to std::get_temporary_buffer etc.
so that when std::stable_sort uses a temporary buffer it works for
overaligned types.

Also simplify the _Temporary_buffer type by using RAII for the
allocation, via a new data member. This simplifies the _Temporary_buffer
constructor and destructor by makingthem only responsible for
constructing and destroying the elements, not managing the memory.

libstdc++-v3/ChangeLog:

PR libstdc++/105258
* include/bits/stl_tempbuf.h (__detail::__get_temporary_buffer):
New function to do allocation for get_temporary_buffer, with
extended alignment support.
(__detail::__return_temporary_buffer): Support extended
alignment.
(get_temporary_buffer): Use __get_temporary_buffer.
(return_temporary_buffer): Support extended alignment. Add
deprecated attribute.
(_Temporary_buffer): Move allocation and deallocation into a
subobject and remove try-catch block in constructor.
(__uninitialized_construct_buf): Use argument deduction for
value type.
* testsuite/20_util/temporary_buffer.cc: Add dg-warning for new
deprecated warning.
* testsuite/25_algorithms/stable_sort/overaligned.cc: New test.

4 months agolibstdc++: Fix -Wstringop-overflow warning coming from std::vector [PR109849]
François Dumont [Sat, 1 Jun 2024 20:17:19 +0000 (22:17 +0200)]
libstdc++: Fix -Wstringop-overflow warning coming from std::vector [PR109849]

libstdc++-v3/ChangeLog:

PR libstdc++/109849
* include/bits/vector.tcc
(std::vector<>::_M_range_insert(iterator, _FwdIt, _FwdIt,
forward_iterator_tag))[__cplusplus < 201103L]: Add __builtin_unreachable
expression to tell the compiler that the allocated buffer is large enough to
receive current elements plus the elements of the range to insert.

4 months agoImplement wrap-around arithmetics in DWARF expressions
Eric Botcazou [Mon, 3 Jun 2024 15:44:13 +0000 (17:44 +0200)]
Implement wrap-around arithmetics in DWARF expressions

For the following Ada package declaring a simple variable-sized record type:

package P is

  type Enum is (Zero, One, Two, Three, Four, Five, Six, Seven, Eight, Nine);

  type Rec (Kind : Enum := Zero) is record
      case Kind is
        when Four .. Seven =>
          S : String (1 .. 32);
        when others =>
          null;
      end case;
    end record;

end P;

the compiler builds a "size function" in GENERIC which is at -Og:

sizetype _GLOBAL.SZ5_p (p__enum p0)
{
  return (UNSIGNED_8) p0 + 252 <= 3 ? 32 : 0;
}

The UNSIGNED_8-based trick makes it possible to eliminates one branch but
relies on the wrap-around arithmetics of UNSIGNED_8.  This size function
is then translated into a DWARF procedure, but the wrap-around arithmetics
is dropped on the floor, leading to a wrong size calculation when the DWARF
procedure is executed.

The fix also contains an optimization of unsigned comparisons in DWARF for
the case where the type is smaller than the "generic type" like here.

gcc/
* dwarf2out.cc (loc_list_from_tree_1) <CEIL_DIV_EXPR>; Add const.
<do_comp_binop>: Use a signed comparison for small unsigned types.
Implement wrap-around arithmetics for small integer types.

4 months agolibstdc++: Optimize std::basic_string_view::starts_with
Jonathan Wakely [Thu, 30 May 2024 19:36:42 +0000 (20:36 +0100)]
libstdc++: Optimize std::basic_string_view::starts_with

We get smaller code at all optimization levels by not creating a
temporary object, just comparing lengths first and then using
traits_type::compare. This does less work than calling substr then
operator==.

libstdc++-v3/ChangeLog:

* include/std/string_view (starts_with(basic_string_view)):
Compare lengths first and then call traits_type::compare
directly.

4 months agoi386: Force operand 1 of bswapsi2 to a register for !TARGET_BSWAP [PR115321]
Uros Bizjak [Mon, 3 Jun 2024 13:48:18 +0000 (15:48 +0200)]
i386: Force operand 1 of bswapsi2 to a register for !TARGET_BSWAP [PR115321]

PR target/115321

gcc/ChangeLog:

* config/i386/i386.md (bswapsi2): Force operand 1
to a register also for !TARGET_BSWAP.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr115321.c: New test.

4 months agoRemove value_range typedef.
Aldy Hernandez [Fri, 31 May 2024 13:49:26 +0000 (15:49 +0200)]
Remove value_range typedef.

Now that pointers and integers have been disambiguated from irange,
and all the pointer range temporaries use prange, we can reclaim
value_range as a general purpose range container.

This patch removes the typedef, in favor of int_range_max, thus
providing slightly better ranges in places.  I have also used
int_range<1> or <2> when it's known ahead of time how big the range will
be, thus saving a few words.

In a follow-up patch I will rename the Value_Range temporary to
value_range.

No change in performance.

gcc/ChangeLog:

* builtins.cc (expand_builtin_strnlen): Replace value_range use
with int_range_max or irange when appropriate.
(determine_block_size): Same.
* fold-const.cc (minmax_from_comparison): Same.
* gimple-array-bounds.cc (check_out_of_bounds_and_warn): Same.
(array_bounds_checker::check_array_ref): Same.
* gimple-fold.cc (size_must_be_zero_p): Same.
* gimple-predicate-analysis.cc (find_var_cmp_const): Same.
* gimple-ssa-sprintf.cc (get_int_range): Same.
(format_integer): Same.
(try_substitute_return_value): Same.
(handle_printf_call): Same.
* gimple-ssa-warn-restrict.cc
(builtin_memref::extend_offset_range): Same.
* graphite-sese-to-poly.cc (add_param_constraints): Same.
* internal-fn.cc (get_min_precision): Same.
* match.pd: Same.
* pointer-query.cc (get_size_range): Same.
* range-op.cc (get_shift_range): Same.
(operator_trunc_mod::op1_range): Same.
(operator_trunc_mod::op2_range): Same.
* range.cc (range_negatives): Same.
* range.h (range_positives): Same.
(range_negatives): Same.
* tree-affine.cc (expr_to_aff_combination): Same.
* tree-data-ref.cc (compute_distributive_range): Same.
(nop_conversion_for_offset_p): Same.
(split_constant_offset): Same.
(split_constant_offset_1): Same.
(dr_step_indicator): Same.
* tree-dfa.cc (get_ref_base_and_extent): Same.
* tree-scalar-evolution.cc (iv_can_overflow_p): Same.
* tree-ssa-math-opts.cc (optimize_spaceship): Same.
* tree-ssa-pre.cc (insert_into_preds_of_block): Same.
* tree-ssa-reassoc.cc (optimize_range_tests_to_bit_test): Same.
* tree-ssa-strlen.cc (compare_nonzero_chars): Same.
(dump_strlen_info): Same.
(get_range_strlen_dynamic): Same.
(set_strlen_range): Same.
(maybe_diag_stxncpy_trunc): Same.
(strlen_pass::get_len_or_size): Same.
(strlen_pass::handle_builtin_string_cmp): Same.
(strlen_pass::count_nonzero_bytes_addr): Same.
(strlen_pass::handle_integral_assign): Same.
* tree-switch-conversion.cc (bit_test_cluster::emit): Same.
* tree-vect-loop-manip.cc (vect_gen_vector_loop_niters): Same.
(vect_do_peeling): Same.
* tree-vect-patterns.cc (vect_get_range_info): Same.
(vect_recog_divmod_pattern): Same.
* tree.cc (get_range_pos_neg): Same.
* value-range.cc (debug): Remove value_range variants.
* value-range.h (value_range): Remove typedef.
* vr-values.cc
(simplify_using_ranges::op_with_boolean_value_range_p): Replace
value_range use with int_range_max or irange when appropriate.
(check_for_binary_op_overflow): Same.
(simplify_using_ranges::legacy_fold_cond_overflow): Same.
(find_case_label_ranges): Same.
(simplify_using_ranges::simplify_abs_using_ranges): Same.
(test_for_singularity): Same.
(simplify_using_ranges::simplify_compare_using_ranges_1): Same.
(simplify_using_ranges::simplify_casted_compare): Same.
(simplify_using_ranges::simplify_switch_using_ranges): Same.
(simplify_conversion_using_ranges): Same.
(simplify_using_ranges::two_valued_val_range_p): Same.

4 months agotestsuite/115304 - properly guard gcc.dg/vect/slp-gap-1.c
Richard Biener [Mon, 3 Jun 2024 12:43:42 +0000 (14:43 +0200)]
testsuite/115304 - properly guard gcc.dg/vect/slp-gap-1.c

Testing on sparc shows we need vect_unpack and vect_perm.  This
isn't enough to resolve the GCN fail which ends up using interleaving.

PR testsuite/115304
* gcc.dg/vect/slp-gap-1.c: Require vect_unpack and vect_perm.

4 months agoinstall.texi (gcn): Fix date of recommended newlib version
Tobias Burnus [Mon, 3 Jun 2024 10:56:39 +0000 (12:56 +0200)]
install.texi (gcn): Fix date of recommended newlib version

gcc/ChangeLog:

* doc/install.texi (gcn): Fix date of recommended newlib version.

4 months agoaarch64: adjust enum writeback after rename
Marc Poulhiès [Mon, 3 Jun 2024 09:25:16 +0000 (11:25 +0200)]
aarch64: adjust enum writeback after rename

gcc/ChangeLog:

* config/aarch64/aarch64-ldp-fusion.cc (struct aarch64_pair_fusion):
Use new type name.

4 months agopair-fusion: fix for older GCC
Marc Poulhiès [Mon, 3 Jun 2024 07:43:52 +0000 (09:43 +0200)]
pair-fusion: fix for older GCC

Older GCCs fail with:

  .../gcc/pair-fusion.cc: In member function ‘bool pair_fusion_bb_info::fuse_pair(bool, unsigned int, int, rtl_ssa::insn_info*, rtl_ssa::in
  sn_info*, base_cand&, const rtl_ssa::insn_range_info&)’:
  .../gcc/pair-fusion.cc:1790:40: error: ‘writeback’ is not a class, namespace, or enumeration
     if (m_pass->should_handle_writeback (writeback::ALL)

Renaming the enum type works around the name conflict with the local
variable and also prevents future similar conflicts.

gcc/ChangeLog:

* pair-fusion.h (enum class writeback): Rename to...
(enum class writeback_type): ...this.
(struct pair_fusion): Adjust type name after renaming.
* pair-fusion.cc (pair_fusion_bb_info::track_access): Likewise.
(pair_fusion_bb_info::fuse_pair): Likewise.
(pair_fusion::process_block): Likewise.

4 months agotestsuite: Require vect_shift in gcc.dg/vect/pr112325.c [PR115303]
Rainer Orth [Mon, 3 Jun 2024 08:39:34 +0000 (10:39 +0200)]
testsuite: Require vect_shift in gcc.dg/vect/pr112325.c [PR115303]

The new gcc.dg/vect/pr112325.c test FAILs on Solaris/SPARC:

FAIL: gcc.dg/vect/pr112325.c -flto -ffat-lto-objects  scan-tree-dump-times vect "vectorized 1 loops" 1
FAIL: gcc.dg/vect/pr112325.c scan-tree-dump-times vect "vectorized 1 loops" 1

As analyzed in the PR, the test requires vect_shift, so this patch adds
that requirement.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11.

2024-06-03  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc/testsuite:
PR tree-optimization/115303
* gcc.dg/vect/pr112325.c: Require vect_shift.

4 months agoAdjust vector dump scans
Richard Biener [Fri, 31 May 2024 13:38:29 +0000 (15:38 +0200)]
Adjust vector dump scans

The following adjusts dump scanning for something followed by
successful vector analysis to more specifically look for
'Analysis succeeded' and not 'Analysis failed' because the
previous look for just 'succeeded' or 'failed' is easily confused
by SLP discovery dumping those words.

* tree-vect-loop.cc (vect_analyze_loop_1): Avoid extra space
before 'failed'.

* gcc.dg/vect/no-scevccp-outer-7.c: Adjust scanning for
succeeded analysis not interrupted by failure.
* gcc.dg/vect/no-scevccp-vect-iv-3.c: Likewise.
* gcc.dg/vect/vect-cond-reduc-4.c: Likewise.
* gcc.dg/vect/vect-live-2.c: Likewise.
* gcc.dg/vect/vect-outer-4c-big-array.c: Likewise.
* gcc.dg/vect/vect-reduc-dot-s16a.c: Likewise.
* gcc.dg/vect/vect-reduc-dot-s8a.c: Likewise.
* gcc.dg/vect/vect-reduc-dot-s8b.c: Likewise.
* gcc.dg/vect/vect-reduc-dot-u16a.c: Likewise.
* gcc.dg/vect/vect-reduc-dot-u16b.c: Likewise.
* gcc.dg/vect/vect-reduc-dot-u8a.c: Likewise.
* gcc.dg/vect/vect-reduc-dot-u8b.c: Likewise.
* gcc.dg/vect/vect-reduc-pattern-1a.c: Likewise.
* gcc.dg/vect/vect-reduc-pattern-1b-big-array.c: Likewise.
* gcc.dg/vect/vect-reduc-pattern-1c-big-array.c: Likewise.
* gcc.dg/vect/vect-reduc-pattern-2a.c: Likewise.
* gcc.dg/vect/vect-reduc-pattern-2b-big-array.c: Likewise.
* gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c: Likewise.

4 months agoAvoid ICE with pointer reduction
Richard Biener [Fri, 31 May 2024 13:17:10 +0000 (15:17 +0200)]
Avoid ICE with pointer reduction

There's another case where we can refer to neutral_op before
eventually converting it from pointer to integer so simply
do that unconditionally.

* tree-vect-loop.cc (get_initial_defs_for_reduction):
Always convert neutral_op.

4 months agoAdd some preference for floating point rtl ifcvt when sse4.1 is not available
liuhongt [Fri, 31 May 2024 06:38:07 +0000 (14:38 +0800)]
Add some preference for floating point rtl ifcvt when sse4.1 is not available

W/o TARGET_SSE4_1, it takes 3 instructions (pand, pandn and por) for
movdfcc/movsfcc, and could possibly fail cost comparison. Increase
branch cost could hurt performance for other modes, so specially add
some preference for floating point ifcvt.

gcc/ChangeLog:

PR target/115299
* config/i386/i386.cc (ix86_noce_conversion_profitable_p): Add
some preference for floating point ifcvt when SSE4.1 is not
available.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr115299.c: New test.
* gcc.target/i386/pr86722.c: Adjust testcase.

4 months agoAdd AVX10.1 target_clones support
Haochen Jiang [Mon, 20 May 2024 07:52:32 +0000 (15:52 +0800)]
Add AVX10.1 target_clones support

Since AVX10 is the first major ISA introduced after AVX-512, we propose
to add target_clones support for it.

Although AVX10.1-256 won't cover 512-bit part of AVX512F, but since
it is only for priority but not for implication, it won't be an issue.

gcc/ChangeLog:

* common/config/i386/i386-common.cc: Change Granite Rapids
series CPU type to P_PROC_AVX10_1_512.
* common/config/i386/i386-cpuinfo.h (enum feature_priority):
Revise comment part. Add P_AVX10_1_256, P_AVX10_1_512,
P_PROC_AVX10_1_512.
* common/config/i386/i386-isas.h: Link to avx10.1-256, avx10.1-512.

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx10_1-25.c: New test.
* gcc.target/i386/avx10_1-26.c: Ditto.

4 months ago[APX NF] Support APX NF for lzcnt/tzcnt/popcnt
Lingling Kong [Mon, 3 Jun 2024 06:23:57 +0000 (14:23 +0800)]
[APX NF] Support APX NF for lzcnt/tzcnt/popcnt

gcc/ChangeLog:

* config/i386/i386.md (clz<mode>2_lzcnt_nf): New define_insn.
(*clz<mode>2_lzcnt_falsedep_nf): Ditto.
(<lt_zcnt>_<mode>_nf): Ditto.
(*<lt_zcnt>_<mode>_falsedep_nf): Ditto.
(<lt_zcnt>_hi<nf_name>): Ditto.
(popcount<mode>2_nf): Ditto.
(*popcount<mode>2_falsedep_nf): Ditto.
(popcounthi2<nf_name>): Ditto.

4 months ago[APX NF] Support APX NF for mul/div
Lingling Kong [Mon, 3 Jun 2024 06:22:07 +0000 (14:22 +0800)]
[APX NF] Support APX NF for mul/div

gcc/ChangeLog:

* config/i386/i386.md (*mul<mode>3_1<nf_name>): New define_insn.
(*mulqi3_1<nf_name>): Ditto.
(*<u>divmod<mode>4_noext_nf): Ditto.
(<u>divmodhiqi3<nf_name>): Ditto.

4 months ago[APX NF] Support APX NF for shld/shrd
Lingling Kong [Mon, 3 Jun 2024 03:16:12 +0000 (11:16 +0800)]
[APX NF] Support APX NF for shld/shrd

gcc/ChangeLog:

* config/i386/i386.md (x86_64_shld): New define_insn.
(x86_64_shld<nf_name>): Ditto.
(x86_64_shld_ndd<nf_name>): Ditto.
(x86_64_shld_1<nf_name>): Ditto.
(x86_64_shld_ndd_1<nf_name>): Ditto.
(*x86_64_shld_shrd_1_nozext_nf): Ditto.
(x86_shld<nf_name>): Ditto.
(x86_shld_ndd<nf_name>): Ditto.
(x86_shld_1<nf_name>): Ditto.
(x86_shld_ndd_1<nf_name>): Ditto.
(*x86_shld_shrd_1_nozext_nf): Ditto.
(<insn><dwi>3_doubleword_lowpart_nf): Ditto.
(x86_64_shrd<nf_name>): Ditto.
(x86_64_shrd_ndd<nf_name>): Ditto.
(x86_64_shrd_1<nf_name>): Ditto.
(x86_64_shrd_ndd_1<nf_name>): Ditto.
(*x86_64_shrd_shld_1_nozext_nf): Ditto.
(x86_shrd<nf_name>): Ditto.
(x86_shrd_ndd<nf_name>): Ditto.
(x86_shrd_1<nf_name>): Ditto.
(x86_shrd_ndd_1<nf_name>): Ditto.
(*x86_shrd_shld_1_nozext_nf): Ditto.

4 months ago[APX NF] Support APX NF for rotate insns
Lingling Kong [Mon, 3 Jun 2024 03:13:18 +0000 (11:13 +0800)]
[APX NF] Support APX NF for rotate insns

gcc/ChangeLog:

* config/i386/i386.md (ashr<mode>3_cvt<nf_name>): New
define_insn.
(*<insn><mode>3_1<nf_name>): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/i386/apx-nf.c: Add test.

4 months ago[APX NF] Support APX NF for right shift insns
Lingling Kong [Mon, 3 Jun 2024 03:10:36 +0000 (11:10 +0800)]
[APX NF] Support APX NF for right shift insns

gcc/ChangeLog:

* config/i386/i386.md (*ashr<mode>3_1<nf_name>): New
define_insn.
(*lshr<mode>3_1<nf_name>): Ditto.
(*lshrqi3_1<nf_name>): Ditto.
(*lshrhi3_1<nf_name>): Ditto.

4 months ago[APX NF] Support APX NF for left shift insns
Lingling Kong [Mon, 3 Jun 2024 03:05:41 +0000 (11:05 +0800)]
[APX NF] Support APX NF for left shift insns

gcc/ChangeLog:

* config/i386/i386.md (*ashl<mode>3_1<nf_name>): New
define_insn.
(*ashlhi3_1<nf_name>): Ditto.
(*ashlqi3_1<nf_name>): Ditto.
* config/i386/sse.md: New define_split.

4 months ago[APX NF] Support APX NF for {sub/and/or/xor/neg}
Lingling Kong [Mon, 3 Jun 2024 03:00:03 +0000 (11:00 +0800)]
[APX NF] Support APX NF for {sub/and/or/xor/neg}

gcc/ChangeLog:

* config/i386/i386.md (nf_nonf_attr): New subst_attr.
(nf_nonf_x64_attr): Ditto.
(*sub<mode>_1<nf_name>): New define_insn.
(*anddi_1<nf_name>): Ditto.
(*and<mode>_1<nf_name>): Ditto.
(*andqi_1<nf_name>): Ditto.
(*<code><mode>_1<nf_name>): Ditto.
(*<code>qi_1<nf_name>): Ditto.
(*neg<mode>_1<nf_name>): Ditto.
* config/i386/sse.md: New define_split.

gcc/testsuite/ChangeLog:

* gcc.target/i386/apx-nf.c: New test.

4 months ago[APX NF] Support APX NF add
Lingling Kong [Mon, 3 Jun 2024 02:38:43 +0000 (10:38 +0800)]
[APX NF] Support APX NF add

APX NF(no flags) feature implements suppresses the update of status flags
for arithmetic operations.

For NF add, it is not clear whether nf add can be faster than lea. If so,
the pattern needs to be adjusted to perfer lea generation.

gcc/ChangeLog:

* config/i386/i386-opts.h (enum apx_features): Add nf
enumeration.
* config/i386/i386.h (TARGET_APX_NF): New.
* config/i386/i386.md (nf_name): New subst_att.
(nf_prefix): Ditto.
(nf_condition): Ditto.
(nf_mem_constraint): Ditto.
(nf_applied): Ditto.
(nf_subst): Add new define_subst.
(*add<mode>_1<nf_name>): New define_insn.
(*addhi_1<nf_name>): Ditto.
(*addqi_1<nf_name>): Diito.
* config/i386/i386.opt: Add apx_nf enumeration.

gcc/testsuite/ChangeLog:

* gcc.target/i386/apx-ndd.c: Fixed test.

Co-authored-by: Hongyu Wong <hongyu.wang@intel.com>
4 months agoi386: Optimize EQ/NE comparison between avx512 kmask and -1.
Hu, Lin1 [Thu, 9 May 2024 01:29:07 +0000 (09:29 +0800)]
i386: Optimize EQ/NE comparison between avx512 kmask and -1.

Acheive EQ/NE comparison between avx512 kmask and -1 by using kxortest
with checking CF.

gcc/ChangeLog:

PR target/113609
* config/i386/sse.md
(*kortest_cmp<mode>_setcc): New define_insn_and_split.
(*kortest_cmp<mode>_jcc): Ditto.

gcc/testsuite/ChangeLog:

PR target/113609
* gcc.target/i386/pr113609-1.c: New test.
* gcc.target/i386/pr113609-2.c: Ditto.

4 months agoDaily bump.
GCC Administrator [Mon, 3 Jun 2024 00:16:29 +0000 (00:16 +0000)]
Daily bump.

4 months agoFix PR c++/109958: ICE taking the address of bound static member function brought...
Simon Martin [Sun, 2 Jun 2024 15:45:04 +0000 (17:45 +0200)]
Fix PR c++/109958: ICE taking the address of bound static member function brought into derived class by using-declaration

We currently ICE upon the following because we don't properly handle the
overload created for B::f through the using statement.

=== cut here ===
struct B { static int f(); };
struct D : B { using B::f; };
void f(D d) { &d.f; }
=== cut here ===

This patch makes build_class_member_access_expr and cp_build_addr_expr_1 handle
such overloads, and fixes the PR.

Successfully tested on x86_64-pc-linux-gnu.

PR c++/109958

gcc/cp/ChangeLog:

* typeck.cc (build_class_member_access_expr): Handle single OVERLOADs.
(cp_build_addr_expr_1): Likewise.

gcc/testsuite/ChangeLog:

* g++.dg/overload/using6.C: New test.

4 months agolibstdc++: Move gcc.gnu.org links to https
Gerald Pfeifer [Sun, 2 Jun 2024 09:23:51 +0000 (11:23 +0200)]
libstdc++: Move gcc.gnu.org links to https

libstdc++-v3:
* doc/xml/api.xml: Move gcc.gnu.org links to https.
* doc/html/api.html: Regenerate.

4 months agoDaily bump.
GCC Administrator [Sun, 2 Jun 2024 00:17:09 +0000 (00:17 +0000)]
Daily bump.

4 months agoanalyzer: detect -Wanalyzer-allocation-size at call stmts [PR106203]
David Malcolm [Sat, 1 Jun 2024 17:50:32 +0000 (13:50 -0400)]
analyzer: detect -Wanalyzer-allocation-size at call stmts [PR106203]

gcc/analyzer/ChangeLog:
PR analyzer/106203
* checker-event.h: Include "analyzer/event-loc-info.h".
(struct event_loc_info): Move to its own header file.
* diagnostic-manager.cc
(diagnostic_manager::emit_saved_diagnostic): Move creation of
event_loc_info here from add_final_event, and if we have a
stmt_finder, call its update_event_loc_info method.
* engine.cc (leak_stmt_finder::update_event_loc_info): New.
(exploded_node::detect_leaks): Likewise.
(exploded_node::detect_leaks): Pass nullptr as call_stmt arg to
region_model::pop_frame.
* event-loc-info.h: New file, with content taken from
checker-event.h.
* exploded-graph.h (stmt_finder::update_event_loc_info): New pure
virtual function.
* infinite-loop.cc (infinite_loop_diagnostic::add_final_event):
Update for change to vfunc signature.
* infinite-recursion.cc
(infinite_recursion_diagnostic::add_final_event): Likewise.
* pending-diagnostic.cc (pending_diagnostic::add_final_event):
Pass in the event_loc_info from the caller, rather than generating
it from a gimple stmt and enode.
* pending-diagnostic.h (pending_diagnostic::add_final_event):
Likewise.
* region-model.cc (region_model::on_longjmp): Pass nullptr as
call_stmt arg to region_model::pop_frame.
(region_model::update_for_return_gcall): Likewise, but pass
call_stmt.
(class caller_context): New.
(region_model::pop_frame): Add "call_stmt" argument.  Use it
and the frame_region with a caller_context when setting
result_dst_reg's value so that any diagnostic is reported at the
call stmt in the caller.
(selftest::test_stack_frames): Pass nullptr as call_stmt arg to
region_model::pop_frame.
(selftest::test_alloca): Likewise.
* region-model.h (region_model::pop_frame): Add "call_stmt"
argument.

gcc/testsuite/ChangeLog:
PR analyzer/106203
* c-c++-common/analyzer/allocation-size-1.c (test_9): Remove
xfail.
* c-c++-common/analyzer/allocation-size-2.c (test_8): Likewise.
* gcc.dg/analyzer/allocation-size-multiline-4.c: New test.
* gcc.dg/plugin/analyzer_cpython_plugin.c
(refcnt_stmt_finder::update_event_loc_info): New.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
4 months agoAVR: target/115317 - Make isinf(-Inf) return -1.
Georg-Johann Lay [Sat, 1 Jun 2024 10:46:31 +0000 (12:46 +0200)]
AVR: target/115317 - Make isinf(-Inf) return -1.

PR target/115317
libgcc/config/avr/libf7/
* libf7-asm.sx (__isinf): Map -Inf to -1.

gcc/testsuite/
* gcc.target/avr/torture/pr115317-isinf.c: New test.

4 months agolibstdc++: Replace link to gcc-4.3.2 docs in manual [PR115269]
Jonathan Wakely [Wed, 29 May 2024 09:59:48 +0000 (10:59 +0100)]
libstdc++: Replace link to gcc-4.3.2 docs in manual [PR115269]

Link to the docs for GCC trunk instead. For the release branches, the
link should be to the docs for appropriate release branch.

Also replace the incomplete/outdated list of explicit -std options with
a single entry for the -std option.

libstdc++-v3/ChangeLog:

PR libstdc++/115269
* doc/xml/manual/using.xml: Replace link to gcc-4.3.2 docs.
Replace list of -std=... options with a single entry for -std.
* doc/html/manual/using.html: Regenerate.

4 months agoAVR: tree-optimization/115307 - Work around isinf bloat from early passes.
Georg-Johann Lay [Sat, 1 Jun 2024 08:38:00 +0000 (10:38 +0200)]
AVR: tree-optimization/115307 - Work around isinf bloat from early passes.

PR tree-optimization/115307
gcc/
* config/avr/avr.md (SFDF): New mode iterator.
(isinf<mode>2) [sf, df]: New expanders.

gcc/testsuite/
* gcc.target/avr/torture/pr115307-isinf.c: New test.

4 months ago[to-be-committed] [RISC-V] Use Zbkb for general 64 bit constants when profitable
Jeff Law [Sat, 1 Jun 2024 03:45:01 +0000 (21:45 -0600)]
[to-be-committed] [RISC-V] Use Zbkb for general 64 bit constants when profitable

Basically this adds the ability to generate two independent constants during
synthesis, then bring them together with a pack instruction. Thus we never need
to go out to the constant pool when zbkb is enabled. The worst sequence we ever
generate is

lui+addi+lui+addi+pack

Obviously if either half can be synthesized with just a lui or just an addi,
then we'll DTRT automagically.   So for example:

unsigned long foo_0xf857f2def857f2de(void) {
    return 0x1425000028000000;
}

The high and low halves are just a lui.  So the final synthesis is:

>         li      a5,671088640            # 15    [c=4 l=4]  *movdi_64bit/1
>         li      a0,337969152            # 16    [c=4 l=4]  *movdi_64bit/1
>         pack    a0,a5,a0        # 17    [c=12 l=4]  riscv_xpack_di_si_2

On the implementation side, I think the bits I've put in here likely can be
used to handle the repeating constant case for !zbkb.  I think it likely could
be used to help capture cases where the upper half can be derived from the
lower half (say by turning a bit on or off, shifting or something similar).
The key in both of these cases is we need a temporary register holding an
intermediate value.

Ventana's internal tester enables zbkb, but I don't think any of the other
testers currently exercise zbkb.  We'll probably want to change that at some
point, but I don't think it's super-critical yet.

While I can envision a few more cases where we could improve constant
synthesis,   No immediate plans to work in this space, but if someone is
interested, some thoughts are recorded here:

> https://wiki.riseproject.dev/display/HOME/CT_00_031+--+Additional+Constant+Synthesis+Improvements

gcc/
* config/riscv/riscv.cc (riscv_integer_op): Add new field.
(riscv_build_integer_1): Initialize the new field.
(riscv_built_integer): Recognize more cases where Zbkb's
pack instruction is profitable.
(riscv_move_integer): Loop over all the codes.  If requested,
save the current constant into a temporary.  Generate pack
for more cases using the saved constant.

gcc/testsuite

* gcc.target/riscv/synthesis-10.c: New test.

4 months agoc++/modules: Fix revealing with using-decls [PR114867]
Nathaniel Shead [Fri, 31 May 2024 15:14:44 +0000 (01:14 +1000)]
c++/modules: Fix revealing with using-decls [PR114867]

This patch fixes a couple issues with the current handling of revealing
declarations with using-decls.

Firstly, doing 'remove_node' when handling function overload sets is not
safe, because it not only mutates the OVERLOAD we're walking over but
potentially any other references to this OVERLOAD that are cached from
phase-1 template lookup.  This causes the attached using-17 testcase to
fail because the overload set in 'X::test()' no longer contains the
'ns::f(T)' template once instantiated at the end of the file.

This patch works around this by simply not removing the old declaration.
This does make the overload list potentially longer than it otherwise
would have been, but only when re-exporting the same set of functions in
a using-decl.  Additionally, because 'ovl_insert' always prepends these
newly inserted overloads, repeated exported using-decls won't continue
to add declarations, as the first exported using-decl will be found
before the original (unexported) declaration.

Another, related, issue is that using-decls of GMF entities currently
doesn't mark them as reachable unless they are also exported, and thus
they may not be available in e.g. module implementation units.  We solve
this with a new flag on OVERLOADs set when they are declared within the
module purview.  This starts to run into the more general issue of
handling using-decls of non-functions (see e.g. PR114863) but by just
marking such GMF entities as purview we can work around this for now.

This also allows us to get rid of the special-casing of exported
using-decls in 'add_binding_entity', which was incorrect anyway: a
non-exported using-decl still needs to be emitted anyway if it lives in
the module purview, even if referring to a non-purview item.

PR c++/114867

gcc/cp/ChangeLog:

* cp-tree.h (OVL_PURVIEW_P): New.
(ovl_iterator::purview_p): New.
* module.cc (depset::hash::add_binding_entity): Only ignore
entities not within module purview. Set OVL_PURVIEW_P on new
OVERLOADs for emitted declarations.
(module_state::read_cluster): Imported using-decls are always
in purview, mark as OVL_PURVIEW_P.
* name-lookup.h (enum WMB_Flags): New WMB_Purview flag.
* name-lookup.cc (walk_module_binding): Set WMB_Purview as
needed.
(do_nonmember_using_decl): Don't remove from existing OVERLOADs.
Also reveal non-exported decls. Also reveal 'extern "C"' decls.
Add workaround to reveal non-function decls.
* tree.cc (ovl_insert): Adjust to also set OVL_PURVIEW_P when
needed.

gcc/testsuite/ChangeLog:

* g++.dg/modules/using-17_a.C: New test.
* g++.dg/modules/using-17_b.C: New test.
* g++.dg/modules/using-18_a.C: New test.
* g++.dg/modules/using-18_b.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
4 months agovect: Bind input vectype to lane-reducing operation
Feng Xue [Wed, 29 May 2024 08:41:57 +0000 (16:41 +0800)]
vect: Bind input vectype to lane-reducing operation

The input vectype is an attribute of lane-reducing operation, instead of
reduction PHI that it is associated to, since there might be more than one
lane-reducing operations with different type in a loop reduction chain. So
bind each lane-reducing operation with its own input type.

2024-05-29 Feng Xue <fxue@os.amperecomputing.com>

gcc/
* tree-vect-loop.cc (vect_is_emulated_mixed_dot_prod): Remove parameter
loop_vinfo. Get input vectype from stmt_info instead of reduction PHI.
(vect_model_reduction_cost): Remove loop_vinfo argument of call to
vect_is_emulated_mixed_dot_prod.
(vect_transform_reduction): Likewise.
(vectorizable_reduction): Likewise, and bind input vectype to
lane-reducing operation.

4 months agovect: Split out partial vect checking for reduction into a function
Feng Xue [Wed, 29 May 2024 05:45:09 +0000 (13:45 +0800)]
vect: Split out partial vect checking for reduction into a function

Partial vectorization checking for vectorizable_reduction is a piece of
relatively isolated code, which may be reused by other places. Move the
code into a new function for sharing.

2024-05-29 Feng Xue <fxue@os.amperecomputing.com>

gcc/
* tree-vect-loop.cc (vect_reduction_update_partial_vector_usage): New
function.
(vectorizable_reduction): Move partial vectorization checking code to
vect_reduction_update_partial_vector_usage.

4 months agovect: Add a function to check lane-reducing code
Feng Xue [Wed, 29 May 2024 05:12:12 +0000 (13:12 +0800)]
vect: Add a function to check lane-reducing code

Check if an operation is lane-reducing requires comparison of code against
three kinds (DOT_PROD_EXPR/WIDEN_SUM_EXPR/SAD_EXPR).  Add an utility
function to make source coding for the check handy and concise.

2024-05-29 Feng Xue <fxue@os.amperecomputing.com>

gcc/
* tree-vectorizer.h (lane_reducing_op_p): New function.
* tree-vect-slp.cc (vect_analyze_slp): Use new function
lane_reducing_op_p to check statement code.
* tree-vect-loop.cc (vect_transform_reduction): Likewise.
(vectorizable_reduction): Likewise, and change name of a local
variable that holds the result flag.

4 months agoDaily bump.
GCC Administrator [Sat, 1 Jun 2024 00:17:20 +0000 (00:17 +0000)]
Daily bump.

4 months agoxtensa: Prepend "(use A0_REG)" to sibling call CALL_INSN_FUNCTION_USAGE instead of...
Takayuki 'January June' Suwa [Fri, 31 May 2024 10:24:48 +0000 (19:24 +0900)]
xtensa: Prepend "(use A0_REG)" to sibling call CALL_INSN_FUNCTION_USAGE instead of emitting it as insn at the end of epilogue

No functional changes.

gcc/ChangeLog:

* config/xtensa/xtensa-protos.h (xtensa_expand_call):
Add the third argument as boolean.
(xtensa_expand_epilogue): Remove the first argument.
* config/xtensa/xtensa.cc (xtensa_expand_call):
Add the third argument "sibcall_p", and modify in order to prepend
"(use A0_REG)" to CALL_INSN_FUNCTION_USAGE if the argument is true.
(xtensa_expand_epilogue): Remove the first argument "sibcall_p" and
its conditional clause.
* config/xtensa/xtensa.md (call, call_value, sibcall, sibcall_value):
Append a boolean value to the argument of xtensa_expand_call()
indicating whether it is sibling call or not.
(epilogue): Remove the boolean argument from xtensa_expand_epilogue(),
and then append emitting "(return)".
(sibcall_epilogue): Remove the boolean argument from
xtensa_expand_epilogue().

4 months agoxtensa: Simplify several MD templates
Takayuki 'January June' Suwa [Fri, 31 May 2024 10:23:13 +0000 (19:23 +0900)]
xtensa: Simplify several MD templates

No functional changes.

gcc/ChangeLog:

* config/xtensa/predicates.md
(subreg_HQI_lowpart_operator, xtensa_sminmax_operator):
New operator predicates.
* config/xtensa/xtensa-protos.h (xtensa_match_CLAMPS_imms_p):
Remove.
* config/xtensa/xtensa.cc (xtensa_match_CLAMPS_imms_p): Ditto.
* config/xtensa/xtensa.md
(*addsubx, *extzvsi-1bit_ashlsi3, *extzvsi-1bit_addsubx):
Revise the output statements by conditional ternary operator rather
than switch-case clause in order to avoid using gcc_unreachable().
(xtensa_clamps): Reduce to a single pattern definition using the
predicate added above.
(Some split patterns to assist *masktrue_const_bitcmpl): Ditto.

4 months agoRISC-V: Remove dead perm series code and document.
Robin Dapp [Fri, 17 May 2024 10:48:52 +0000 (12:48 +0200)]
RISC-V: Remove dead perm series code and document.

With the introduction of shuffle_series_patterns the explicit handler
code for a perm series is dead.  This patch removes it and also adds
a function-level comment to shuffle_series_patterns.

gcc/ChangeLog:

* config/riscv/riscv-v.cc (expand_const_vector): Document.
(shuffle_extract_and_slide1up_patterns): Remove.

4 months agoRISC-V: Add vector popcount, clz, ctz.
Robin Dapp [Wed, 15 May 2024 15:41:07 +0000 (17:41 +0200)]
RISC-V: Add vector popcount, clz, ctz.

This patch adds the zvbb vcpop, vclz and vctz to the autovec machinery
as well as tests for them.

gcc/ChangeLog:

* config/riscv/autovec.md (ctz<mode>2): New expander.
(clz<mode>2): Ditto.
* config/riscv/generic-vector-ooo.md: Add bitmanip ops to insn
reservation.
* config/riscv/vector-crypto.md: Add VLS modes to insns.
* config/riscv/vector.md: Add bitmanip ops to mode_idx and other
attributes.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/unop/popcount-1.c: Adjust check
for zvbb.
* gcc.target/riscv/rvv/autovec/unop/popcount-run-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/unop/popcount-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/unop/popcount-3.c: New test.
* gcc.target/riscv/rvv/autovec/unop/popcount-template.h: New test.
* gcc.target/riscv/rvv/autovec/unop/clz-1.c: New test.
* gcc.target/riscv/rvv/autovec/unop/clz-run.c: New test.
* gcc.target/riscv/rvv/autovec/unop/clz-template.h: New test.
* gcc.target/riscv/rvv/autovec/unop/ctz-1.c: New test.
* gcc.target/riscv/rvv/autovec/unop/ctz-run.c: New test.
* gcc.target/riscv/rvv/autovec/unop/ctz-template.h: New test.

4 months agoRISC-V: Add vandn combine helper.
Robin Dapp [Wed, 15 May 2024 13:01:35 +0000 (15:01 +0200)]
RISC-V: Add vandn combine helper.

This patch adds a combine pattern for vandn as well as tests for it.

gcc/ChangeLog:

* config/riscv/autovec-opt.md (*vandn_<mode>): New pattern.
* config/riscv/vector.md: Add vandn to mode_idx.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/binop/vandn-1.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vandn-run.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vandn-template.h: New test.

4 months agoRISC-V: Use widening shift for scatter/gather if applicable.
Robin Dapp [Fri, 10 May 2024 11:37:03 +0000 (13:37 +0200)]
RISC-V: Use widening shift for scatter/gather if applicable.

With the zvbb extension we can emit a widening shift for scatter/gather
index preparation in case we need to multiply by 2 and zero extend.

The patch also adds vwsll to the mode_idx attribute and removes the
mode from shift-count operand of the insn pattern.

gcc/ChangeLog:

* config/riscv/riscv-v.cc (expand_gather_scatter): Use vwsll if
applicable.
* config/riscv/vector-crypto.md: Remove mode from vwsll shift
count operator.
* config/riscv/vector.md: Add vwsll to mode iterator.

gcc/testsuite/ChangeLog:

* lib/target-supports.exp: Add zvbb.
* gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_64-12-zvbb.c: New test.

4 months agoRISC-V: Add vwsll combine helpers.
Robin Dapp [Mon, 13 May 2024 20:09:35 +0000 (22:09 +0200)]
RISC-V: Add vwsll combine helpers.

This patch enables the usage of vwsll in autovec context by adding the
necessary combine patterns and tests.

gcc/ChangeLog:

* config/riscv/autovec-opt.md (*vwsll_zext1_<mode>): New
pattern.
(*vwsll_zext2_<mode>): Ditto.
(*vwsll_zext1_scalar_<mode>): Ditto.
(*vwsll_zext1_trunc_<mode>): Ditto.
(*vwsll_zext2_trunc_<mode>): Ditto.
(*vwsll_zext1_trunc_scalar_<mode>): Ditto.
* config/riscv/vector-crypto.md: Make pattern similar to other
narrowing/widening patterns.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/binop/vwsll-1.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vwsll-run.c: New test.
* gcc.target/riscv/rvv/autovec/binop/vwsll-template.h: New test.

4 months agoRISC-V: Split vwadd.wx and vwsub.wx and add helpers.
Robin Dapp [Thu, 16 May 2024 10:43:43 +0000 (12:43 +0200)]
RISC-V: Split vwadd.wx and vwsub.wx and add helpers.

vwadd.wx and vwsub.wx have the same problem vfwadd.wf had.  This patch
splits the insn pattern in the same way vfwadd.wf was split.

It also adds two patterns to recognize extended scalars.  In practice
those do not provide a lot of improvement over what we already have but
in some instances we can get rid of redundant extensions.

gcc/ChangeLog:

* config/riscv/vector.md: Split vwadd.wx/vwsub.wx pattern and
add extended_scalar patterns.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/base/pr115068.c: Add vwadd.wx/vwsub.wx
tests.
* gcc.target/riscv/rvv/base/pr115068-run.c: Include pr115068.c.
* gcc.target/riscv/rvv/base/vwaddsub-1.c: New test.

4 months agoRISC-V: Do not allow v0 as dest when merging [PR115068].
Robin Dapp [Mon, 13 May 2024 11:49:57 +0000 (13:49 +0200)]
RISC-V: Do not allow v0 as dest when merging [PR115068].

This patch splits the vfw...wf pattern so we do not emit e.g. vfwadd.wf
v0,v8,fa5,v0.t anymore.

gcc/ChangeLog:

PR target/115068

* config/riscv/vector.md:  Split vfw<insn>.wf pattern.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/base/pr115068-run.c: New test.
* gcc.target/riscv/rvv/base/pr115068.c: New test.

4 months agoaarch64: testsuite: Explicitly add -mlittle-endian to vget_low_2.c
Pengxuan Zheng [Thu, 23 May 2024 00:38:43 +0000 (17:38 -0700)]
aarch64: testsuite: Explicitly add -mlittle-endian to vget_low_2.c

vget_low_2.c is a test case for little-endian, but we missed the -mlittle-endian
flag in r15-697-ga2e4fe5a53cf75.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/vget_low_2.c: Add -mlittle-endian.

Signed-off-by: Pengxuan Zheng <quic_pzheng@quicinc.com>
4 months agoMAINTAINERS: Add myself to Write After Approval and DCO
Pengxuan Zheng [Fri, 31 May 2024 18:07:05 +0000 (11:07 -0700)]
MAINTAINERS: Add myself to Write After Approval and DCO

ChangeLog:

* MAINTAINERS: Add myself to Write After Approval and DCO.

Signed-off-by: Pengxuan Zheng <quic_pzheng@quicinc.com>
4 months agoAdd the 6th argument to .ACCESS_WITH_SIZE
Qing Zhao [Tue, 28 May 2024 18:39:31 +0000 (18:39 +0000)]
Add the 6th argument to .ACCESS_WITH_SIZE

to carry the TYPE of the flexible array.

Such information is needed during tree-object-size.cc.

We cannot use the result type or the type of the 1st argument
of the routine .ACCESS_WITH_SIZE to decide the element type
of the original array due to possible type casting in the
source code.

gcc/c/ChangeLog:

* c-typeck.cc (build_access_with_size_for_counted_by): Add the 6th
argument to .ACCESS_WITH_SIZE.

gcc/ChangeLog:

* tree-object-size.cc (access_with_size_object_size): Use the type
of the 6th argument for the type of the element.
* internal-fn.cc (expand_ACCESS_WITH_SIZE): Update the comment with
the 6th argument.

gcc/testsuite/ChangeLog:

* gcc.dg/flex-array-counted-by-6.c: New test.

4 months agoUse the .ACCESS_WITH_SIZE in bound sanitizer.
Qing Zhao [Tue, 28 May 2024 18:37:14 +0000 (18:37 +0000)]
Use the .ACCESS_WITH_SIZE in bound sanitizer.

gcc/c-family/ChangeLog:

* c-ubsan.cc (get_bound_from_access_with_size): New function.
(ubsan_instrument_bounds): Handle call to .ACCESS_WITH_SIZE.

gcc/testsuite/ChangeLog:

* gcc.dg/ubsan/flex-array-counted-by-bounds-2.c: New test.
* gcc.dg/ubsan/flex-array-counted-by-bounds-3.c: New test.
* gcc.dg/ubsan/flex-array-counted-by-bounds-4.c: New test.
* gcc.dg/ubsan/flex-array-counted-by-bounds.c: New test.

4 months agoUse the .ACCESS_WITH_SIZE in builtin object size.
Qing Zhao [Tue, 28 May 2024 18:36:00 +0000 (18:36 +0000)]
Use the .ACCESS_WITH_SIZE in builtin object size.

gcc/ChangeLog:

* tree-object-size.cc (access_with_size_object_size): New function.
(call_object_size): Call the new function.

gcc/testsuite/ChangeLog:

* gcc.dg/builtin-object-size-common.h: Add a new macro EXPECT.
* gcc.dg/flex-array-counted-by-3.c: New test.
* gcc.dg/flex-array-counted-by-4.c: New test.
* gcc.dg/flex-array-counted-by-5.c: New test.

4 months agoConvert references with "counted_by" attributes to/from .ACCESS_WITH_SIZE.
Qing Zhao [Tue, 28 May 2024 18:34:09 +0000 (18:34 +0000)]
Convert references with "counted_by" attributes to/from .ACCESS_WITH_SIZE.

Including the following changes:
* The definition of the new internal function .ACCESS_WITH_SIZE
  in internal-fn.def.
* C FE converts every reference to a FAM with a "counted_by" attribute
  to a call to the internal function .ACCESS_WITH_SIZE.
  (build_component_ref in c_typeck.cc)

  This includes the case when the object is statically allocated and
  initialized.
  In order to make this working, the routine digest_init in c-typeck.cc
  is updated to fold calls to .ACCESS_WITH_SIZE to its first argument
  when require_constant is TRUE.

  However, for the reference inside "offsetof", the "counted_by" attribute is
  ignored since it's not useful at all.
  (c_parser_postfix_expression in c/c-parser.cc)

  In addtion to "offsetof", for the reference inside operator "typeof" and
  "alignof", we ignore counted_by attribute too.

  When building ADDR_EXPR for the .ACCESS_WITH_SIZE in C FE,
  replace the call with its first argument.

* Convert every call to .ACCESS_WITH_SIZE to its first argument.
  (expand_ACCESS_WITH_SIZE in internal-fn.cc)
* Provide the utility routines to check the call is .ACCESS_WITH_SIZE and
  get the reference from the call to .ACCESS_WITH_SIZE.
  (is_access_with_size_p and get_ref_from_access_with_size in tree.cc)

gcc/c/ChangeLog:

* c-parser.cc (c_parser_postfix_expression): Ignore the counted-by
attribute when build_component_ref inside offsetof operator.
* c-tree.h (build_component_ref): Add one more parameter.
* c-typeck.cc (build_counted_by_ref): New function.
(build_access_with_size_for_counted_by): New function.
(build_component_ref): Check the counted-by attribute and build
call to .ACCESS_WITH_SIZE.
(build_unary_op): When building ADDR_EXPR for
.ACCESS_WITH_SIZE, use its first argument.
(lvalue_p): Accept call to .ACCESS_WITH_SIZE.
(digest_init): Fold call to .ACCESS_WITH_SIZE to its first
argument when require_constant is TRUE.

gcc/ChangeLog:

* internal-fn.cc (expand_ACCESS_WITH_SIZE): New function.
* internal-fn.def (ACCESS_WITH_SIZE): New internal function.
* tree.cc (is_access_with_size_p): New function.
(get_ref_from_access_with_size): New function.
* tree.h (is_access_with_size_p): New prototype.
(get_ref_from_access_with_size): New prototype.

gcc/testsuite/ChangeLog:

* gcc.dg/flex-array-counted-by-2.c: New test.

4 months agoProvide counted_by attribute to flexible array member field
Qing Zhao [Tue, 28 May 2024 18:30:05 +0000 (18:30 +0000)]
Provide counted_by attribute to flexible array member field

'counted_by (COUNT)'
     The 'counted_by' attribute may be attached to the C99 flexible
     array member of a structure.  It indicates that the number of the
     elements of the array is given by the field "COUNT" in the
     same structure as the flexible array member.
     GCC may use this information to improve detection of object size information
     for such structures and provide better results in compile-time diagnostics
     and runtime features like the array bound sanitizer and
     the '__builtin_dynamic_object_size'.

     For instance, the following code:

          struct P {
            size_t count;
            char other;
            char array[] __attribute__ ((counted_by (count)));
          } *p;

     specifies that the 'array' is a flexible array member whose number
     of elements is given by the field 'count' in the same structure.

     The field that represents the number of the elements should have an
     integer type.  Otherwise, the compiler reports an error and
     ignores the attribute.

     When the field that represents the number of the elements is assigned a
     negative integer value, the compiler treats the value as zero.

     An explicit 'counted_by' annotation defines a relationship between
     two objects, 'p->array' and 'p->count', and there are the following
     requirementthat on the relationship between this pair:

        * 'p->count' must be initialized before the first reference to
          'p->array';

        * 'p->array' has _at least_ 'p->count' number of elements
          available all the time.  This relationship must hold even
          after any of these related objects are updated during the
          program.

     It's the user's responsibility to make sure the above requirements
     to be kept all the time.  Otherwise the compiler reports
     warnings, at the same time, the results of the array bound
     sanitizer and the '__builtin_dynamic_object_size' is undefined.

     One important feature of the attribute is, a reference to the
     flexible array member field uses the latest value assigned to
     the field that represents the number of the elements before that
     reference.  For example,

            p->count = val1;
            p->array[20] = 0;  // ref1 to p->array
            p->count = val2;
            p->array[30] = 0;  // ref2 to p->array

     in the above, 'ref1' uses 'val1' as the number of the elements
     in 'p->array', and 'ref2' uses 'val2' as the number of elements
     in 'p->array'.

gcc/c-family/ChangeLog:

* c-attribs.cc (handle_counted_by_attribute): New function.
(attribute_takes_identifier_p): Add counted_by attribute to the list.
* c-common.cc (c_flexible_array_member_type_p): ...To this.
* c-common.h (c_flexible_array_member_type_p): New prototype.

gcc/c/ChangeLog:

* c-decl.cc (flexible_array_member_type_p): Renamed and moved to...
(add_flexible_array_elts_to_size): Use renamed function.
(is_flexible_array_member_p): Use renamed function.
(verify_counted_by_attribute): New function.
(finish_struct): Use renamed function and verify counted_by
attribute.
* c-tree.h (lookup_field): New prototype.
* c-typeck.cc (lookup_field): Expose as extern function.
(tagged_types_tu_compatible_p): Check counted_by attribute for
structure type.

gcc/ChangeLog:

* doc/extend.texi: Document attribute counted_by.

gcc/testsuite/ChangeLog:

* gcc.dg/flex-array-counted-by.c: New test.
* gcc.dg/flex-array-counted-by-7.c: New test.
* gcc.dg/flex-array-counted-by-8.c: New test.

4 months agoalpha: Fix invalid RTX in divmodsi insn patterns [PR115297]
Uros Bizjak [Fri, 31 May 2024 13:52:03 +0000 (15:52 +0200)]
alpha: Fix invalid RTX in divmodsi insn patterns [PR115297]

any_divmod instructions are modelled with invalid RTX:

  [(set (match_operand:DI 0 "register_operand" "=c")
        (sign_extend:DI (match_operator:SI 3 "divmod_operator"
                        [(match_operand:DI 1 "register_operand" "a")
                         (match_operand:DI 2 "register_operand" "b")])))
   (clobber (reg:DI 23))
   (clobber (reg:DI 28))]

where SImode divmod_operator (div,mod,udiv,umod) has DImode operands.

Wrap input operand with truncate:SI to make machine modes consistent.

PR target/115297

gcc/ChangeLog:

* config/alpha/alpha.md (<any_divmod:code>si3): Wrap DImode
operands 3 and 4 with truncate:SI RTX.
(*divmodsi_internal_er): Ditto for operands 1 and 2.
(*divmodsi_internal_er_1): Ditto.
(*divmodsi_internal): Ditto.
* config/alpha/constraints.md ("b"): Correct register
number in the description.

gcc/testsuite/ChangeLog:

* gcc.target/alpha/pr115297.c: New test.

4 months agonvptx target: Global constructor, destructor support, via nvptx-tools 'ld'
Thomas Schwinge [Tue, 28 May 2024 21:20:29 +0000 (23:20 +0200)]
nvptx target: Global constructor, destructor support, via nvptx-tools 'ld'

The function attributes 'constructor', 'destructor', and 'init_priority' now
work, as do the C++ features making use of this.  Test cases with effective
target 'global_constructor' and 'init_priority' now generally work, and
'check-gcc-c++' test results greatly improve; no more
"sorry, unimplemented: global constructors not supported on this target".

For proper execution test results, this depends on
<https://github.com/SourceryTools/nvptx-tools/commit/96f8fc59a757767b9e98157d95c21e9fef22a93b>
"ld: Global constructor/destructor support".

gcc/
* config/nvptx/nvptx.h: Configure global constructor, destructor
support.
gcc/testsuite/
* gcc.dg/no_profile_instrument_function-attr-1.c: GCC/nvptx is
'NO_DOT_IN_LABEL' but not 'NO_DOLLAR_IN_LABEL', so '$' may apper
in identifiers.
* lib/target-supports.exp
(check_effective_target_global_constructor): Enable for nvptx.
libgcc/
* config/nvptx/crt0.c (__gbl_ctors): New weak function.
(__main): Invoke it.
* config/nvptx/gbl-ctors.c: New.
* config/nvptx/t-nvptx: Configure global constructor, destructor
support.

4 months agotree-optimization/115278 - fix DSE in if-conversion wrt volatiles
Richard Biener [Fri, 31 May 2024 08:14:25 +0000 (10:14 +0200)]
tree-optimization/115278 - fix DSE in if-conversion wrt volatiles

The following adds the missing guard for volatile stores to the
embedded DSE in the loop if-conversion pass.

PR tree-optimization/115278
* tree-if-conv.cc (ifcvt_local_dce): Do not DSE volatile stores.

* g++.dg/vect/pr115278.cc: New testcase.

4 months agofix: valid compiler optimization may fail the test
Marc Poulhiès [Thu, 23 May 2024 09:57:54 +0000 (11:57 +0200)]
fix: valid compiler optimization may fail the test

cxa4001 may fail with "Exception not raised" when the compiler omits the
calls to To_Mapping, in accordance with 10.2.1(18/3):

  "If a library unit is declared pure, then the implementation is
  permitted to omit a call on a library-level subprogram of the library
  unit if the results are not needed after the call"

Using the result of both To_Mapping calls prevents the compiler from
omitting them.

"The corrected test will be available on the ACAA web site
(http://www.ada-auth.org/), and will be issued with the Modified Tests List
version 2.6K, 3.1DD, and 4.1GG."

gcc/testsuite/ChangeLog:

* ada/acats/tests/cxa/cxa4001.a: Use function result.

4 months agobuild: Include minor version in config.gcc unsupported message
Rainer Orth [Fri, 31 May 2024 09:29:19 +0000 (11:29 +0200)]
build: Include minor version in config.gcc unsupported message

It has been pointed out to me that when moving Solaris 11.3 from
config.gcc's obsolete to unsupported list, I'd forgotten to also move
the minor version info, leading to confusing

*** Configuration i386-pc-solaris2.11 not supported

instead of the correct

*** Configuration i386-pc-solaris2.11.3 not supported

This patch fixes this oversight.

Tested on i386-pc-solaris2.11 (11.3 and 11.4).

2024-05-30  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc:
* config.gcc: Move ${target_min} from obsolete to unsupported
message.

4 months agoFix some opindex for some options [PR115022]
Andrew Pinski [Thu, 30 May 2024 03:40:31 +0000 (20:40 -0700)]
Fix some opindex for some options [PR115022]

While looking at the index I noticed that some options had
`-` in the front for the index which is wrong. And then
I noticed there was no index for `mcmodel=` for targets or had
used `-mcmodel` incorrectly.

This fixes both of those and regnerates the urls files see that
`-mcmodel=` option now has an url associated with it.

gcc/ChangeLog:

PR target/115022
* doc/invoke.texi (fstrub=disable): Fix opindex.
(minline-memops-threshold): Fix opindex.
(mcmodel=): Add opindex and fix them.
* common.opt.urls: Regenerate.
* config/aarch64/aarch64.opt.urls: Regenerate.
* config/bpf/bpf.opt.urls: Regenerate.
* config/i386/i386.opt.urls: Regenerate.
* config/loongarch/loongarch.opt.urls: Regenerate.
* config/nds32/nds32-elf.opt.urls: Regenerate.
* config/nds32/nds32-linux.opt.urls: Regenerate.
* config/or1k/or1k.opt.urls: Regenerate.
* config/riscv/riscv.opt.urls: Regenerate.
* config/rs6000/aix64.opt.urls: Regenerate.
* config/rs6000/linux64.opt.urls: Regenerate.
* config/sparc/sparc.opt.urls: Regenerate.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
4 months agotestsuite: Adjust several dg-additional-files-options calls [PR115294]
Rainer Orth [Fri, 31 May 2024 07:29:38 +0000 (09:29 +0200)]
testsuite: Adjust several dg-additional-files-options calls [PR115294]

A recent patch

commit bdc264a16e327c63d133131a695a202fbbc0a6a0
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu May 30 02:06:48 2024 -0300

    [testsuite] conditionalize dg-additional-sources on target and type

added two additional args to dg-additional-files-options.
Unfortunately, this completely broke several testsuites like

ERROR: tcl error sourcing /vol/gcc/src/hg/master/local/libatomic/testsuite/../../gcc/testsuite/lib/gcc-dg.exp.
wrong # args: should be "dg-additional-files-options options source dest type"

since the patch forgot to adjust some of the callers.

This patch fixes that.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
x86_64-pc-linux-gnu.

2024-05-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

libatomic:
PR testsuite/115294
* testsuite/lib/libatomic.exp (libatomic_target_compile): Pass new
dg-additional-files-options args.

libgomp:
PR testsuite/115294
* testsuite/lib/libgomp.exp (libgomp_target_compile): Pass new
dg-additional-files-options args.

libitm:
PR testsuite/115294
* testsuite/lib/libitm.exp (libitm_target_compile): Pass new
dg-additional-files-options args.

libphobos:
PR testsuite/115294
* testsuite/lib/libphobos.exp (libphobos_target_compile): Pass new
dg-additional-files-options args.

libvtv:
PR testsuite/115294
* testsuite/lib/libvtv.exp (libvtv_target_compile): Pass new
dg-additional-files-options args.

4 months agoxtensa: Use epilogue_completed rather than cfun->machine->epilogue_done
Takayuki 'January June' Suwa [Thu, 30 May 2024 13:32:24 +0000 (22:32 +0900)]
xtensa: Use epilogue_completed rather than cfun->machine->epilogue_done

In commit ad89d820bf, an "epilogue_done" member was added to the
machine_function structure, but it is sufficient to use the existing
"epilogue_completed" global variable.

gcc/ChangeLog:

* config/xtensa/xtensa-protos.h
(xtensa_use_return_instruction_p): Remove.
* config/xtensa/xtensa.cc
(machine_function): Remove "epilogue_done" field.
(xtensa_expand_epilogue): Remove "cfun->machine->epilogue_done" usage.
(xtensa_use_return_instruction_p): Remove.
* config/xtensa/xtensa.md ("return"):
Replace calling "xtensa_use_return_instruction_p()" with inline code.

4 months agoxtensa: Use REG_P(), MEM_P(), etc. instead of comparing GET_CODE()
Takayuki 'January June' Suwa [Thu, 30 May 2024 13:32:24 +0000 (22:32 +0900)]
xtensa: Use REG_P(), MEM_P(), etc. instead of comparing GET_CODE()

Instead of comparing directly, this patch replaces as much as possible with
macros that determine RTX code such as REG_P(), SUBREG_P() or MEM_P(), etc.

gcc/ChangeLog:

* config/xtensa/xtensa.cc (xtensa_valid_move, constantpool_address_p,
xtensa_tls_symbol_p, gen_int_relational, xtensa_emit_move_sequence,
xtensa_copy_incoming_a7, xtensa_expand_block_move,
xtensa_expand_nonlocal_goto, xtensa_emit_call,
xtensa_legitimate_address_p, xtensa_legitimize_address,
xtensa_tls_referenced_p, print_operand, print_operand_address,
xtensa_output_literal):
Replace RTX code comparisons with their predicate macros such as
REG_P().
* config/xtensa/xtensa.h (CONSTANT_ADDRESS_P,
LEGITIMATE_PIC_OPERAND_P): Ditto.
* config/xtensa/xtensa.md (reload<mode>_literal, indirect_jump):
Ditto.

4 months agoC23: allow aliasing for types derived from structs with variable size
Martin Uecker [Fri, 24 May 2024 10:35:27 +0000 (12:35 +0200)]
C23: allow aliasing for types derived from structs with variable size

Previously, we set the aliasing set of structures with variable size

struct foo { int x[n]; char b; };

to zero. The reason is that such types can be compatible to diffrent
structure types which are incompatible.

struct foo { int x[2]; char b; };
struct foo { int x[3]; char b; };

But it is not enough to set the aliasing set to zero, because derived
types would then still end up in different equivalence classes even
though they might be compatible.  Instead those types should be set
to structural equivalency.  We also add checking assertions that
ensure that TYPE_CANONICAL is set correctly for all tagged types.

gcc/c/
* c-decl.cc (finish_struct): Do not set TYPE_CANONICAL for
structure or unions with variable size.
* c-objc-common.cc (c_get_alias_set): Do not set alias set to zero.
* c-typeck.cc (comptypes_verify): New function.
(comptypes,comptypes_same_p,comptypes_check_enum_int): Add assertion.
(comptypes_equiv_p): Add assertion that ensures that compatible
types have the same equivalence class.
(tagged_types_tu_compatible_p): Remove now unneeded special case.

gcc/testsuite/
* gcc.dg/gnu23-tag-alias-8.c: New test.

4 months agoC: allow aliasing of compatible types derived from enumeral types [PR115157]
Martin Uecker [Sun, 19 May 2024 21:13:22 +0000 (23:13 +0200)]
C: allow aliasing of compatible types derived from enumeral types [PR115157]

Aliasing of enumeral types with the underlying integer is now allowed
by setting the aliasing set to zero.  But this does not allow aliasing
of derived types which are compatible as required by ISO C.  Instead,
initially set structural equality.  Then set TYPE_CANONICAL and update
pointers and main variants when the type is completed (as done for
structures and unions in C23).

PR tree-optimization/115157
PR tree-optimization/115177

gcc/c/
* c-decl.cc (shadow_tag-warned,parse_xref_tag,start_enum,
finish_enum): Set SET_TYPE_STRUCTURAL_EQUALITY / TYPE_CANONICAL.
* c-objc-common.cc (get_alias_set): Remove special case.
(get_aka_type): Add special case.

gcc/c-family/
* c-attribs.cc (handle_hardbool_attribute): Set TYPE_CANONICAL
for hardbools.

gcc/
* godump.cc (go_output_typedef): Use TYPE_MAIN_VARIANT instead
of TYPE_CANONICAL.

gcc/testsuite/
* gcc.dg/enum-alias-1.c: New test.
* gcc.dg/enum-alias-2.c: New test.
* gcc.dg/enum-alias-3.c: New test.
* gcc.dg/enum-alias-4.c: New test.

4 months agoRename double_u with __double_u to avoid pulluting the namespace.
liuhongt [Thu, 30 May 2024 06:15:48 +0000 (14:15 +0800)]
Rename double_u with __double_u to avoid pulluting the namespace.

gcc/ChangeLog:

* config/i386/emmintrin.h (__double_u): Rename from double_u.
(_mm_load_sd): Replace double_u with __double_u.
(_mm_store_sd): Ditto.
(_mm_loadh_pd): Ditto.
(_mm_loadl_pd): Ditto.
* config/i386/xmmintrin.h (__float_u): Rename from float_u.
(_mm_load_ss): Ditto.
(_mm_store_ss): Ditto.

4 months agoDaily bump.
GCC Administrator [Fri, 31 May 2024 00:17:38 +0000 (00:17 +0000)]
Daily bump.

4 months agoi386: Rewrite bswaphi2 handling [PR115102]
Uros Bizjak [Thu, 30 May 2024 19:27:42 +0000 (21:27 +0200)]
i386: Rewrite bswaphi2 handling [PR115102]

Introduce *bswaphi2 instruction pattern and enable bswaphi2 expander
also for non-movbe targets.  The testcase:

unsigned short bswap8 (unsigned short val)
{
  return ((val & 0xff00) >> 8) | ((val & 0xff) << 8);
}

now expands through bswaphi2 named expander.

Rewrite bswaphi_lowpart insn pattern as bswaphisi2_lowpart in the RTX form
that combine pass can use to simplify:

Trying 6, 9, 8 -> 10:
    6: r99:SI=bswap(r103:SI)
    9: {r107:SI=r103:SI&0xffffffffffff0000;clobber flags:CC;}
      REG_DEAD r103:SI
      REG_UNUSED flags:CC
    8: {r106:SI=r99:SI 0>>0x10;clobber flags:CC;}
      REG_DEAD r99:SI
      REG_UNUSED flags:CC
   10: {r104:SI=r106:SI|r107:SI;clobber flags:CC;}
      REG_DEAD r107:SI
      REG_DEAD r106:SI
      REG_UNUSED flags:CC

Successfully matched this instruction:
(set (reg:SI 104 [ _8 ])
    (ior:SI (and:SI (reg/v:SI 103 [ val ])
            (const_int -65536 [0xffffffffffff0000]))
        (lshiftrt:SI (bswap:SI (reg/v:SI 103 [ val ]))
            (const_int 16 [0x10]))))
allowing combination of insns 6, 8, 9 and 10

when compiling the following testcase:

unsigned int bswap8 (unsigned int val)
{
  return (val & 0xffff0000) | ((val & 0xff00) >> 8) | ((val & 0xff) << 8);
}

to produce:

movl    %edi, %eax
xchgb   %ah, %al
ret

The expansion now always goes through a clobberless form of the bswaphi
instruction.  The instruction is conditionally converted to a rotate at
peephole2 pass.  This significantly simplifies bswaphisi2_lowpart
insn pattern attributes.

PR target/115102

gcc/ChangeLog:

* config/i386/i386.md (bswaphi2): Also enable for !TARGET_MOVBE.
(*bswaphi2): New insn pattern.
(bswaphisi2_lowpart): Rename from bswaphi_lowpart.  Rewrite
insn RTX to match the expected form of the combine pass.
Remove rol{w} alternative and corresponding attributes.
(bswsaphisi2_lowpart peephole2): New peephole2 pattern to
conditionally convert bswaphisi2_lowpart to rotlhi3_1_slp.
(bswapsi2): Update expander for rename.
(rotlhi3_1_slp splitter): Conditionally split to bswaphi2.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr115102.c: New test.

4 months agoira: Fix go_through_subreg offset calculation [PR115281]
Richard Sandiford [Thu, 30 May 2024 15:17:58 +0000 (16:17 +0100)]
ira: Fix go_through_subreg offset calculation [PR115281]

go_through_subreg used:

  else if (!can_div_trunc_p (SUBREG_BYTE (x),
     REGMODE_NATURAL_SIZE (GET_MODE (x)), offset))

to calculate the register offset for a pseudo subreg x.  In the blessed
days before poly-int, this was:

    *offset = (SUBREG_BYTE (x) / REGMODE_NATURAL_SIZE (GET_MODE (x)));

But I think this is testing the wrong natural size.  If we exclude
paradoxical subregs (which will get an offset of zero regardless),
it's the inner register that is being split, so it should be the
inner register's natural size that we use.

This matters in the testcase because we have an SFmode lowpart
subreg into the last of three variable-sized vectors.  The
SUBREG_BYTE is therefore equal to the size of two variable-sized
vectors.  Dividing by the vector size gives a register offset of 2,
as expected, but dividing by the size of a scalar FPR would give
a variable offset.

I think something similar could happen for fixed-size targets if
REGMODE_NATURAL_SIZE is different for vectors and integers (say),
although that case would trade an ICE for an incorrect offset.

gcc/
PR rtl-optimization/115281
* ira-conflicts.cc (go_through_subreg): Use the natural size of
the inner mode rather than the outer mode.

gcc/testsuite/
PR rtl-optimization/115281
* gfortran.dg/pr115281.f90: New test.

4 months agoaarch64, middle-end: Move pair_fusion pass from aarch64 to middle-end
Ajit Kumar Agarwal [Thu, 30 May 2024 12:21:37 +0000 (07:21 -0500)]
aarch64, middle-end: Move pair_fusion pass from aarch64 to middle-end

Move pair fusion pass from aarch64-ldp-fusion.cc to middle-end
to support multiple targets.

Common infrastructure of load store pair fusion is divided into
target independent and target dependent code.

Target independent code is structured in the following files.
gcc/pair-fusion.h
gcc/pair-fusion.cc

Target independent code is the Generic code with pure virtual
function to interface betwwen target independent and dependent
code.

2024-05-30  Ajit Kumar Agarwal  <aagarwa1@linux.ibm.com>

gcc/ChangeLog:

* pair-fusion.h: Generic header code for load store pair fusion
that can be shared across different architectures.
* pair-fusion.cc: Generic source code implementation for
load store pair fusion that can be shared across different architectures.
* Makefile.in: Add new object file pair-fusion.o.
* config/aarch64/aarch64-ldp-fusion.cc: Delete generic code and move it
to pair-fusion.cc in the middle-end.
* config/aarch64/t-aarch64: Add header file dependency on pair-fusion.h.
Remove unnecessary header file dependency.

4 months agoggc: Reduce GGC_QUIRE_SIZE on Solaris/SPARC [PR115031]
Rainer Orth [Thu, 30 May 2024 13:00:59 +0000 (15:00 +0200)]
ggc: Reduce GGC_QUIRE_SIZE on Solaris/SPARC [PR115031]

g++.dg/modules/pr99023_b.X currently FAILs on 32-bit Solaris/SPARC:

FAIL: g++.dg/modules/pr99023_b.X -std=c++2a  1 blank line(s) in output
FAIL: g++.dg/modules/pr99023_b.X -std=c++2a (test for excess errors)

Excess errors:
cc1plus: out of memory allocating 1048344 bytes after a total of 7913472 bytes

It turns out that this exhaustion of the 32-bit address space happens
due to a combination of three issues:

* the SPARC pagesize of 8 kB,

* ggc-page.cc's chunk size of 512 * pagesize, i.e. 4 MB, and

* mmap adding two 8 kB unmapped red-zone pages to each mapping

which result in the 4 MB mappings to actually consume 4.5 MB of address
space.

To avoid this, this patch reduces the chunk size so it remains at 4 MB
even when combined with the red-zone pages, as recommended by mmap(2).

Tested on sparc-sun-solaris2.11 and sparcv9-sun-solaris2.11.

2024-05-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc:
PR c++/115031
* config/sparc/sol2.h (GGC_QUIRE_SIZE): Define as 510.

4 months agoanalyzer: fix a -Wunused-parameter
David Malcolm [Thu, 30 May 2024 12:42:01 +0000 (08:42 -0400)]
analyzer: fix a -Wunused-parameter

gcc/analyzer/ChangeLog:
* infinite-loop.cc (looping_back_event::get_desc): Fix unused
parameter warning introduced by me in r15-636-g770657d02c986c.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
4 months agoAdd new text_art::tree_widget and use it in analyzer
David Malcolm [Thu, 30 May 2024 12:42:00 +0000 (08:42 -0400)]
Add new text_art::tree_widget and use it in analyzer

This patch adds a new text_art::tree_widget, which makes it easy
to generate hierarchical visualizations using either ASCII:

  +- Child 0
  |  +- Grandchild 0 0
  |  +- Grandchild 0 1
  |  `- Grandchild 0 2
  +- Child 1
  |  +- Grandchild 1 0
  |  +- Grandchild 1 1
  |  `- Grandchild 1 2
  `- Child 2
     +- Grandchild 2 0
     +- Grandchild 2 1
     `- Grandchild 2 2

or Unicode:

  Root
  ├─ Child 0
  │  ├─ Grandchild 0 0
  │  ├─ Grandchild 0 1
  │  ╰─ Grandchild 0 2
  ├─ Child 1
  │  ├─ Grandchild 1 0
  │  ├─ Grandchild 1 1
  │  ╰─ Grandchild 1 2
  ╰─ Child 2
     ├─ Grandchild 2 0
     ├─ Grandchild 2 1
     ╰─ Grandchild 2 2

potentially with colorization of the connecting lines.

It adds a new template for typename T:

  void text_art::dump<T> (const T&);

for using this to dump any object to stderr that supports a
make_dump_widget method, with similar templates for dumping to
a pretty_printer * and a FILE *.

It uses this within the analyzer to add two new families of dumping
methods: one for program states, e.g.:

(gdb) call state->dump()
State
├─ Region Model
│  ├─ Current Frame: frame: ‘calls_malloc’@2
│  ├─ Store
│  │  ├─ m_called_unknown_fn: false
│  │  ├─ frame: ‘test’@1
│  │  │  ╰─ _1: (INIT_VAL(n_2(D))*(size_t)4)
│  │  ╰─ frame: ‘calls_malloc’@2
│  │     ├─ result_4: &HEAP_ALLOCATED_REGION(27)
│  │     ╰─ _5: &HEAP_ALLOCATED_REGION(27)
│  ╰─ Dynamic Extents
│     ╰─ HEAP_ALLOCATED_REGION(27): (INIT_VAL(n_2(D))*(size_t)4)
╰─ ‘malloc’ state machine
   ╰─ 0x468cb40: &HEAP_ALLOCATED_REGION(27): unchecked ({free}) (‘result_4’)

and the other for showing the detail of the recursive makeup of svalues
and regions, e.g. the (INIT_VAL(n_2(D))*(size_t)4) from above:

(gdb) call size_in_bytes->dump()
(17): ‘long unsigned int’: binop_svalue(mult_expr: ‘*’)
├─ (15): ‘size_t’: initial_svalue
│  ╰─ m_reg: (12): ‘size_t’: decl_region(‘n_2(D)’)
│     ╰─ parent: (9): frame_region(‘test’, index: 0, depth: 1)
│        ╰─ parent: (1): stack region
│           ╰─ parent: (0): root region
╰─ (16): ‘size_t’: constant_svalue (‘4’)

I've already found both of these useful when debugging analyzer issues.

The patch uses the former to update the output of
-fdump-analyzer-exploded-nodes-2 and
-fdump-analyzer-exploded-nodes-3.

The older dumping functions within the analyzer are retained in case
they turn out to still be useful for debugging.

gcc/ChangeLog:
* Makefile.in (OBJS-libcommon): Add text-art/tree-widget.o.
* doc/analyzer.texi: Rewrite discussion of dumping state to
cover the text_art::tree_widget-based dumps, with a more
interesting example.
* text-art/dump-widget-info.h: New file.
* text-art/dump.h: New file.
* text-art/selftests.cc (selftest::text_art_tests): Call
text_art_tree_widget_cc_tests.
* text-art/selftests.h (selftest::text_art_tree_widget_cc_tests):
New decl.
* text-art/theme.cc (ascii_theme::get_cppchar): Handle the various
cell_kind::TREE_*.
(unicode_theme::get_cppchar): Likewise.
* text-art/theme.h (enum class theme::cell_kind): Add
TREE_CHILD_NON_FINAL, TREE_CHILD_FINAL, TREE_X_CONNECTOR, and
TREE_Y_CONNECTOR.
* text-art/tree-widget.cc: New file.

gcc/analyzer/ChangeLog:
* call-details.cc: Define INCLUDE_VECTOR.
* call-info.cc: Likewise.
* call-summary.cc: Likewise.
* checker-event.cc: Likewise.
* checker-path.cc: Likewise.
* complexity.cc: Likewise.
* constraint-manager.cc: Likewise.
(bounded_range::make_dump_widget): New.
(bounded_ranges::add_to_dump_widget): New.
(equiv_class::make_dump_widget): New.
(constraint::make_dump_widget): New.
(bounded_ranges_constraint::make_dump_widget): New.
(constraint_manager::make_dump_widget): New.
* constraint-manager.h (bounded_range::make_dump_widget): New
decl.
(bounded_ranges::add_to_dump_widget): New decl.
(equiv_class::make_dump_widget): New decl.
(constraint::make_dump_widget): New decl.
(bounded_ranges_constraint::make_dump_widget): New decl.
(constraint_manager::make_dump_widget): New decl.
* diagnostic-manager.cc: Define INCLUDE_VECTOR.
* engine.cc: Likewise.  Include "text-art/dump.h".
(setjmp_svalue::print_dump_widget_label): New.
(setjmp_svalue::add_dump_widget_children): New.
(exploded_graph::dump_exploded_nodes): Use text_art::dump_to_file
for -fdump-analyzer-exploded-nodes-2 and
-fdump-analyzer-exploded-nodes-3.  Fix overlong line.
* feasible-graph.cc: Define INCLUDE_VECTOR.
* infinite-recursion.cc: Likewise.
* kf-analyzer.cc: Likewise.
* kf-lang-cp.cc: Likewise.
* kf.cc: Likewise.
* known-function-manager.cc: Likewise.
* pending-diagnostic.cc: Likewise.
* program-point.cc: Likewise.
* program-state.cc: Likewise.  Include "text-art/tree-widget" and
"text-art/dump.h".
(sm_state_map::make_dump_widget): New.
(program_state::dump): New.
(program_state::make_dump_widget): New.
* program-state.h: Include "text-art/widget.h".
(sm_state_map::make_dump_widget): New decl.
(program_state::dump): New decl.
(program_state::make_dump_widget): New decl.
* ranges.cc: Define INCLUDE_VECTOR.
* record-layout.cc: Likewise.
* region-model-asm.cc: Likewise.
* region-model-manager.cc: Likewise.
* region-model-reachability.cc: Likewise.
* region-model.cc: Likewise.  Include "text-art/tree-widget.h".
(region_to_value_map::make_dump_widget): New.
(region_model::dump): New.
(region_model::make_dump_widget): New.
(selftest::test_dump): Add test of dump_to_pp<region_model>.
* region-model.h: Include "text-art/widget.h" and
"text-art/dump.h".
(region_to_value_map::make_dump_widget): New decl.
(region_model::dump): New decl.
(region_model::make_dump_widget): New decl.
* region.cc: Define INCLUDE_VECTOR and include "text-art/dump.h".
(region::dump): New.
(region::make_dump_widget): New.
(region::add_dump_widget_children): New.
(frame_region::print_dump_widget_label): New.
(globals_region::print_dump_widget_label): New.
(code_region::print_dump_widget_label): New.
(function_region::print_dump_widget_label): New.
(label_region::print_dump_widget_label): New.
(stack_region::print_dump_widget_label): New.
(heap_region::print_dump_widget_label): New.
(root_region::print_dump_widget_label): New.
(thread_local_region::print_dump_widget_label): New.
(symbolic_region::print_dump_widget_label): New.
(symbolic_region::add_dump_widget_children): New.
(decl_region::print_dump_widget_label): New.
(field_region::print_dump_widget_label): New.
(element_region::print_dump_widget_label): New.
(element_region::add_dump_widget_children): New.
(offset_region::print_dump_widget_label): New.
(offset_region::add_dump_widget_children): New.
(sized_region::print_dump_widget_label): New.
(sized_region::add_dump_widget_children): New.
(cast_region::print_dump_widget_label): New.
(cast_region::add_dump_widget_children): New.
(heap_allocated_region::print_dump_widget_label): New.
(alloca_region::print_dump_widget_label): New.
(string_region::print_dump_widget_label): New.
(bit_range_region::print_dump_widget_label): New.
(var_arg_region::print_dump_widget_label): New.
(errno_region::print_dump_widget_label): New.
(private_region::print_dump_widget_label): New.
(unknown_region::print_dump_widget_label): New.
* region.h: Include "text-art/widget.h".
(region::dump): New decl.
(region::make_dump_widget): New decl.
(region::add_dump_widget_children): New decl.
(frame_region::print_dump_widget_label): New decl.
(globals_region::print_dump_widget_label): New decl.
(code_region::print_dump_widget_label): New decl.
(function_region::print_dump_widget_label): New decl.
(label_region::print_dump_widget_label): New decl.
(stack_region::print_dump_widget_label): New decl.
(heap_region::print_dump_widget_label): New decl.
(root_region::print_dump_widget_label): New decl.
(thread_local_region::print_dump_widget_label): New decl.
(symbolic_region::print_dump_widget_label): New decl.
(symbolic_region::add_dump_widget_children): New decl.
(decl_region::print_dump_widget_label): New decl.
(field_region::print_dump_widget_label): New decl.
(element_region::print_dump_widget_label): New decl.
(element_region::add_dump_widget_children): New decl.
(offset_region::print_dump_widget_label): New decl.
(offset_region::add_dump_widget_children): New decl.
(sized_region::print_dump_widget_label): New decl.
(sized_region::add_dump_widget_children): New decl.
(cast_region::print_dump_widget_label): New decl.
(cast_region::add_dump_widget_children): New decl.
(heap_allocated_region::print_dump_widget_label): New decl.
(alloca_region::print_dump_widget_label): New decl.
(string_region::print_dump_widget_label): New decl.
(bit_range_region::print_dump_widget_label): New decl.
(var_arg_region::print_dump_widget_label): New decl.
(errno_region::print_dump_widget_label): New decl.
(private_region::print_dump_widget_label): New decl.
(unknown_region::print_dump_widget_label): New decl.
* sm-fd.cc: Define INCLUDE_VECTOR.
* sm-file.cc: Likewise.
* sm-malloc.cc: Likewise.
* sm-pattern-test.cc: Likewise.
* sm-signal.cc: Likewise.
* sm-taint.cc: Likewise.
* sm.cc: Likewise.
* state-purge.cc: Likewise.
* store.cc: Likewise.  Include "text-art/tree-widget.h".
(add_binding_to_tree_widget): New.
(binding_map::add_to_tree_widget): New.
(binding_cluster::make_dump_widget): New.
(store::make_dump_widget): New.
* store.h: Include "text-art/tree-widget.h".
(binding_map::add_to_tree_widget): New decl.
(binding_cluster::make_dump_widget): New decl.
(store::make_dump_widget): New decl.
* svalue.cc: Define INCLUDE_VECTOR.  Include "make-unique.h" and
"text-art/dump.h".
(svalue::dump): New.
(svalue::make_dump_widget): New.
(region_svalue::print_dump_widget_label): New.
(region_svalue::add_dump_widget_children): New.
(constant_svalue::print_dump_widget_label): New.
(constant_svalue::add_dump_widget_children): New.
(unknown_svalue::print_dump_widget_label): New.
(unknown_svalue::add_dump_widget_children): New.
(poisoned_svalue::print_dump_widget_label): New.
(poisoned_svalue::add_dump_widget_children): New.
(initial_svalue::print_dump_widget_label): New.
(initial_svalue::add_dump_widget_children): New.
(unaryop_svalue::print_dump_widget_label): New.
(unaryop_svalue::add_dump_widget_children): New.
(binop_svalue::print_dump_widget_label): New.
(binop_svalue::add_dump_widget_children): New.
(sub_svalue::print_dump_widget_label): New.
(sub_svalue::add_dump_widget_children): New.
(repeated_svalue::print_dump_widget_label): New.
(repeated_svalue::add_dump_widget_children): New.
(bits_within_svalue::print_dump_widget_label): New.
(bits_within_svalue::add_dump_widget_children): New.
(widening_svalue::print_dump_widget_label): New.
(widening_svalue::add_dump_widget_children): New.
(placeholder_svalue::print_dump_widget_label): New.
(placeholder_svalue::add_dump_widget_children): New.
(unmergeable_svalue::print_dump_widget_label): New.
(unmergeable_svalue::add_dump_widget_children): New.
(compound_svalue::print_dump_widget_label): New.
(compound_svalue::add_dump_widget_children): New.
(conjured_svalue::print_dump_widget_label): New.
(conjured_svalue::add_dump_widget_children): New.
(asm_output_svalue::print_dump_widget_label): New.
(asm_output_svalue::add_dump_widget_children): New.
(const_fn_result_svalue::print_dump_widget_label): New.
(const_fn_result_svalue::add_dump_widget_children): New.
* svalue.h: Include "text-art/widget.h".  Add "using
text_art::dump_widget_info".
(svalue::dump): New decl.
(svalue::make_dump_widget): New decl.
(svalue::print_dump_widget_label): New decl.
(svalue::print_dump_widget_label): New decl.
(svalue::add_dump_widget_children): New decl.
(region_svalue::print_dump_widget_label): New decl.
(region_svalue::add_dump_widget_children): New decl.
(constant_svalue::print_dump_widget_label): New decl.
(constant_svalue::add_dump_widget_children): New decl.
(unknown_svalue::print_dump_widget_label): New decl.
(unknown_svalue::add_dump_widget_children): New decl.
(poisoned_svalue::print_dump_widget_label): New decl.
(poisoned_svalue::add_dump_widget_children): New decl.
(initial_svalue::print_dump_widget_label): New decl.
(initial_svalue::add_dump_widget_children): New decl.
(unaryop_svalue::print_dump_widget_label): New decl.
(unaryop_svalue::add_dump_widget_children): New decl.
(binop_svalue::print_dump_widget_label): New decl.
(binop_svalue::add_dump_widget_children): New decl.
(sub_svalue::print_dump_widget_label): New decl.
(sub_svalue::add_dump_widget_children): New decl.
(repeated_svalue::print_dump_widget_label): New decl.
(repeated_svalue::add_dump_widget_children): New decl.
(bits_within_svalue::print_dump_widget_label): New decl.
(bits_within_svalue::add_dump_widget_children): New decl.
(widening_svalue::print_dump_widget_label): New decl.
(widening_svalue::add_dump_widget_children): New decl.
(placeholder_svalue::print_dump_widget_label): New decl.
(placeholder_svalue::add_dump_widget_children): New decl.
(unmergeable_svalue::print_dump_widget_label): New decl.
(unmergeable_svalue::add_dump_widget_children): New decl.
(compound_svalue::print_dump_widget_label): New decl.
(compound_svalue::add_dump_widget_children): New decl.
(conjured_svalue::print_dump_widget_label): New decl.
(conjured_svalue::add_dump_widget_children): New decl.
(asm_output_svalue::print_dump_widget_label): New decl.
(asm_output_svalue::add_dump_widget_children): New decl.
(const_fn_result_svalue::print_dump_widget_label): New decl.
(const_fn_result_svalue::add_dump_widget_children): New decl.
* trimmed-graph.cc: Define INCLUDE_VECTOR.
* varargs.cc: Likewise.

gcc/testsuite/ChangeLog:
* gcc.dg/plugin/analyzer_cpython_plugin.c: Define INCLUDE_VECTOR.
* gcc.dg/plugin/analyzer_gil_plugin.c: Likewise.
* gcc.dg/plugin/analyzer_kernel_plugin.c: Likewise.
* gcc.dg/plugin/analyzer_known_fns_plugin.c: Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
4 months agolibgomp.texi: Impl. update for USM and missing 5.2 item
Tobias Burnus [Thu, 30 May 2024 11:21:43 +0000 (13:21 +0200)]
libgomp.texi: Impl. update for USM and missing 5.2 item

libgomp/ChangeLog:

* libgomp.texi (OpenMP 5.0 status): Mark 'requires' as done and
link to 'Offload-Target Specifics'.
(OpenMP 5.2 status): Add item about additional map-type modifiers
in 'declare mapper'.

4 months ago[testsuite] [powerpc] adjust -m32 counts for fold-vec-extract*
Alexandre Oliva [Wed, 29 May 2024 05:52:18 +0000 (02:52 -0300)]
[testsuite] [powerpc] adjust -m32 counts for fold-vec-extract*

Codegen changes caused add instruction count mismatches on
ppc-*-linux-gnu and other 32-bit ppc targets.  At some point the
expected counts were adjusted for lp64, but ilp32 differences
remained, and published test results confirm it.

for  gcc/testsuite/ChangeLog

PR testsuite/101169
* gcc.target/powerpc/fold-vec-extract-double.p7.c: Adjust addi
counts for ilp32.
* gcc.target/powerpc/fold-vec-extract-float.p7.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-float.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-int.p7.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-int.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-short.p7.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-short.p8.c: Likewise.

4 months ago[testsuite] conditionalize dg-additional-sources on target and type
Alexandre Oliva [Thu, 30 May 2024 07:01:19 +0000 (04:01 -0300)]
[testsuite] conditionalize dg-additional-sources on target and type

g++.dg/vect/pr95401.cc has dg-additional-sources, and that fails when
check_vect_support_and_set_flags finds vector support lacking for
execution tests: tests decay to compile tests, and additional sources
are rejected by the compiler when compiling to a named output file.

At first I considered using some effective target to conditionalize
the additional sources.  There was no support for target-specific
additional sources, so I added that.

But then, I found that adding an effective target to check whether the
test involves linking would just make for busy work in this case, and
so I went ahead and adjusted the handling of additional sources to
refrain from adding them on compile tests, reporting them as
unsupported.

That solves the problem without using the newly-added machinery for
per-target additional sources, but I figured since I'd implemented it
I might as well contribute it, since there might be other uses for it.

for  gcc/ChangeLog

* doc/sourcebuild.texi (dg-additional-sources): Document
newly-added support for target selectors, and implicit discard
on non-linking tests that name the compiler output explicitly.

for  gcc/testsuite/ChangeLog

* lib/gcc-defs.exp (dg-additional-sources): Support target
selectors.  Make it cumulative.
(dg-additional-files-options): Take dest and type.  Note
unsupported additional sources when not linking and naming the
compiler output.  Adjust source dirname prepending to cope
with leading blanks.
* lib/g++.exp (g++_target_compile): Pass dest and type on to
dg-additional-files-options.
* lib/gcc.exp (gcc_target_compile): Likewise.
* lib/gdc.exp (gdb_target_compile): Likewise.
* lib/gfortran.exp (gfortran_target_compile): Likewise.
* lib/go.exp (go_target_compile): Likewise.
* lib/obj-c++.exp (obj-c++_target_compile): Likewise.
* lib/objc.exp (objc_target_compile): Likewise.
* lib/rust.exp (rust_target_compile): Likewise.
* lib/profopt.exp (profopt-execute): Likewise-ish.

This page took 0.134023 seconds and 5 git commands to generate.