]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
9 days agoRISC-V: Fix REGNO_REG_CLASS for FP hard registers
Jin Ma [Tue, 26 May 2026 03:25:57 +0000 (11:25 +0800)] 
RISC-V: Fix REGNO_REG_CLASS for FP hard registers

The GCC Internals Manual, section 19.8 "Register Classes", documents
REGNO_REG_CLASS as:

  REGNO_REG_CLASS (regno)                                      [Macro]
    A C expression whose value is a register class containing hard
    register regno.  In general there is more than one such class;
    choose a class which is minimal, meaning that no smaller class
    also contains the register.

riscv_regno_to_class[] currently maps every FP hard register to
RVC_FP_REGS, but RVC_FP_REGS only contains f8-f15.  The entries for
f0-f7 and f16-f31 therefore violate the "containing hard register
regno" half of the contract: the returned class does not contain the
register at all.

The mismatch corrupts IRA's cost model.  setup_allocno_cost_vector
indexes the per-hard-reg cost slot via REGNO_REG_CLASS:

  rclass = REGNO_REG_CLASS (hard_regno);
  num = cost_classes_ptr->index[rclass];
  ...
  reg_costs[j] = COSTS (costs, i)->cost[num];

After setup_regno_cost_classes_by_mode adds RVC_FP_REGS to the cost
classes, the cost for e.g. f16 is silently read from the RVC_FP_REGS
slot.

The new fp-reg-class.c testcase puts eight "cf"- and sixteen "f"-
constrained doubles live across a call.  In the buggy state IRA
places the cf pseudos outside the cf class and LRA recovers with
sixteen fmv.d to fs* registers; with the fix IRA spills those values
honestly and the IRA "+++Costs" line reports a non-zero "mem"
component.

Fix it by giving each FP hard register its minimal class: FP_REGS for
f0-f7 and f16-f31, RVC_FP_REGS for f8-f15.  As a companion change,
switch riscv_secondary_memory_needed from class-equality tests to
reg_class_subset_p so it still recognises the FP side regardless of
which subclass the table returns.

gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_regno_to_class): Use the minimal
class containing each FP hard register: FP_REGS for f0-f7 and
f16-f31, RVC_FP_REGS for f8-f15.
(riscv_secondary_memory_needed): Use reg_class_subset_p to
detect FP classes.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/fp-reg-class.c: New test.

9 days agoRISC-V: Support VLS LMUL cost scaling
Zhongyao Chen [Thu, 28 May 2026 11:27:25 +0000 (19:27 +0800)] 
RISC-V: Support VLS LMUL cost scaling

Make VLS (fixed-length) vector modes use the same LMUL cost scaling as
VLA modes. This makes the vectorizer to pick smaller LMULs sometimes.

Here is how I update the testsuite which failed in regression test:
  - dyn-lmul-conv-[1-2].c: The cost model now prefers smaller LMULs,
    so update expectations.
  - pr123414.c: This test relies on large LMULs to trigger a specific bug,
    can be fixed by adding -fno-vect-cost-model.

gcc/ChangeLog:

* config/riscv/riscv-vector-costs.cc (get_lmul_cost_scaling):
Enable scaling for all vector modes (VLA and VLS).

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/dyn-lmul-conv-1.c: Update expected LMUL counts.
* gcc.target/riscv/rvv/autovec/dyn-lmul-conv-2.c: Likewise.
* gcc.target/riscv/rvv/autovec/pr123414.c: Disable vector cost model.

Signed-off-by: Zhongyao Chen <chen.zhongyao@zte.com.cn>
9 days agoavr.opt.urls: Add -masm-len-notes and -Wasm-len-notes.
Georg-Johann Lay [Thu, 28 May 2026 12:45:51 +0000 (14:45 +0200)] 
avr.opt.urls: Add -masm-len-notes and -Wasm-len-notes.

gcc/
* config/avr/avr.opt.urls (-masm-len-notes, -Wasm-len-notes): Add.

9 days agotestsuite: add AVX512 requirement to vect-early-break-no-epilog_11.c
Tamar Christina [Thu, 28 May 2026 12:04:00 +0000 (13:04 +0100)] 
testsuite: add AVX512 requirement to vect-early-break-no-epilog_11.c

This testcase on x86_64 needs AVX512 to vectorize.
My original testing used -march=native so it was on by default.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/vect-early-break-no-epilog_11.c: Add AVX512 for x86_64.

9 days agolibstdc++: Optimize operator<< for piecewise distributions.
Tomasz Kamiński [Mon, 25 May 2026 13:15:09 +0000 (15:15 +0200)] 
libstdc++: Optimize operator<< for piecewise distributions.

This avoids creating an temporary vector and uses _M_int and _M_den
members of _M_param. Empty _M_int (default) values are handled by
printing values direclty.

libstdc++-v3/ChangeLog:

* include/bits/random.h (piecewise_constant_distribution::param_type)
(piecewise_linear_distribution::param_type): Befriend operator<<.
* include/bits/random.tcc
(operator<<(basic_ostream&, piecewise_linear_distribution))
(operator<<(basic_ostream&, piecewise_constant_distribution)):
Use __x._M_param._M_int and __x._M_param._M_den instead of accessors.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
9 days agolibstdc++: Expand serialization test for piecewise distributions.
Tomasz Kamiński [Mon, 25 May 2026 12:53:43 +0000 (14:53 +0200)] 
libstdc++: Expand serialization test for piecewise distributions.

Due the viariability of the resutls, the test are currently limited
to x86_64 architectures. float/double test are disabled for -m32
as I was getting unstable result.

libstdc++-v3/ChangeLog:

* testsuite/26_numerics/random/piecewise_constant_distribution/operators/serialize2.cc:
New test.
* testsuite/26_numerics/random/piecewise_linear_distribution/operators/serialize2.cc:
New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
9 days agoaarch64/sve: combine AdvSIMD and SVE vec_duplicates
Artemiy Volkov [Mon, 22 Dec 2025 12:46:21 +0000 (12:46 +0000)] 
aarch64/sve: combine AdvSIMD and SVE vec_duplicates

Currently, to duplicate a 64-bit or narrower value into a SVE register, we
choose to go via an intermediate 128-bit AdvSIMD register, viz.:

svfloat32_t foo(float x) {
    return svdupq_n_f32(x, x, x, x);
}

which will produce the following code:

        dup     v0.4s, v0.s[0]
        dup     z0.q, z0.q[0]
        ret

when compiled with -O2 -march=armv9-a+sve.

This can be simplified into a single dup instruction going to an SVE
register directly from a scalar (or a smaller vector) value:

mov z0.s, s0
ret

To facilitate this, this patch adds a pattern that combine can use to
merge two vec_duplicate instructions (scalar -> AdvSIMD and AdvSIMD ->
SVE) into a single one (scalar -> SVE).

To demonstrate the effect of this patch, the vec-init-23.c test from
AdvSIMD was reused as a new SVE test (vec_init_5.c).

gcc/ChangeLog:

* config/aarch64/aarch64-sve.md
(*aarch64_vec_duplicate_subvector<vconsv><vconq><mode>):
New pattern.
* config/aarch64/iterators.md (VCONSV): New mode attribute.
(vconsv): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/sve/vec_init_5.c: New test.

9 days agoaarch64: implement vec_concat support for sub-64-bit types
Artemiy Volkov [Thu, 26 Feb 2026 08:45:08 +0000 (08:45 +0000)] 
aarch64: implement vec_concat support for sub-64-bit types

This patch improves handling of 2-element vec_concats in
aarch64_vector_init_fallback (); where previously the aarch64_vec_concat
insn was emitted only for pairs of vectors, we now allow scalar operands
as well.  Furthermore, if the two operands are the same, we can now emit a
vec_duplicate instead of a vec_concat, leading to better code generation.

This is backed by the new combine{z,_internal}{,_be} insn patterns, that
were each split between integral 16- and 32-bit modes (only involving GPRs
and memory), and the rest (requiring the "w" alternatives as well).

The effect of the changes is illustrated by the changes to vec-init-23.c,
introduced in the previous patch (and a handful of other vector-init
related tests).

gcc/ChangeLog:

* config/aarch64/aarch64-simd.md (*aarch64_combine_internal<mode>):
New insn pattern.
(*aarch64_combine_internal_be<mode>): Likewise.
(*aarch64_combinez<mode>): Likewise.
(*aarch64_combinez_be<mode>): Likewise.
(@aarch64_vec_concat<mode>): Support smaller vector and scalar modes.
* config/aarch64/aarch64.cc (aarch64_expand_vector_init_fallback):
Handle the case of two scalar elements.
* config/aarch64/iterators.md (SSUB64): New mode iterator.
(VSSUB64): Likewise.
(VSSUB32_I) : Likewise.
(VSSUB64_F): Likewise.
(VS32_I_SUB64_F): Likewise.
(single_wx): Define attribute for sub-64-bit vector and scalar modes.
(bitsize): Likewise.
(VDBL): Likewise.
(single_dwx): New mode attribute.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/sve/gather_load_10.c: Adjust testcase.
* gcc.target/aarch64/sve/slp_1.c: Likewise.
* gcc.target/aarch64/vec-init-18.c: Likewise.
* gcc.target/aarch64/vec-init-23.c: Likewise.

9 days agoaarch64: initialize vectors from starting subsequence
Artemiy Volkov [Thu, 26 Feb 2026 09:01:30 +0000 (09:01 +0000)] 
aarch64: initialize vectors from starting subsequence

Now that we have 2- and 4-element vector modes for all the sub-word scalar
modes, we can emit more efficient code when the elements of a vector
constructor can be generated from a common starting subsequence of length
power of two.  To do this, first detect the shortest possible starting
subsequence by repeatedly folding the initial constructor element array
in half, as long as the left and the right halves are equal.  Afterwards,
after emitting the subsequence, duplicate it by generating a
vec_duplicate with the correct source mode.

On the MD side, this requires implementing the vec_duplicate optab to
duplicate an arbitrary sub-128-bit value into a full 64- or a 128-bit
AdvSIMD register, as well as the vec_set insn for the VSUB64 modes (needed
as fallback for the divide-and-conquer approach).  The latter uses a
properly scaled and shifted "bfi" for integer values, and a properly
indexed "ins" for FP elements.

This change allows us to get rid of long chains of inserts and compile
things like:

int16x8_t f (int16_t x, int16_t y, int16_t z, int16_t w)
{
return (int16x8_t) {x, y, z, w, x, y, z, w};
}

into:
bfi     w0, w2, 16, 16
bfi     w1, w3, 16, 16
dup     v31.2s, w0
dup     v0.2s, w1
zip1    v0.8h, v31.8h, v0.8h
ret

rather than:

dup     v31.4h, w0
dup     v0.4h, w1
ins     v31.h[1], w2
ins     v0.h[1], w3
ins     v31.h[3], w2
ins     v0.h[3], w3
zip1    v0.8h, v31.8h, v0.8h
ret

This patch also includes an extensive new test, which includes the above
case, as well as adjustments to existing codegen tests as necessary.

gcc/ChangeLog:

* config/aarch64/aarch64-simd.md (*aarch64_simd_dup_subvector<vconq><mode>):
New insn pattern.
(*aarch64_simd_dup_subvector<vcond><mode>): Likewise.
(@aarch64_simd_vec_set<mode>): Likewise.
(vec_set<mode>): Handle 16- and 32-bit vector modes in the expander.
* config/aarch64/aarch64.cc (aarch64_expand_vector_init_fallback): Add
logic to initialize vector from starting subsequence.  Make static.
(scalar_move_insn_p): Consider sub-64-bit vector moves scalar.
* config/aarch64/iterators.md (VDDUP): New iterator.
(VQDUP): Likewise.
(elem_bits): Define attribute for sub-64-bit vector modes.
(Vetype): Likewise.
(VEL): Likewise.
(single_wx): Define attribute for sub-64-bit vector and scalar modes.
(single_type): Likewise.
(VCOND): Likewise.
(VCONQ): Likewise.
(Vqduptype): New mode attribute.
(Vdduptype): Likewise.
(vcond): Likewise.
(vconq): Likewise.
(vstype): Define attribute for 64-bit vector and sub-128-bit scalar
modes.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/ldp_stp_16.c: Adjust testcase.
* gcc.target/aarch64/sve/slp_1.c: Likewise.
* gcc.target/aarch64/vec-init-18.c: Likewise.
* gcc.target/aarch64/vec-init-23.c: New test.

9 days agoaarch64: introduce partial AdvSIMD vector modes
Artemiy Volkov [Mon, 18 May 2026 10:21:18 +0000 (10:21 +0000)] 
aarch64: introduce partial AdvSIMD vector modes

In addition to V2HF that already exists, this patch adds 4 more partial
(16- and 32-bit) AdvSIMD vector modes: V4QI, V2QI, V2HI, and V2BF.  For
now, these are intended only for duplication into full-sized (32-, 64-,
and 128-bit) registers.  As a minimal closure required to bootstrap the
compiler, this also implements the "mov" expand and the "aarch64_simd_mov"
insn_and_split for the new modes (gathered under the VSUB64 iterator).

This patch also adds the new aarch64_advsimd_sub_dword_mode_p () helper to
facilitate detecting the new modes; that is then used (a) to disable
vec_perm_const vectorization for those modes, (b) in the "mov" expander
for those modes, and (c) to define the new "Da" constraint.

Some existing testcases were adjusted where needed.  (The _Float16
testcase in sve/slp_1.c temporarily expects GPRs to be used for V2HF,
which is corrected to FPRs by the succeeding patch; and the half-float
complex tests now recognize some of the patterns, but check that V2BF
still can't be used for vectorization.)

gcc/ChangeLog:

* config/aarch64/aarch64-modes.def (VECTOR_MODE): Remove V2HF.
(VECTOR_MODES): Define V2QI, V4QI, V2HI, V2HF, V2BF.
* config/aarch64/aarch64-protos.h
(aarch64_advsimd_sub_dword_mode_p): Declare new predicate.
* config/aarch64/aarch64-simd.md (*aarch64_simd_mov<mode>): New
define_insn_and_split pattern.
(mov<mode>): Add sub-64-bit vector modes to the VALL_F16 expander.
Forego const vector expansion for those modes.
* config/aarch64/aarch64.cc (aarch64_classify_vector_mode):
Handle 16- and 32-bit vector modes.
(aarch64_advsimd_sub_dword_mode_p): Define new predicate.
(aarch64_vectorize_vec_perm_const): Refuse for partial vector modes.
* config/aarch64/constraints.md (Da): New constraint.
* config/aarch64/iterators.md (VSUB64): New iterator.
(VALL_F16_SUB64): Likewise.
(size): Define attribute for sub-64-bit vector modes.
(VSC): New mode attribute.
(vstype): Likewise.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/complex/bb-slp-complex-add-half-float.c: Adjust testcase.
* gcc.dg/vect/complex/bb-slp-complex-mla-half-float.c: Likewise.
* gcc.dg/vect/complex/bb-slp-complex-mul-half-float.c: Likewise.
* gcc.target/aarch64/sve/slp_1.c: Likewise.

9 days agoi386: Refine c86-4g fdiv scheduling model
Kewen Lin [Thu, 28 May 2026 11:22:57 +0000 (11:22 +0000)] 
i386: Refine c86-4g fdiv scheduling model

Commit r17-258 introduced separated c86-4g fdiv units to avoid the
automaton explosion caused by modeling the whole divider latency on
normal FPU pipes.  But the real hardware may keep the associated FPU
pipe occupied for some cycles at both the beginning and the end of
an fdiv or sqrt operation.  Following Alexander's suggestion in [1],
this patch still keeps the long-latency part on the dedicated fdiv
unit but models only a bounded part of the FPU pipe occupancy.  It
makes the first four cycles reserve both the selected FPU pipe and
the fdiv unit, then keep only the fdiv unit for the remaining cycles.

Taking r17-258 as baseline, I tried K = 1,2,3,4 for

  fpu,divider*N -> (fpu+divider)*K, divider*(N-K)

and measured the time for build/genautomata and the top 100 symbol
sizes of insn-automata.o (baseline normalized as 100) as below:

1) without any other changes:
              time     size
  baseline    100      100
  r17-203     340.0    629.3
  K1          100.3    100
  K2          105.5    112.5
  K3          112.8    129
  K4          119.4    141

2) Splitting fpu0/fpu2 and fpu1/fpu3 to paired automatons:
              time     size
  baseline    100      100
  r17-203     340.0    629.3
  KS1         79.6     43.3
  KS2         79.8     43.3
  KS3         79.6     43.3
  KS4         79.4     43.3

It turns out that if we want to model the FPU occupancy for some
beginning cycles, separating the involved fpu1/fpu3 from the
original fpu looks better.  So this patch splits fpu0/fpu2 and
fpu1/fpu3 into two paired automata and this extra coupling does
not grow the main FPU automata significantly.

This patch also corrects some other modeling omissions like:

  - Fix c86_4g_fp_op_idiv_load latency typo by one cycle.
  - Merge the old c86_4g_m7 idiv DI/SI/HI reservations after
    aligning their latency and divider unit occupancy (with
    updated values), while keeping QI separate.
  - Adjust reservation units in templates like
    c86_4g_m7_avx_vpinsr_reg_load and c86_4g_m7_avx512_sseadd_xy
    etc.
  - Add missing reservation units and unit occupancy in templates
    like c86_4g_m7_avx512_permi2_ymm and
    c86_4g_m7_sse_sseiadd_hplus_load etc.
  - Adjust reservation units and unit occupancy in templates like
    c86_4g_m7_avx512_perm_zmm_imm, c86_4g_m7_avx512_expand and
    c86_4g_m7_avx512_ssemul etc.

And also introduces some reusable reservation aliases to simplify
some modelings.

I tested build time for i686 bootstrapping in a docker container:
  - r17-202: 2437s (before c86-4g support)
  - r17-203: 7291s (c86-4g support)
  - r17-258: 2646s (tweaking for build time)
  - this: 2358s
It looks this patch improves build time (even better than r17-202
though the trivial gap can be due to some jitter).

The symbol sizes are improved as below:

nm -CS -t d --defined-only gcc/insn-automata.o \
    | sed 's/^[0-9]* 0*//' \
    | sort -n | tail -20

with r17-258:

  20068 r bdver1_fp_transitions
  22354 r c86_4g_m7_ieu_min_issue_delay
  26208 r slm_min_issue_delay
  26580 t internal_min_issue_delay(int, DFA_chip*)
  26869 t internal_state_transition(int, DFA_chip*)
  27244 r bdver1_fp_min_issue_delay
  28518 r glm_check
  28518 r glm_transitions
  33690 r geode_min_issue_delay
  33728 r c86_4g_fp_transitions
  45436 r znver4_fpu_min_issue_delay
  46980 r bdver3_fp_min_issue_delay
  49428 r glm_min_issue_delay
  53730 r btver2_fp_min_issue_delay
  53760 r znver1_fp_transitions
  89414 r c86_4g_m7_ieu_transitions
  93960 r bdver3_fp_transitions
  181744 r znver4_fpu_transitions
  326322 r c86_4g_m7_fpu_min_issue_delay
  1305288 r c86_4g_m7_fpu_transitions

with this:

  17872 r print_reservation(_IO_FILE*, rtx_insn*)::...
  20068 r bdver1_fp_check
  20068 r bdver1_fp_transitions
  22016 r c86_4g_m7_fpu02_transitions
  22354 r c86_4g_m7_ieu_min_issue_delay
  26208 r slm_min_issue_delay
  27244 r bdver1_fp_min_issue_delay
  28199 t internal_min_issue_delay(int, DFA_chip*)
  28362 t internal_state_transition(int, DFA_chip*)
  28518 r glm_check
  28518 r glm_transitions
  33690 r geode_min_issue_delay
  45436 r znver4_fpu_min_issue_delay
  46980 r bdver3_fp_min_issue_delay
  49428 r glm_min_issue_delay
  53730 r btver2_fp_min_issue_delay
  53760 r znver1_fp_transitions
  89414 r c86_4g_m7_ieu_transitions
  93960 r bdver3_fp_transitions
  181744 r znver4_fpu_transitions

Based on random sampling of SPEC2017 benchmarks 525.x264_r and
521.wrf_r, I verified that the new modeling introduces no
significant compilation overhead.  Testing with a single job on a
c86-4g-m7 machine revealed no impact on x264 and a tiny increase
for wrf (~0.3%).

[1] https://gcc.gnu.org/pipermail/gcc-patches/2026-May/716681.html

gcc/ChangeLog:

* config/i386/c86-4g-m7.md (c86_4g_m7_fpu): Remove automaton.
(c86_4g_m7_fpu02): New automaton.
(c86_4g_m7_fpu13): Ditto.
(c86-4g-m7-fpu0): Move to c86_4g_m7_fpu02 automaton.
(c86-4g-m7-fpu1): Move to c86_4g_m7_fpu13 automaton.
(c86-4g-m7-fpu2): Move to c86_4g_m7_fpu02 automaton.
(c86-4g-m7-fpu3): Move to c86_4g_m7_fpu13 automaton.
(c86-4g-m7-fdiv): Remove cpu unit.
(c86-4g-m7-fdiv1): New cpu unit.
(c86-4g-m7-fdiv3): Ditto.
(c86-4g-m7-fpu_0_3): New reservation.
(c86-4g-m7-fpu_1_3x2): Ditto.
(c86-4g-m7-fpu_1_3x3): Ditto.
(c86-4g-m7-fpu_1_3x6): Ditto.
(c86-4g-m7-fpux2): Ditto.
(c86-4g-m7-fpux4): Ditto.
(c86-4g-m7-fpux6): Ditto.
(c86-4g-m7-fpux8): Ditto.
(c86-4g-m7-fpux16): Ditto.
(c86-4g-m7-fp1fdiv1x4): Ditto.
(c86-4g-m7-fp3fdiv3x4): Ditto.
(c86-4g-m7-fdiv13): Ditto.
(c86-4g-m7-fp13div13): Ditto.
(c86-4g-m7-fp13div13x4): Ditto.
(c86-4g-m7-fp1div1_fp3div3_x4x8): Ditto.
(c86-4g-m7-fp1div1_fp3div3_x4x9): Ditto.
(c86-4g-m7-fp1div1_fp3div3_x4x11): Ditto.
(c86-4g-m7-fp1div1_fp3div3_x4x15): Ditto.
(c86-4g-m7-fp1div1_fp3div3_x4x18): Ditto.
(c86_4g_m7_idiv): New reservation.
(c86_4g_m7_idiv_QI): Adjust reservation latency and unit occupancy.
(c86_4g_m7_idiv_load): New reservation.
(c86_4g_m7_idiv_QI_load): Adjust reservation latency and unit
occupancy.
(c86_4g_m7_idiv_DI): Remove reservation.
(c86_4g_m7_idiv_SI): Ditto.
(c86_4g_m7_idiv_HI): Ditto.
(c86_4g_m7_idiv_DI_load): Ditto.
(c86_4g_m7_idiv_SI_load): Ditto.
(c86_4g_m7_idiv_HI_load): Ditto.
(c86_4g_m7_sse_insertimm): Adjust reservation units and unit
occupancy.
(c86_4g_m7_sse_insert): Ditto.
(c86_4g_m7_fp_sqrt): Adjust reservation.
(c86_4g_m7_fp_div): Ditto.
(c86_4g_m7_fp_div_load): Ditto.
(c86_4g_m7_fp_idiv_load): Ditto.
(c86_4g_m7_sse_pinsr_reg): Adjust reservation units and unit
occupancy.
(c86_4g_m7_sse_pinsr_reg_load): Ditto.
(c86_4g_m7_avx_vpinsr_reg): Ditto.
(c86_4g_m7_avx_vpinsr_reg_load): Ditto.
(c86_4g_m7_avx512_perm_xmm): Delete the prefix condition.
(c86_4g_m7_avx512_perm_xmm_opload): Ditto.
(c86_4g_m7_avx512_permi2_ymm): Adjust reservation units and unit
occupancy.
(c86_4g_m7_avx512_permi2_zmm): Ditto.
(c86_4g_m7_avx512_permi2_ymm_load): Ditto.
(c86_4g_m7_avx512_permi2_zmm_load): Ditto.
(c86_4g_m7_avx512_perm_zmm_imm): Ditto.
(c86_4g_m7_avx512_perm_zmm_imm_load): Ditto.
(c86_4g_m7_avx512_perm_zmm_noimm): Ditto.
(c86_4g_m7_sse_perm_zmm_noimm_load): Ditto.
(c86_4g_m7_avx_perm_ymm): Remove.
(c86_4g_m7_avx_perm_ymem): Ditto.
(c86_4g_m7_avx512_shuf_zmm): Adjust reservation units and unit
occupancy.
(c86_4g_m7_avx512_shuf_zmem): Ditto.
(c86_4g_m7_avx512_cmpestr): Ditto.
(c86_4g_m7_avx512_cmpestr_load): Ditto.
(c86_4g_m7_avx512_vdbpsadbw_zmm): Ditto.
(c86_4g_m7_avx512_vdbpsadbw_zmem): Ditto.
(c86_4g_m7_avx_ssecomi_comi): Ditto.
(c86_4g_m7_avx_ssecomi_comi_load): Ditto.
(c86_4g_m7_avx512_expand): Ditto.
(c86_4g_m7_avx512_expand_load): Ditto.
(c86_4g_m7_avx512_expand_z): Ditto.
(c86_4g_m7_avx512_expand_z_load): Ditto.
(c86_4g_m7_sse_movnt_xy): Rename to c86_4g_m7_sse_movnt.
(c86_4g_m7_avx512_sseadd_xy): Adjust reservation units.
(c86_4g_m7_avx512_sseadd_xy_load): Ditto.
(c86_4g_m7_sse_sseiadd_hplus): Adjust reservation units and unit
occupancy.
(c86_4g_m7_sse_sseiadd_hplus_load): Ditto.
(c86_4g_m7_avx512_ssemul): Adjust reservation units.
(c86_4g_m7_avx512_ssemul_load): Ditto.
(c86_4g_m7_avx512_ssediv): Remove.
(c86_4g_m7_avx512_ssediv_mem): Remove.
(c86_4g_m7_avx512_ssediv_x): New.
(c86_4g_m7_avx512_ssediv_xmem): New.
(c86_4g_m7_avx512_ssediv_y): New.
(c86_4g_m7_avx512_ssediv_ymem): New.
(c86_4g_m7_avx512_ssediv_z): Adjust reservation units.
(c86_4g_m7_avx512_ssediv_zmem): Ditto.
(c86_4g_m7_avx512_ssecmp_z): Add reservation units and unit
occupancy.
(c86_4g_m7_avx512_ssecmp_z_load): Ditto.
(c86_4g_m7_avx512_ssecmp_vp_z): New reservation.
(c86_4g_m7_avx512_ssecmp_vp_z_load): Ditto.
(c86_4g_m7_avx512_ssecmp_test_z): Remove reservation.
(c86_4g_m7_avx512_ssecmp_test_z_load): Ditto.
(c86_4g_m7_avx512_muladd): Broaden matching condition.
(c86_4g_m7_avx512_muladd_load): Ditto.
(c86_4g_m7_fma_muladd): Remove reservation.
(c86_4g_m7_fma_muladd_load): Ditto.
(c86_4g_m7_avx512_sse_conflict_x): Add reservation units and unit
occupancy.
(c86_4g_m7_avx512_sse_conflict_x_load): Ditto.
(c86_4g_m7_avx512_sse_conflict_y): Ditto.
(c86_4g_m7_avx512_sse_conflict_y_load): Ditto.
(c86_4g_m7_avx512_sse_conflict_z): Ditto.
(c86_4g_m7_avx512_sse_conflict_z_load): Ditto.
(c86_4g_m7_avx512_sse_class_z): Add reservation units and unit
occupancy.
(c86_4g_m7_avx512_sse_class_z_load): Ditto.
(c86_4g_m7_avx512_sse_sqrt): Remove.
(c86_4g_m7_avx512_sse_sqrt_load): Remove.
(c86_4g_m7_avx512_sse_sqrt_sf_x): New.
(c86_4g_m7_avx512_sse_sqrt_sf_xload): New.
(c86_4g_m7_avx512_sse_sqrt_sf_y): New.
(c86_4g_m7_avx512_sse_sqrt_sf_yload): New.
(c86_4g_m7_avx512_sse_sqrt_sf_z): New.
(c86_4g_m7_avx512_sse_sqrt_sf_zload): New.
(c86_4g_m7_avx512_sse_sqrt_df_x): New.
(c86_4g_m7_avx512_sse_sqrt_df_xload): New.
(c86_4g_m7_avx512_sse_sqrt_df_y): New.
(c86_4g_m7_avx512_sse_sqrt_df_yload): New.
(c86_4g_m7_avx512_sse_sqrt_df_z): New.
(c86_4g_m7_avx512_sse_sqrt_df_zload): New.
(c86_4g_m7_avx512_msklog_vector): Add reservation units and unit
occupancy.
(c86_4g_m7_avx512_mskmov_z_k): Ditto.
(c86_4g_m7_avx512_mskmov_k_reg): Ditto.
* config/i386/c86-4g.md (c86_4g_fp): Remove automaton.
(c86_4g_fp024): New automaton.
(c86_4g_fp1): Ditto.
(c86-4g-fp0): Move to c86_4g_fp024 automaton.
(c86-4g-fp1): Move to c86_4g_fp1 automaton.
(c86-4g-fp2): Move to c86_4g_fp024 automaton.
(c86-4g-fp3): Ditto.
(c86-4g-fp1fdivx4): New reservation.
(c86_4g_fp_sqrt): Adjust reservation.
(c86_4g_sse_sqrt_sf): Ditto.
(c86_4g_sse_sqrt_sf_mem): Ditto.
(c86_4g_sse_sqrt_df): Ditto.
(c86_4g_sse_sqrt_df_mem): Ditto.
(c86_4g_fp_op_div): Ditto.
(c86_4g_fp_op_div_load): Ditto.
(c86_4g_fp_op_idiv_load): Adjust reservation latency.
(c86_4g_ssediv_ss_ps): Adjust reservation.
(c86_4g_ssediv_ss_ps_load): Ditto.
(c86_4g_ssediv_sd_pd): Ditto.
(c86_4g_ssediv_sd_pd_load): Ditto.
(c86_4g_ssediv_avx256_ps): Ditto.
(c86_4g_ssediv_avx256_ps_load): Ditto.
(c86_4g_ssediv_avx256_pd): Ditto.
(c86_4g_ssediv_avx256_pd_load): Ditto.

Co-authored-by: Xin Liu <liulxx@hygon.cn>
Signed-off-by: Xin Liu <liulxx@hygon.cn>
Signed-off-by: Kewen Lin <linkewen@hygon.cn>
9 days agoRISC-V: Add RISC-V RVV main-loop overhead comparison in cost model
Zhongyao Chen [Wed, 20 May 2026 09:30:22 +0000 (17:30 +0800)] 
RISC-V: Add RISC-V RVV main-loop overhead comparison in cost model

Add an RVV-specific loop-overhead comparison in the RISC-V cost model and
use it after inside-loop cost comparison.

The RISC-V implementation prefers RVV mode that eliminate the main
loop, and otherwise compares their main-loop head overhead.

Local testing shows no regressions. This is likely because few testcases
have equal inside-loop cost, especially before VLS lmul cost scaling support.

I also ran regression tests with temporary VLS lmul cost scaling support.
Only 3 regressions found:
  - dyn-lmul-conv-1.c & dyn-lmul-conv-2.c: Cost model now prefers smaller LMULs
due to VLS lmul scaling, so this is reasonable, just need to update expectations.
  - pr123414.c: This test relies on large LMULs to trigger a specific bug,
so reasonable too, can be fixed by adding -fno-vect-cost-model.

The VLS LMUL cost scaling patch will be updated after this is pushed.

gcc/ChangeLog:
* config/riscv/riscv-vector-costs.cc
(estimated_loop_iters): New function.
(compare_loop_overhead): New function.
(costs::better_main_loop_than_p): Compare RVV loop overhead after
inside-loop cost.

Signed-off-by: Zhongyao Chen <chen.zhongyao@zte.com.cn>
9 days agoaarch64: Make more use of UINTVAL
Alex Coplan [Wed, 27 May 2026 20:26:44 +0000 (21:26 +0100)] 
aarch64: Make more use of UINTVAL

I noticed while reviewing some other code that we have existing code of
the form (unsigned HOST_WIDE_INT) INTVAL (X).  Such expressions are (by
definition of UINTVAL) equivalent to UINTVAL (x), and the latter is both
more succint and (IMO) more readable, so this patch replaces those
instances in the aarch64 backend accordingly.

There are also many occurrences of this outside of aarch64, I see:

$ git grep -nE "\(unsigned HOST_WIDE_INT\)\s?INTVAL" | wc -l
73

with this patch applied, but this patch just fixes the aarch64 cases for
now.

gcc/ChangeLog:

* config/aarch64/aarch64.cc (aarch64_strip_extend): Replace
(unsigned HOST_WIDE_INT) INVAL (x) with UINTVAL (x).
* config/aarch64/predicates.md (aarch64_shift_imm_si): Likewise.
(aarch64_shift_imm_di): Likewise.
(aarch64_shift_imm64_di): Likewise.
(aarch64_imm3): Likewise.

9 days agoAVR: Support [[len=<words]] notes in inline asm to specifty its size.
Georg-Johann Lay [Thu, 28 May 2026 09:44:21 +0000 (11:44 +0200)] 
AVR: Support [[len=<words]] notes in inline asm to specifty its size.

This patch adds support for [[len=<words>]] in (the comments of) inline
asm constructs.  It serves several purposes:

- Cases where the expanded asm is longer than determined from the number
  of physical and logical line breaks.  Such cases can lead to errors
  when a jump that uses a too optimistic jump offset is crossing an asm.

- Better code generation for jumps that are crossing an asm.  The default
  length of an asm is (1 + NL) * 2 words, where NL denotes the sum of
  physical and logical line breaks.  However, almost all AVR instructions
  occupy only one 16-bit word.

The feature is implemented in ADJUST_INSN_LENGTH.  The length of
an asm is the sum over all [[len=<words>]] notes, except when an
unrecognized construct is found or an error occurred.  In the latter
case, the default insn length is used.  These <words> are supported:

<words> = [0-9]+
   Specifies a non-negative decimal integer.

<words> = %[0-9]+
<words> = %[<name>]   # Already resolved to %[0-9]+ by the middle-end.
   Refers to the respective asm operand, which must be CONST_INT.

<words> = lds
<words> = sts
   Specifies the length of a LDS or STS instruction, i.e.
   1 word if AVR_TINY, and 2 words otherwise.

<words> = %~
<words> = %~call
<words> = %~jmp
   Specifies the length of a %~call resp. %~jmp instruction, i.e.
   2 words if AVR_HAVE_JMP_CALL, and 1 word otherwise.

In order to observe the assigned lengths, see -fdump-rtl-shorten or the
";; ADDR = ..." insn addresses in the asm output with -mlog=insn_addresses.

The benefits of using magic comments are:

- The feature is backwards compatible, and the target code can use
  the same asm syntax since only asm comments have to be adjusted.
  No #ifdef feature test macros are needed.  The only case where the
  feature is not fully backwards compatible is when asm templates
  already contain invalid "[[len=" notes for some reason.  In that
  case, -mno-asm-len-notes restores the old behavior.

- Since the asm size is the sum over all notes, the final size can
  be stitched together from multiple annotations / parts of an asm
  template, and there is no need to support operations like plus.

gcc/
* config/avr/avr.cc (avr_read_number, avr_length_of_asm)
(avr_maybe_length_of_asm): New static functions.
(avr_adjust_insn_length): Call avr_maybe_length_of_asm on
unrecognized insns.
* config/avr/avr.opt (-masm-len-notes, -Wasm-len-notes): New
options.
* doc/invoke.texi (AVR Options): Add -masm-len-notes,
-Wasm-len-notes.
* doc/extend.texi (Size of an asm): Add @subsubheading
"Specifying the size of an asm on AVR".

libgcc/config/avr/libf7/
* libf7.h: Add "[len=...]]" notes to all non-empty inline asm's.
* libf7.c: Dito.

9 days agoAVR: ad target/121343 - Use hard-reg constraints in [u]divmod insns.
Georg-Johann Lay [Thu, 28 May 2026 09:30:23 +0000 (11:30 +0200)] 
AVR: ad target/121343 - Use hard-reg constraints in [u]divmod insns.

PR target/121343
gcc/
* config/avr/avr.md (divmod<mode>4, udivmod<mode>4): Use
hard-reg constraints instead of explicit hard-regs.
(*divmodqi4_call_split, *udivmodqi4_call_split): Remove.
(*divmodhi4_call_split, *udivmodhi4_call_split): Remove.
(*divmodpsi4_call_split, *udivmodpsi4_call_split): Remove.
(*divmodsi4_call_split, *udivmodsi4_call_split): Remove.

9 days agoi386: Fix up *add<mode>_1<nf_name> [PR125469]
Jakub Jelinek [Thu, 28 May 2026 08:28:12 +0000 (10:28 +0200)] 
i386: Fix up *add<mode>_1<nf_name> [PR125469]

The following testcase ICEs, because combine matches
(set (reg:DI 108) (plus:DI (reg:DI 104 [ s ]) (subreg:DI (reg:TI 103 [ _2 ]) 8)))
Now, because ix86_validate_address_register has:
12038         /* Don't allow SUBREGs that span more than a word.  It can
12039            lead to spill failures when the register is one word out
12040            of a two word structure.  */
12041         if (GET_MODE_SIZE (mode) > UNITS_PER_WORD)
12042           return NULL_RTX;
this isn't recognized as *leadi, but is recognized as *adddi_1_nf pattern
instead.  Now, later on the RA turns it into:
(set (reg:DI 2 cx [108]) (plus:DI (reg:DI 0 ax [orig:104 s ] [104]) (reg:DI 5 di [ _2+8 ])))
which would be valid *leadi, but given that INSN_CODE is already set to the
*adddi_1_nf and that also satisfies it, nothing re-recognizes it as *leadi.
But in that case without TARGET_APX_NDD the pattern has return "#";
That is a bug, because there is no splitter to split that
(set (reg:DI 2 cx [108]) (plus:DI (reg:DI 0 ax [orig:104 s ] [104]) (reg:DI 5 di [ _2+8 ])))
into itself so that it is re-recognized as *leadi, so it just ICEs.
I think having a splitter to split to the same thing would be just weird, so
this just outputs lea insn directly.

2026-05-28  Jakub Jelinek  <jakub@redhat.com>

PR target/125469
* config/i386/i386.md (*add<mode>_1<nf_name>): Don't return "#" for
the lea non-TARGET_APX_NDD case, instead emit a lea directly.

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

Reviewed-by: Uros Bizjak <ubizjak@gmail.com>
9 days agoada: Align the alternate stack on Linux for address sanitizer
Sebastian Poeplau [Wed, 4 Mar 2026 09:06:07 +0000 (10:06 +0100)] 
ada: Align the alternate stack on Linux for address sanitizer

Address sanitizer requires the memory region configured via sigaltstack to be
8-byte aligned (see ASAN_SHADOW_GRANULARITY and ASAN_SHADOW_SCALE).

gcc/ada/ChangeLog:

* init.c (__gnat_alternate_stack): add alignment attribute.

9 days agoada: Fix iterator for Iterable aspect rejected without subtype indication
Eric Botcazou [Tue, 10 Mar 2026 09:14:20 +0000 (10:14 +0100)] 
ada: Fix iterator for Iterable aspect rejected without subtype indication

Iterator specifications of the In form without subtype indication are parsed
as a choice list, and later turned during semantic analysis into a bona-fide
N_Iterator_Specification node when there is a single choice with an iterator
type, but the case of the GNAT Iterable aspect is overlooked in the process.

gcc/ada/ChangeLog:

* sem_aggr.adb (Resolve_Array_Aggregate): Also rewrite a choice list
with a single choice as an iterator specification when the choice's
type has the GNAT Iterable aspect specified.

9 days agoada: Fix handling of qualified subtype with static predicate in array aggregate
Eric Botcazou [Mon, 9 Mar 2026 19:30:09 +0000 (20:30 +0100)] 
ada: Fix handling of qualified subtype with static predicate in array aggregate

The static predicate is ignored when the choice present in the aggregate is
anything else than the direct name of the subtype.

gcc/ada/ChangeLog:

* sem_aggr.adb (Resolve_Array_Aggregate): Analyze the choice before
testing whether it is the name of a subtype with a predicate.

9 days agoada: Fix assertion failure on invalid String_Literal aspect
Eric Botcazou [Fri, 6 Mar 2026 13:30:23 +0000 (14:30 +0100)] 
ada: Fix assertion failure on invalid String_Literal aspect

The root cause is that a subprogram declared in the body is incorrectly
considered as a primitive operation of a type declared in a package spec.

gcc/ada/ChangeLog:

* einfo.ads (In_Package_Body): Update description.
(In_Private_Part): Likewise.
* sem_ch3.adb (Analyze_Object_Declaration): Compute In_Package_Body
along with In_Private_Part for the object if its scope is a package.
* sem_ch6.adb (Analyze_Expression_Function): Do not compute
In_Private_Part here.
(Enter_Overloaded_Entity): Compute In_Package_Body & In_Private_Part
for the entity if its scope is a package.
* sem_util.adb (Collect_Primitive_Operations): Skip the subprograms
declared in the body for types declared in a package specification.

9 days agoada: Fix assertion failure for improper aggregate operation
Eric Botcazou [Fri, 6 Mar 2026 11:27:20 +0000 (12:27 +0100)] 
ada: Fix assertion failure for improper aggregate operation

The compiler takes the Entity of a node without checking that it may.

gcc/ada/ChangeLog:

* sem_ch13.adb (Resolve_Aspect_Aggregate.Resolve_Operation): Add
missing guard for the presence of Entity on the node.

9 days agoada: Reject non-primitive operations in Finalizable aspect
Eric Botcazou [Wed, 4 Mar 2026 19:43:02 +0000 (20:43 +0100)] 
ada: Reject non-primitive operations in Finalizable aspect

The implementation does not support them and allowing them would not bring
any significant benefit.

gcc/ada/ChangeLog:

* doc/gnat_rm/gnat_language_extensions.rst
(Generalized Finalization): Document the new restriction.
* sem_ch13.adb (Resolve_Finalizable_Argument): Adjust wording of
error message.
(Resolve_Finalization_Procedure.Is_Finalizable_Primitive): Require
the procedure to be a primitive operation.
* gnat_rm.texi: Regenerate.

9 days agoada: Remove .EXE suffix from GNAT.Command_Line error messages
Piotr Trojanek [Wed, 4 Mar 2026 16:05:33 +0000 (17:05 +0100)] 
ada: Remove .EXE suffix from GNAT.Command_Line error messages

The .EXE suffix in GNAT.Command_Line output causes diffs in testsuite results
that run on different platforms.

gcc/ada/ChangeLog:

* libgnat/g-comlin.adb
(Command_Name): New routine to strip platform-specific suffix.
(Display_Help, Get_Opt): Use new routine.
(Try_Help): Remove hardcoded ".exe" suffix; use new routine.

9 days agoada: Incorrect error message on use of 'Result with wrong prefix
Javier Miranda [Wed, 4 Mar 2026 13:32:00 +0000 (13:32 +0000)] 
ada: Incorrect error message on use of 'Result with wrong prefix

gcc/ada/ChangeLog:

* sem_util.adb (Is_Access_To_Subprogram_Wrapper): Remove useless
call to Can_Have_Formals. Found by Dismukes.

9 days agoada: Fix bogus visibility error for inherited operator of null extension
Eric Botcazou [Wed, 4 Mar 2026 13:36:13 +0000 (14:36 +0100)] 
ada: Fix bogus visibility error for inherited operator of null extension

This occurs when the operator has a heterogeneous profile and the extension
is declared in the same scope as the type of a non-controlling parameter of
the operator, because Find_Dispatching_Type incorrectly returns this type.

gcc/ada/ChangeLog:

* exp_ch3.adb (Make_Controlling_Function_Wrappers): Manually set the
Has_Controlling_Result flag on the wrappers.
* sem_disp.ads (Override_Dispatching_Operation): Move to...
* sem_disp.adb (Override_Dispatching_Operation): ...here.
(Find_Dispatching_Type): Return the (controlling) result type for a
controlling function wrapper.

9 days agoada: Fix casing of reserved word.
Vadim Godunko [Tue, 3 Mar 2026 04:49:34 +0000 (08:49 +0400)] 
ada: Fix casing of reserved word.

gcc/ada/ChangeLog:

* doc/gnat_rm/implementation_of_ada_2022_features.rst: Fix casing.
* gnat_rm.texi: Regenerate.

9 days agoada: Fix unresolved symbols with partial -gnatVo compilation
Eric Botcazou [Tue, 3 Mar 2026 10:35:36 +0000 (11:35 +0100)] 
ada: Fix unresolved symbols with partial -gnatVo compilation

This happens when the units of a program using the standard containers are
not uniformly compiled with the -gnatVo switch.  This is the fallout of an
internal confusion as to what validity checks must be applied to.

gcc/ada/ChangeLog:

* exp_ch4.adb (Expand_N_Op_Eq): Do not expand an array comparison
for validity checking purposes when the component type is covered
by the suppression of validity checks.

9 days agoada: vast: protect against a predicate failure
Marc Poulhiès [Tue, 3 Mar 2026 10:45:20 +0000 (11:45 +0100)] 
ada: vast: protect against a predicate failure

In case where the node is not a Pragma as expected, don't try to check
its field as it can raise a predicate error.

gcc/ada/ChangeLog:

* vast.adb (Do_Node_Pass_2): Only check aspect/pragma consistency for pragma nodes.

9 days agoada: Incorrect error message on use of 'Result with wrong prefix
Javier Miranda [Mon, 2 Mar 2026 16:24:01 +0000 (16:24 +0000)] 
ada: Incorrect error message on use of 'Result with wrong prefix

gcc/ada/ChangeLog:

* sem_util.ads (Is_Access_Subprogram_Wrapper): Renamed as
Is_Access_To_Subprogram_Wrapper.
* sem_util.adb (Is_Access_Subprogram_Wrapper): Ditto plus add
assertion.
* sem_disp.adb (Is_Access_To_Subprogram_Wrapper): Removed.
* sem_prag.adb (Find_Related_Declaration_Or_Body): Replace call to
Is_Access_Subprogram_Wrapper by call to Is_Access_To_Subprogram_Wrapper.
* exp_ch6.adb (Expand_Call): Ditto.
* sem_attr.adb (Analyze_Attribute [Attribute_Result]): For access to
subprogram wrappers, report that the expected prefix is the name of
the access type.

9 days agoada: Minor cleanup
Marc Poulhiès [Mon, 2 Mar 2026 14:57:17 +0000 (15:57 +0100)] 
ada: Minor cleanup

Call Decorate to set fields for aspect instead of setting them manually.

gcc/ada/ChangeLog:

* sem_ch13.adb (Make_Pragma_From_Boolean_Aspect): Use Decorate.

9 days agoada: Rewrite Analyze_Aspect_Specifications
Bob Duff [Sun, 1 Mar 2026 18:29:50 +0000 (13:29 -0500)] 
ada: Rewrite Analyze_Aspect_Specifications

Misc cleanup of Sem_Ch13.Analyze_Aspect_Specifications.

Split out procedures, remove gratuitous gotos, make various
things somewhat more uniform, etc.

Change type of E parameter of Analyze_Aspect_Specifications
from Entity_Id to N_Entity_Id; the latter has a predicate to
make sure we only pass entities. Modify one place in
Sem_Ch12.Analyze_Formal_Subprogram_Declaration that violates
the predicate, by skipping Analyze_Aspect_Specifications in
case of error.

Consolidate computation of Delay_Required into a single function.
Unfortunately, it is still necessary to modify Delay_Required
later, so it can't be constant.

Aspect_Invariant was set to Always_Delay, and then we did
"Delay_Required := False;" unconditionally. Better to set it
to Never_Delay in the first place. Similar for some other aspects.

Aspect_Implicit_Dereference was set to Always_Delay, but we create an
Aitem and insert it without delay and then do a "goto" to skip the
delay-related code. Better to set it to Never_Delay. Similar for some
other aspects, including ones previously set to Rep_Aspect. This is
probably wrong, but it was already wrong -- it doesn't introduce new
bugs.

Move Set_Aspect_On_Partial_View so it gets called for all
aspects when appropriate; "goto Continue;" was skipping this
call in some cases.

Make Boolean_Aspects include Library_Unit_Aspects, because all
Library_Unit_Aspects really are Boolean_Aspects. This allows
to change "Boolean_Aspects | Library_Unit_Aspects" to just
"Boolean_Aspects" in several places. There were just 3 uses
of Boolean_Aspects without Library_Unit_Aspects; the one in
Sem_Util seems harmless, and the two in Delay_Aspect have
a new assertion that makes sure we're not changing anything.

gcc/ada/ChangeLog:

* sem_ch13.adb (Analyze_Aspect_Specifications):
Major rewrite.
* sem_ch13.ads: Minor comment improvements.
* aspects.ads: Change some aspects to be Never_Delay.
Make Boolean_Aspects include Library_Unit_Aspects.
* exp_ch9.adb (Build_Corresponding_Record):
When copying aspects, set Aspect_Rep_Item to Empty,
so Asp_Copy looks like an unanalyzed tree.
* sem_ch12.adb (Analyze_Formal_Subprogram_Declaration):
Skip Analyze_Aspect_Specifications in case of error.
* sem_ch6.adb (Analyze_Expression_Function): Likewise.
* sinfo.ads: Minor comment improvement.

9 days agoada: Compiler hangs on a semantically incorrect program.
Steve Baird [Thu, 26 Feb 2026 23:59:07 +0000 (15:59 -0800)] 
ada: Compiler hangs on a semantically incorrect program.

A homonyms list should be acyclic. Do not introduce a cycle in an error case.

gcc/ada/ChangeLog:

* sem_ch6.adb (Install_Entity): If the entity to be installed is
already installed, assert that an error has already been flagged
and then return without introducing a cycle in the entity's
Homonyms list.

9 days agoada: Create the SARIF file in the current cwd
Viljar Indus [Wed, 25 Feb 2026 12:29:46 +0000 (14:29 +0200)] 
ada: Create the SARIF file in the current cwd

Previously we used to create the SARIF file next to the specified
source file e.g. "<Specified_Source_File_Path>.gnat.sarif"

Now the SARIF file is always generated in the cwd
"<Source_File_Name>.gnat.sarif" similarly to how gcc handles its sarif
files.

gcc/ada/ChangeLog:

* errout.adb (Output_Messages): use the source file name without
the directory path when constructing the name of the SARIF file.
* osint.adb (Strip_Directory): New method for extracting the file name
from a given path.
* osint.ads (Strip_Directory): Likewise.

9 days agoada: Crash on wrong renaming of record field
Javier Miranda [Wed, 25 Feb 2026 18:08:37 +0000 (18:08 +0000)] 
ada: Crash on wrong renaming of record field

gcc/ada/ChangeLog:

* sem_ch8.adb (Find_Renamed_Entity): Protect call to First_Formal.

9 days agoada: Fix regression under GNATProve mode
Javier Miranda [Wed, 25 Feb 2026 14:24:02 +0000 (14:24 +0000)] 
ada: Fix regression under GNATProve mode

Improve previous patch since the regression reproduces also
compiling under check syntax and semantic only mode (-gnatc).

gcc/ada/ChangeLog:

* sem_res.adb (Resolve_Declare_Expression): Do not create a
transient scope when expansion is disabled.

9 days agoada: Fix regression under GNATProve mode
Javier Miranda [Tue, 24 Feb 2026 19:03:38 +0000 (19:03 +0000)] 
ada: Fix regression under GNATProve mode

This patch fixes a regression recently introduced compiling
code under GNATprove mode.

gcc/ada/ChangeLog:

* sem_res.adb (Resolve_Declare_Expression): Do not create a
transient scope under GNATprove mode.

9 days agoada: VAST: Explain 2-pass algorithm
Bob Duff [Tue, 24 Feb 2026 15:13:59 +0000 (10:13 -0500)] 
ada: VAST: Explain 2-pass algorithm

Minor: Add a comment.

gcc/ada/ChangeLog:

* vast.adb (Pass): Add a comment.

9 days agoada: Fix VAST check on aspect consistency
Marc Poulhiès [Tue, 24 Feb 2026 09:03:52 +0000 (10:03 +0100)] 
ada: Fix VAST check on aspect consistency

Currently, N_Attribute_Definition_Clause nodes don't have a
Corresponding_Aspect field. As hinted by a comment, it's something we
would like to do in the future, but adding the check was premature.

gcc/ada/ChangeLog:

* vast.adb (Do_Node_Pass_2): Adjust check for aspect consistency.

9 days agoada: Adjust 'Constrained for formal parameters of unchecked union types
Eric Botcazou [Mon, 23 Feb 2026 16:29:44 +0000 (17:29 +0100)] 
ada: Adjust 'Constrained for formal parameters of unchecked union types

GNAT has historically never added extra formal parameters alongside formal
parameters of unchecked union types, even when they have convention Ada,
so it cannot compute the 'Constrained attribute for In Out or Out formal
parameters. This changes the compiler to raise Program_Error in this case.

gcc/ada/ChangeLog:

* exp_attr.adb (Expand_N_Attribute_Reference) <Constrained>: If the
prefix is a non-In formal parameter of an unchecked union type, give
a warning and insert a raise statement for Program_Error.

9 days agoada: Fix spurious discriminant check failure for unconstrained actual parameter
Eric Botcazou [Mon, 23 Feb 2026 08:43:17 +0000 (09:43 +0100)] 
ada: Fix spurious discriminant check failure for unconstrained actual parameter

This happens when the unconstrained variable passed as actual parameter is
initialized by a conditional expression, because its declaration is wrongly
distributed into the dependent expressions of the conditional expression.

gcc/ada/ChangeLog:

* exp_util.ads (Is_Distributable_Declaration): New predicate.
* exp_util.adb (Is_Distributable_Declaration): New predicate coming
from Expand_N_Case_Expression and Expand_N_If_Expression.  Return
False for variables of an unconstrained definite nonlimited subtype.
* exp_ch4.adb (Expand_N_Case_Expression): Replace calls to local
Is_Optimizable_Declaration by calls to Is_Distributable_Declaration.
(Expand_N_If_Expression): Likewise.
* exp_ch6.adb (Expand_Ctrl_Function_Call): Likewise.

9 days agoada: Rename Insert_Pragma to be Insert_Aitem
Bob Duff [Sat, 21 Feb 2026 10:31:28 +0000 (05:31 -0500)] 
ada: Rename Insert_Pragma to be Insert_Aitem

...because it now supports attribute_definition_clauses.
Also rename the formal parameter.

Document the fact that it sets Aitem to Empty.

gcc/ada/ChangeLog:

* sem_ch13.adb (Insert_Pragma):
Rename to be Insert_Aitem.

9 days agoada: Cleanup Analyze_Aspect_Specifications
Bob Duff [Fri, 20 Feb 2026 15:07:05 +0000 (10:07 -0500)] 
ada: Cleanup Analyze_Aspect_Specifications

Comment cleanup: Change incorrect uses of "erroneous"
(which is Ada jargon) to be "illegal".
Remove long list of aspects for Insert_Pragma;
it seems useless, and might be incorrect, and is certainly
incorrect after this change.

Change Insert_Pragma to be more general, and use it more
instead of ad-hoc code. It now supports N_Attribute_Definition_Clauses,
so should be renamed (in a future change).

The previous code sometimes used Ins_Node to preserve order;
the order of pragmas is the same as the order of aspects.
But sometimes, Ins_Node was not used. (With Ins_Node,
"with Foo => ..., Bar => ..." produces pragma Foo then pragma Bar,
for example. Without Ins_Node, it produces pragma Bar then pragma Foo.)
We are trying to use Insert_Pragma for more cases (DRY).
The new code uses Ins_Node to preserve order in case of Annotate,
and not otherwise. The Compilation_Unit case also does not
preserve order. This code is marked "???" to be cleaned up later.

One goal of this change (not yet done) is to avoid having
so many "goto Continue;"s, which are confusing, especially
since <<Continue>> is misnamed (it's not at the end of a
loop body). We will probably also split out Analyze_One_Aspect
as a separate procedure. When we get to the code after the
giant case statement, if Aitem is present, we can insert it.
(Current code inserts it as we go along.)

Move code dealing with Boolean_Aspects and Library_Unit_Aspects of
library units to where other Boolean_Aspects and Library_Unit_Aspects
are handled. This seems simpler.

gcc/ada/ChangeLog:

* sem_ch13.adb (Analyze_Aspect_Specifications):
Misc cleanup.

9 days agoada: Implement restrictions for unchecked union in inlining for GNATprove
Claire Dross [Thu, 19 Feb 2026 16:06:09 +0000 (17:06 +0100)] 
ada: Implement restrictions for unchecked union in inlining for GNATprove

Do not inline calls when  a formal parameter has an unchecked union type as
it might lead to missing checks for UU restrictions.

gcc/ada/ChangeLog:

* inline.adb (Can_Be_Inlined_In_GNATprove_Mode):
Do not inline subprograms with formals of an unchecked union type.

9 days agoada: Fix freezing of nested discriminated type
Marc Poulhiès [Thu, 19 Feb 2026 10:18:23 +0000 (11:18 +0100)] 
ada: Fix freezing of nested discriminated type

Simply creating the freeze node for the base type of a discriminated type
without adjusting the scope and the visible declarations leads to an
incorrect tree that crashes the compiler when unnesting the predicate
function.

gcc/ada/ChangeLog:

* sem_ch3.adb (Find_Type_Of_Object): Adjust freezing of the base
type of a discriminated type.

Co-authored-by: Eric Botcazou <botcazou@adacore.com>
9 days agoada: Simplify test for limited types
Ronan Desplanques [Thu, 19 Feb 2026 15:45:48 +0000 (16:45 +0100)] 
ada: Simplify test for limited types

Is_Limited_Type always returns True for types where Is_Limited_Composite
is True, therefore the disjunct this patch removes had no effect.

gcc/ada/ChangeLog:

* sem_ch3.adb (Process_Full_View): Simplify test.

9 days agoada: Fix oversight in latest accessibility change
Eric Botcazou [Thu, 19 Feb 2026 18:36:18 +0000 (19:36 +0100)] 
ada: Fix oversight in latest accessibility change

The oversight is that the dynamic accessibility checks should be generated
neither when accessibility checks are disabled, for example by means of the
-gnatp switch, nor when the GNAT restriction No_Dynamic_Accessibility_Checks
is enabled.

gcc/ada/ChangeLog:

* accessibility.adb
(Apply_Accessibility_Check_For_Class_Wide_Return): Do not test if
accessibility checks are suppressed here but...
(Apply_Accessibility_Check_For_Return): ...here instead.

9 days agoada: Apply the check for all primitive equality operations
Viljar Indus [Wed, 18 Feb 2026 09:29:23 +0000 (11:29 +0200)] 
ada: Apply the check for all primitive equality operations

gcc/ada/ChangeLog:

* sem_ch6.adb (Check_For_Primitive_Subprogram): add the
check for ghost equality functions for all branches handling
primitive subprograms.

9 days agoada: Clean up around Is_Immutably_Limited_Type
Ronan Desplanques [Wed, 18 Feb 2026 16:37:27 +0000 (17:37 +0100)] 
ada: Clean up around Is_Immutably_Limited_Type

This improves the documentation comments of Is_Immutably_Limited_Type and
Is_Inherently_Limited_Type and rewrites the body of
Is_Inherently_Limited_Type to leverage Is_Immutably_Limited_Type.

gcc/ada/ChangeLog:

* sem_aux.ads (Is_Immutably_Limited_Type, Is_Inherently_Limited_Type):
Improve documentation comments.
* sem_aux.adb (Is_Inherently_Limited_Type): Replace inline code with
call to Is_Immutably_Limited_Type.

9 days agoada: Minor cleanup related to aspects vs. pragmas
Bob Duff [Wed, 18 Feb 2026 21:52:52 +0000 (16:52 -0500)] 
ada: Minor cleanup related to aspects vs. pragmas

Initialize aspect is implementation defined, but was not in
Implementation_Defined_Aspect.

Misc minor comment fixes.

gcc/ada/ChangeLog:

* aspects.ads (Aspect_Initialize):
Add to Implementation_Defined_Aspect.
* einfo.ads (Alignment_Clause): Minor comment fix.
* sem.adb: Remove useless null statements.
* sem_ch13.ads (Rep_Item_Too_Late):
Minor comment fix (this IS Sem_Ch13).
* sem_prag.adb (Fix_Error):
Minor comment fix (aspects are not "abnormal").
* sinfo.ads: Minor comment fix.

9 days agoada: Crash when using address clause on declare-expression constant
Javier Miranda [Wed, 28 Jan 2026 11:19:45 +0000 (11:19 +0000)] 
ada: Crash when using address clause on declare-expression constant

gcc/ada/ChangeLog:

* gen_il-fields.ads (Scope_Link): New field.
* gen_il-gen-gen_nodes.adb (N_Expression_With_Actions): Added Scope_Link.
* sinfo.ads (N_Expression_With_Actions): Add field Scope_Link.
* sem_ch4.adb (Analyze_Expression_With_Actions): Set field Scope_Link
* sem_ch5.ads (Has_Sec_Stack_Call): Declaration moved to the package spec.
* sem_ch5.adb (Has_Sec_Stack_Call): ditto.
* sem_res.adb (Resolve_Declare_Expression): Push/Pop internally created
scope to provide proper visibility of the declare_items.

9 days agoada: Fix crash evaluating class-wide preconditions with missing completion
Denis Mazzucato [Wed, 18 Feb 2026 13:35:55 +0000 (14:35 +0100)] 
ada: Fix crash evaluating class-wide preconditions with missing completion

This patch fixes a crash occurring when evaluating class-wide precondition of a
non-primitive subprogram where accessing the class-wide type of its dispatching
type is not possible. The bug occurs when the type is abstract and missing
completion, a proper error should be given instead.

gcc/ada/ChangeLog:

* sem_prag.adb (Check_References): Don't call Class_Wide_Type if the
subprogram is a non-primitive procedure as the dispatching type may be
empty.

9 days agoada: Remove spurious error on attribute Count with expansion disabled
Piotr Trojanek [Mon, 16 Feb 2026 14:23:41 +0000 (15:23 +0100)] 
ada: Remove spurious error on attribute Count with expansion disabled

When expansion is disabled, e.g. because of GNAT switch -gnatc or because GNAT
is operating in the GNATprove mode, then attribute Count is not expanded and
can legitimately appear in a barrier of a protected entry, even if restriction
Pure_Barriers is enabled.

gcc/ada/ChangeLog:

* exp_ch9.adb (Is_Pure_Barrier): Handle unexpanded attribute Count.

9 days agoada: VAST Check_Corresponding_Aspect
Bob Duff [Tue, 17 Feb 2026 02:54:51 +0000 (21:54 -0500)] 
ada: VAST Check_Corresponding_Aspect

Add Check_Corresponding_Aspect to VAST.
Improve comments.

gcc/ada/ChangeLog:

* vast.adb (Check_Corresponding_Aspect):
New checks for aspect/pragma consistency.
(Check_Enum): Add documentation of the checks.

9 days agoada: Fix small irregularity for Master_Id of anonymous access result type
Eric Botcazou [Tue, 17 Feb 2026 16:27:43 +0000 (17:27 +0100)] 
ada: Fix small irregularity for Master_Id of anonymous access result type

The Master_Id of access types whose designated type contains tasks is set to
a renaming of the current _Master variable by means of Build_Master_Renaming

The exception is for anonymous access result types, whose Master_Id is set
to the current _Master variable by Check_Anonymous_Access_Return_With_Tasks.

This is fully correct because the entity of the variable is preresolved, but
is ambiguous in the .dg file because there can be several _Master variables
in the subprogram, which effectively represent distinct masters.  Therefore
this makes the case of anonymous access result types also use a renaming.

gcc/ada/ChangeLog:

* exp_ch9.ads (Build_Master_Declaration): Minor tweaks in comment.
(Build_Master_Entity): Likewise.
(Build_Master_Renaming): Likewise.
(Build_Master_Renaming_Declaration): New function declaration.
* exp_ch9.adb (Build_Master_Declaration): Move around.
(Build_Master_Renaming_Declaration): New function.
(Build_Master_Renaming): Call Build_Master_Renaming_Declaration
to build the renaming declaration.
* sem_ch6.adb (Check_Anonymous_Access_Return_With_Tasks): Remove
useless guard on Declarations (N).  Create a renaming declaration
for the current _Master variable and set is as the Master_Id of
the access result type.

9 days agoada: Fix for illegal deep delta array aggregate with others
Piotr Trojanek [Fri, 13 Feb 2026 09:07:28 +0000 (10:07 +0100)] 
ada: Fix for illegal deep delta array aggregate with others

Do not try to apply a scalar range check to "others" choice in deep delta array
aggregate. This choice is illegal, but we still need to handle it in expansion.

gcc/ada/ChangeLog:

* exp_spark.adb (Expand_SPARK_N_Delta_Aggregate): Special case for
"others" clause.

10 days agotestsuite, i386: add win64 AVX indirect alignment tests [PR54412]
oltolm [Sun, 24 May 2026 10:57:51 +0000 (12:57 +0200)] 
testsuite, i386: add win64 AVX indirect alignment tests [PR54412]

On x86_64-w64-mingw32, PR target/54412 is triggered when AVX and
AVX512 values are passed or returned indirectly and GCC materializes
under-aligned stack storage for them.

Add run tests for the original by-value AVX cases, for isolated hidden
sret allocation and callee by-reference parameter materialization, and
for a dedicated aligned(64) AVX512 case.

gcc/testsuite/ChangeLog:

PR target/54412
* gcc.target/i386/pr54412-v4d-o0-aligned-locals.c: New test.
* gcc.target/i386/pr54412-o2-by-value-cases.c: New test.
* gcc.target/i386/pr54412-sret-no-args.c: New test.
* gcc.target/i386/pr54412-callee-byref-param.c: New test.
* gcc.target/i386/pr54412-avx512-aligned64.c: New test.

Signed-off-by: oltolm <oleg.tolmatcev@gmail.com>
Signed-off-by: Jonathan Yong <10walls@gmail.com>
10 days ago[RISC-V] Drop compromised scan-asm test after recent vectorized loop epilogue changes
Jeff Law [Thu, 28 May 2026 02:00:34 +0000 (20:00 -0600)] 
[RISC-V] Drop compromised scan-asm test after recent vectorized loop epilogue changes

Tamar's recent change to elide vectorized loop epilogues compromised the
scan-asm part of this test for RISC-V.  Essentially the test is looking for a
specific insn that appears in the unnecessary epilogue.

The original motivation for these tests was an ICE.  So I'm just dropping the
scan-asm parts of this test so that we still verify that we're not triggering
an ICE.

gcc/testsuite
* gcc.target/riscv/rvv/base/pr115456-3.c: Drop compromised scan-asm
part of the test.

10 days agoFortran: [PR93727] Add EX format rounding for truncated hex mantissa
Jerry DeLisle [Sun, 24 May 2026 03:28:43 +0000 (20:28 -0700)] 
Fortran: [PR93727] Add EX format rounding for truncated hex mantissa

Implement proper rounding of the hex mantissa in write_ex when the
user specifies a d smaller than full precision.  All Fortran ROUND=
modes are supported: ROUND_NEAREST (ties-to-even), ROUND_COMPATIBLE
(ties away from zero), ROUND_UP, ROUND_DOWN, and ROUND_ZERO.
ROUND_PROCDEFINED and ROUND_UNSPECIFIED default to ROUND_NEAREST on
IEEE 754 systems, consistent with the decimal format behaviour.

Carry propagation handles the case where incrementing a string of
trailing F hex digits reaches the integer digit; if that overflows
(F → 16) the output is normalized by setting the integer digit to 8
and incrementing the binary exponent by one.

Assisted by: Claude Sonnet 4.6

PR fortran/93727

libgfortran/ChangeLog:

* io/write.c (write_ex): Replace simple truncation with
rounding-aware logic respecting dtp round_status.  Add carry
propagation and integer-digit normalization.
* io/write_float.def: Change use of GFC_UINTEGER_8 to
long long unsigned.

gcc/testsuite/ChangeLog:

* gfortran.dg/EXformat_3.F90: New test covering rounding for
KIND=4, 8, 10, and 16: clear round-up, ties-to-even (truncate
and round-up cases), carry propagation, and normalization.
* gfortran.dg/EXrounding.F90: New test checking the various
rounding modes for all kinds.

10 days agoDaily bump.
GCC Administrator [Thu, 28 May 2026 00:16:27 +0000 (00:16 +0000)] 
Daily bump.

10 days agotestsuite: fix Winvalid-memory-model*.C
Marek Polacek [Wed, 27 May 2026 18:37:08 +0000 (14:37 -0400)] 
testsuite: fix Winvalid-memory-model*.C

Commit r17-808 added a dg-additional-options to these two tests
but didn't adjust the dg-regexp line numbers.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Winvalid-memory-model-2.C: Adjust dg-regexp.
* g++.dg/warn/Winvalid-memory-model.C: Likewise.

10 days agoext-dce: narrow sign-extending loads to zero-extending when upper bits are dead
Philipp Tomsich [Fri, 20 Mar 2026 16:14:15 +0000 (17:14 +0100)] 
ext-dce: narrow sign-extending loads to zero-extending when upper bits are dead

The ext-dce pass tracks bit-level liveness and can replace sign extensions
with zero extensions when the upper bits are dead.  However,
ext_dce_try_optimize_extension bails out when the inner operand is MEM
rather than REG, missing the opportunity to narrow sign-extending loads
(e.g. lh -> lhu on RISC-V, ldrsh -> ldrh on AArch64).

Add handling for SIGN_EXTEND of MEM: when the liveness analysis has
already determined the sign bits are dead, replace the sign-extending
load with a zero-extending load via validate_change, which ensures the
target has a matching instruction pattern.

gcc/ChangeLog:

* ext-dce.cc (ext_dce_try_optimize_extension): Handle
SIGN_EXTEND of MEM by replacing with ZERO_EXTEND of MEM
when upper bits are dead.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/ext-dce-1.c: New test.
* gcc.target/riscv/ext-dce-3.c: New test.
* gcc.target/riscv/ext-dce-4.c: New test.

Co-authored-by: Konstantinos Eleftheriou <konstantinos.eleftheriou@vrull.eu>
10 days agoext-dce: fix off-by-one in subreg liveness for 32-bit modes
Philipp Tomsich [Fri, 20 Mar 2026 16:14:00 +0000 (17:14 +0100)] 
ext-dce: fix off-by-one in subreg liveness for 32-bit modes

ext_dce_process_uses uses `size >= 32` to decide whether group 3
(bits 32-63) is live for a lowpart subreg source.  For SImode subregs
(size == 32), this incorrectly marks bits 32-63 as live, preventing
the pass from recognizing that the upper half of a DImode register is
dead.  This blocks lw -> lwu narrowing on RV64.

Change the condition to `size > 32`, consistent with the other
thresholds in the same block (size > 8, size > 16).  The size > 32
case is still reachable via SUBREG_PROMOTED_VAR_P which widens size
beyond the outer mode.

gcc/ChangeLog:

* ext-dce.cc (ext_dce_process_uses): Fix off-by-one: use
size > 32 instead of size >= 32 for group 3 liveness.

Co-authored-by: Konstantinos Eleftheriou <konstantinos.eleftheriou@vrull.eu>
10 days agoAArch64: Prefer w-regs for 32-bit move immediate
Wilco Dijkstra [Thu, 21 May 2026 14:46:36 +0000 (14:46 +0000)] 
AArch64: Prefer w-regs for 32-bit move immediate

Prefer w-registers for 32-bit immediate moves.  Add aarch64_output_move_imm()
to emit a w-register if the immediate is a 32-bit unsigned value.

gcc:
* config/aarch64/aarch64.md (movdi_aarch64): Use aarch64_output_move_imm
to select w-regs.
* config/aarch64/aarch64.cc (aarch64_output_move_imm): New function.
* config/aarch64/aarch64-protos.h (aarch64_output_move_imm): Add
declaration.

gcc/testsuite:

* gcc.target/aarch64/acle/chkfeat-1.c: Update.
* gcc.target/aarch64/acle/gcs-1.c: Update.
* gcc.target/aarch64/acle/pr110100.c: Update.
* gcc.target/aarch64/bitfield-bitint-abi-align16.c: Update.
* gcc.target/aarch64/bitfield-bitint-abi-align8.c: Update.
* gcc.target/aarch64/chkfeat-1.c: Update.
* gcc.target/aarch64/chkfeat-2.c: Update.
* gcc.target/aarch64/cmpbr.c: Update.
* gcc.target/aarch64/eh_return-3.c: Update.
* gcc.target/aarch64/gcspopm-1.c: Update.
* gcc.target/aarch64/gcsss-1.c: Update.
* gcc.target/aarch64/int_mov_immediate_1.c: Update.
* gcc.target/aarch64/memset-corner-cases-2.c: Update.
* gcc.target/aarch64/memset-corner-cases.c: Update.
* gcc.target/aarch64/mops_1.c: Update.
* gcc.target/aarch64/mops_2.c: Update.
* gcc.target/aarch64/mops_3.c: Update.
* gcc.target/aarch64/movk_3.c: Update.
* gcc.target/aarch64/movtf_1.c: Update.
* gcc.target/aarch64/movti_1.c: Update.
* gcc.target/aarch64/noeffect9.c: Update.
* gcc.target/aarch64/pr71727.c: Update.
* gcc.target/aarch64/pr84882.c: Update.
* gcc.target/aarch64/sme/locally_streaming_1.c: Update.
* gcc.target/aarch64/sme/locally_streaming_1_nosve.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilege_b16.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilege_b32.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilege_b64.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilege_b8.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilege_c16.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilege_c32.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilege_c64.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilege_c8.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilegt_b16.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilegt_b32.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilegt_b64.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilegt_b8.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilegt_c16.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilegt_c32.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilegt_c64.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilegt_c8.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilele_b16.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilele_b32.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilele_b64.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilele_b8.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilele_c16.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilele_c32.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilele_c64.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilele_c8.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilelt_b16.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilelt_b32.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilelt_b64.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilelt_b8.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilelt_c16.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilelt_c32.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilelt_c64.c: Update.
* gcc.target/aarch64/sme2/acle-asm/whilelt_c8.c: Update.
* gcc.target/aarch64/sve/acle/asm/cntb_pat.c: Update.
* gcc.target/aarch64/sve/acle/asm/cntd_pat.c: Update.
* gcc.target/aarch64/sve/acle/asm/cnth_pat.c: Update.
* gcc.target/aarch64/sve/acle/asm/cntw_pat.c: Update.
* gcc.target/aarch64/sve/acle/asm/dup_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/dup_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/dupq_f32.c: Update.
* gcc.target/aarch64/sve/acle/asm/dupq_s32.c: Update.
* gcc.target/aarch64/sve/acle/asm/dupq_u32.c: Update.
* gcc.target/aarch64/sve/acle/asm/index_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/index_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1_gather_f32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1_gather_f64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1_gather_s32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1_gather_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1_gather_u32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1_gather_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1sb_gather_s32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1sb_gather_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1sb_gather_u32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1sb_gather_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1sh_gather_s32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1sh_gather_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1sh_gather_u32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1sh_gather_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1sw_gather_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1sw_gather_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1ub_gather_s32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1ub_gather_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1ub_gather_u32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1ub_gather_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1uh_gather_s32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1uh_gather_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1uh_gather_u32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1uh_gather_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1uw_gather_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ld1uw_gather_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1_gather_f32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1_gather_f64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1_gather_s32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1_gather_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1_gather_u32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1_gather_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1sb_gather_s32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1sb_gather_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1sb_gather_u32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1sb_gather_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1sh_gather_s32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1sh_gather_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1sh_gather_u32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1sh_gather_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1sw_gather_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1sw_gather_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1ub_gather_s32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1ub_gather_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1ub_gather_u32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1ub_gather_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1uh_gather_s32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1uh_gather_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1uh_gather_u32.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1uh_gather_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1uw_gather_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/ldff1uw_gather_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/prfb_gather.c: Update.
* gcc.target/aarch64/sve/acle/asm/prfd_gather.c: Update.
* gcc.target/aarch64/sve/acle/asm/prfh_gather.c: Update.
* gcc.target/aarch64/sve/acle/asm/prfw_gather.c: Update.
* gcc.target/aarch64/sve/acle/asm/st1_scatter_f32.c: Update.
* gcc.target/aarch64/sve/acle/asm/st1_scatter_f64.c: Update.
* gcc.target/aarch64/sve/acle/asm/st1_scatter_s32.c: Update.
* gcc.target/aarch64/sve/acle/asm/st1_scatter_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/st1_scatter_u32.c: Update.
* gcc.target/aarch64/sve/acle/asm/st1_scatter_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/st1b_scatter_s32.c: Update.
* gcc.target/aarch64/sve/acle/asm/st1b_scatter_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/st1b_scatter_u32.c: Update.
* gcc.target/aarch64/sve/acle/asm/st1b_scatter_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/st1h_scatter_s32.c: Update.
* gcc.target/aarch64/sve/acle/asm/st1h_scatter_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/st1h_scatter_u32.c: Update.
* gcc.target/aarch64/sve/acle/asm/st1h_scatter_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/st1w_scatter_s64.c: Update.
* gcc.target/aarch64/sve/acle/asm/st1w_scatter_u64.c: Update.
* gcc.target/aarch64/sve/acle/asm/whilele_b16.c: Update.
* gcc.target/aarch64/sve/acle/asm/whilele_b32.c: Update.
* gcc.target/aarch64/sve/acle/asm/whilele_b64.c: Update.
* gcc.target/aarch64/sve/acle/asm/whilele_b8.c: Update.
* gcc.target/aarch64/sve/acle/asm/whilelt_b16.c: Update.
* gcc.target/aarch64/sve/acle/asm/whilelt_b32.c: Update.
* gcc.target/aarch64/sve/acle/asm/whilelt_b64.c: Update.
* gcc.target/aarch64/sve/acle/asm/whilelt_b8.c: Update.
* gcc.target/aarch64/sve/acle/general/cntb_pat_1.c: Update.
* gcc.target/aarch64/sve/acle/general/cntd_pat_1.c: Update.
* gcc.target/aarch64/sve/acle/general/cnth_pat_1.c: Update.
* gcc.target/aarch64/sve/acle/general/cntw_pat_1.c: Update.
* gcc.target/aarch64/sve/acle/general/whilelt_5.c: Update.
* gcc.target/aarch64/sve/const_2.c: Update.
* gcc.target/aarch64/sve/const_3.c: Update.
* gcc.target/aarch64/sve/noeffect9.c: Update.
* gcc.target/aarch64/sve/pcs/stack_clash_1_2048.c: Update.
* gcc.target/aarch64/sve/pcs/stack_clash_2.c: Update.
* gcc.target/aarch64/sve/pcs/stack_clash_2_1024.c: Update.
* gcc.target/aarch64/sve/pcs/stack_clash_2_128.c: Update.
* gcc.target/aarch64/sve/pcs/stack_clash_2_2048.c: Update.
* gcc.target/aarch64/sve/pcs/stack_clash_2_256.c: Update.
* gcc.target/aarch64/sve/pcs/stack_clash_2_512.c: Update.
* gcc.target/aarch64/sve/pcs/struct_3_128.c: Update.
* gcc.target/aarch64/sve/pfalse-count_pred.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ld1q_gather_bf16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ld1q_gather_f16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ld1q_gather_f32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ld1q_gather_f64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ld1q_gather_s16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ld1q_gather_s32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ld1q_gather_s64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ld1q_gather_s8.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ld1q_gather_u16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ld1q_gather_u32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ld1q_gather_u64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ld1q_gather_u8.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1_gather_f32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1_gather_f64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1_gather_s32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1_gather_s64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1_gather_u32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1_gather_u64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1sb_gather_s32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1sb_gather_s64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1sb_gather_u32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1sb_gather_u64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1sh_gather_s32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1sh_gather_s64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1sh_gather_u32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1sh_gather_u64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1sw_gather_s64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1sw_gather_u64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1ub_gather_s32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1ub_gather_s64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1ub_gather_u32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1ub_gather_u64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1uh_gather_s32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1uh_gather_s64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1uh_gather_u32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1uh_gather_u64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1uw_gather_s64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/ldnt1uw_gather_u64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/st1q_scatter_bf16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/st1q_scatter_f16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/st1q_scatter_f32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/st1q_scatter_f64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/st1q_scatter_s16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/st1q_scatter_s32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/st1q_scatter_s64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/st1q_scatter_s8.c: Update.
* gcc.target/aarch64/sve2/acle/asm/st1q_scatter_u16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/st1q_scatter_u32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/st1q_scatter_u64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/st1q_scatter_u8.c: Update.
* gcc.target/aarch64/sve2/acle/asm/stnt1_scatter_f32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/stnt1_scatter_f64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/stnt1_scatter_s32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/stnt1_scatter_s64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/stnt1_scatter_u32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/stnt1_scatter_u64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/stnt1b_scatter_s32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/stnt1b_scatter_s64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/stnt1b_scatter_u32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/stnt1b_scatter_u64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/stnt1h_scatter_s32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/stnt1h_scatter_s64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/stnt1h_scatter_u32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/stnt1h_scatter_u64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/stnt1w_scatter_s64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/stnt1w_scatter_u64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilege_b16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilege_b16_x2.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilege_b32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilege_b32_x2.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilege_b64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilege_b64_x2.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilege_b8.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilege_b8_x2.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilege_c16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilege_c32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilege_c64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilege_c8.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilegt_b16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilegt_b16_x2.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilegt_b32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilegt_b32_x2.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilegt_b64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilegt_b64_x2.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilegt_b8.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilegt_b8_x2.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilegt_c16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilegt_c32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilegt_c64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilegt_c8.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilele_b16_x2.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilele_b32_x2.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilele_b64_x2.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilele_b8_x2.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilele_c16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilele_c32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilele_c64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilele_c8.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilelt_b16_x2.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilelt_b32_x2.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilelt_b64_x2.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilelt_b8_x2.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilelt_c16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilelt_c32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilelt_c64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilelt_c8.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilerw_bf16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilerw_f16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilerw_f32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilerw_f64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilerw_mf8.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilerw_s16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilerw_s32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilerw_s64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilerw_s8.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilerw_u16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilerw_u32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilerw_u64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilerw_u8.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilewr_bf16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilewr_f16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilewr_f32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilewr_f64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilewr_mf8.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilewr_s16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilewr_s32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilewr_s64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilewr_s8.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilewr_u16.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilewr_u32.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilewr_u64.c: Update.
* gcc.target/aarch64/sve2/acle/asm/whilewr_u8.c: Update.
* gcc.target/aarch64/test_frame_17.c: Update.
* gcc.target/aarch64/vec-init-single-const.c: Update.
* gcc.target/aarch64/vect-cse-codegen.c: Update.

10 days agotestsuite: Restrict mpc860_no_lwsync.c to Power ilp32 targets [PR125448]
Kishan Parmar [Wed, 27 May 2026 16:24:57 +0000 (21:54 +0530)] 
testsuite: Restrict mpc860_no_lwsync.c to Power ilp32 targets [PR125448]

The recently added mpc860_no_lwsync.c test case fails on 64-bit PowerPC
targets (such as powerpc64le-linux-gnu) because the default -m64 option
conflicts with the 32-bit legacy processor specified by -mcpu=860,
resulting in the error: "cc1: error: '-m64' requires a PowerPC64 cpu".

Fix this by restricting the test case execution to 32-bit PowerPC
targets using the 'ilp32' target requirement.

2026-05-27  Kishan Parmar  <kishan@linux.ibm.com>
    Surya Kumari Jangala  <jskumari@linux.ibm.com>

gcc/testsuite/ChangeLog:
PR target/125448
* gcc.target/powerpc/mpc860_no_lwsync.c: Restrict to ilp32 targets.

10 days agolibgomp: Fix ipr_vendor for OpenMP's interop
Tobias Burnus [Wed, 27 May 2026 14:16:05 +0000 (16:16 +0200)] 
libgomp: Fix ipr_vendor for OpenMP's interop

omp_ipr_vendor and omp_ipr_vendor_name denote the vendor of the
implementation (GCC / GNU compiler) and not the vendor of the
foreign runtime (like Nvidia for CUDA or AMD for ROCm/HSA/HIP).

Thus, use 5 / "gnu" per "Additional Definitions" document
("1.2 Supported vendor-name Values"), cf.
https://www.openmp.org/specifications/

[See also OpenMP Spec Issue #4766.]

libgomp/ChangeLog:

* libgomp.texi (Foreign-runtime support for AMD GPUs,
Foreign-runtime support for Nvdia GPUs): Fix vendor
value to match compiler not GPU vendor.
* plugin/plugin-gcn.c (GOMP_OFFLOAD_get_interop_int,
GOMP_OFFLOAD_get_interop_str): Return 5/"gnu" as ipr_vendor.
* plugin/plugin-nvptx.c (GOMP_OFFLOAD_get_interop_int,
GOMP_OFFLOAD_get_interop_str): Likewise.
* testsuite/libgomp.c/append-args-fr.h: Updated expected
value.
* testsuite/libgomp.c/interop-cuda-full.c: Likewise.
* testsuite/libgomp.c/interop-fr-1.c: Likewise.
* testsuite/libgomp.c/interop-hip.h: Likewise.
* testsuite/libgomp.fortran/interop-hip.h: Likewise.

10 days agovect: drop prefetches during if-cvt [PR120164]
Tamar Christina [Wed, 27 May 2026 13:31:49 +0000 (14:31 +0100)] 
vect: drop prefetches during if-cvt [PR120164]

PR114061 added support for dropping prefetches during vectorization but that
version doesn't work when the prefetch is conditional.

The conditionality introduces a non-if-convertible block in the CFG.  The
vectorizer removes the prefetch later on but it can't modify the CFG and as
such the block where the prefetch was in remains with just a VUSEs chain.

This change now drops them during if-conversion.  While this patch at the moment
removes them, it makes it easier for later on, should we want to start
vectorizing these instead to just update predicate_statements.

For now this follows the same approach as PR114061 and just drops them.

gcc/ChangeLog:

PR tree-optimization/120164
* tree-if-conv.cc (if_convertible_stmt_p): Detect prefetches.
(predicate_statements): Drop them during predication.

gcc/testsuite/ChangeLog:

PR tree-optimization/120164
* gcc.dg/vect/vect-prefetch-drop_2.c: New test.

10 days agox86: fix under-aligned indirect AVX argument/return stack slots on win64 [PR54412]
oltolm [Sun, 24 May 2026 10:57:49 +0000 (12:57 +0200)] 
x86: fix under-aligned indirect AVX argument/return stack slots on win64 [PR54412]

Fix x86 caller/callee handling for over-aligned indirect arguments/returns

On x86_64-w64-mingw32, TARGET_SEH limits MAX_SUPPORTED_STACK_ALIGNMENT
to 128 bits, but 256-bit AVX values are still passed and returned indirectly.
Some caller/callee stack-slot paths still used generic allocators that cap
requested alignment to MAX_SUPPORTED_STACK_ALIGNMENT, producing slots that are
under-aligned for later vmovapd/vmovaps accesses.

Fix caller-side paths by using dynamically allocated stack space for:

* over-aligned by-reference argument copies
* over-aligned hidden return slots

Fix callee-side paths by overallocating the local stack slot, then aligning the
effective address within that slot when required alignment exceeds
MAX_SUPPORTED_STACK_ALIGNMENT.

This preserves ABI behavior while ensuring alignment-sensitive AVX accesses are
correctly aligned in both caller and callee paths.

Use a target hook to control when this over-aligned stack-slot handling is
required, instead of hardcoding target conditionals in generic code.

gcc/ChangeLog:

PR target/54412
* target.def (overaligned_stack_slot_required): New calls hook.
* calls.cc (allocate_call_dynamic_stack_space): New helper.
(initialize_argument_information): Use
targetm.calls.overaligned_stack_slot_required for over-aligned
by-reference argument copies.
(expand_call): Use
targetm.calls.overaligned_stack_slot_required for over-aligned
hidden return slots.
* function.cc (assign_stack_local_aligned): New helper.
(assign_parm_setup_block): Use
targetm.calls.overaligned_stack_slot_required for over-aligned
stack parm slots.
(assign_parm_setup_reg): Likewise.
* config/i386/i386.cc (ix86_overaligned_stack_slot_required): New.
(TARGET_OVERALIGNED_STACK_SLOT_REQUIRED): Define for i386.
* doc/tm.texi.in: Add hook placement.
* doc/tm.texi: Regenerate.

Signed-off-by: oltolm <oleg.tolmatcev@gmail.com>
Signed-off-by: Jonathan Yong <10walls@gmail.com>
10 days agoi386: return 256/512-bit vectors in registers for x86_64 MS ABI [PR89597]
oltolm [Tue, 19 May 2026 17:34:42 +0000 (19:34 +0200)] 
i386: return 256/512-bit vectors in registers for x86_64 MS ABI [PR89597]

On x86_64 Windows targets using MS ABI, GCC classified 256-bit and
512-bit vector returns as memory returns.  That caused hidden sret
pointer returns where YMM0/ZMM0 returns are expected.

Teach MS ABI return classification to keep 32-byte and 64-byte vector
returns in registers when AVX/AVX512F is enabled, matching the return
register selection path.

Also extend function_value_ms_64 so 32-byte and 64-byte eligible vector
returns are mapped to the SSE register class (YMM0/ZMM0 lanes).

Add tests for x86_64-*-mingw* that verify 256-bit and 512-bit vector
returns use YMM0/ZMM0 codegen.

gcc:

PR target/89597
* config/i386/i386.cc (function_value_ms_64): Handle 32-byte and
64-byte vector returns in registers when supported.
(ix86_return_in_memory): Do not force 32-byte/64-byte eligible
vector returns to memory for MS ABI.

gcc/testsuite:

* gcc.target/i386/pr89597-1.c: New test.
* gcc.target/i386/pr89597-2.c: New test.

Signed-off-by: Oleg Tolmatcev <oleg.tolmatcev@gmail.com>
Signed-off-by: Jonathan Yong <10walls@gmail.com>
10 days agovect: Don't generate scalar epilogue if not needed [PR120352]
Tamar Christina [Wed, 27 May 2026 09:53:07 +0000 (10:53 +0100)] 
vect: Don't generate scalar epilogue if not needed [PR120352]

The example loop

#define N 4
int a[N] = {0,0,0,1};
int b[N] = {0,0,0,1};

__attribute__((noipa, noinline))
int foo ()
{
  for (int i = 0; i < N; i++)
    {
      if (a[i] > b[i])
        return 1;
    }
  return 0;
}

compiled with -O3 -march=armv9-a generates

foo:
        adrp    x2, .LANCHOR0
        add     x1, x2, :lo12:.LANCHOR0
        ptrue   p7.b, vl16
        mov     w0, 0
        ldr     q30, [x2, #:lo12:.LANCHOR0]
        ldr     q31, [x1, 16]
        cmpgt   p7.s, p7/z, z30.s, z31.s
        b.any   .L7
        ret
.L7:
        ldr     w2, [x2, #:lo12:.LANCHOR0]
        ldr     w0, [x1, 16]
        cmp     w2, w0
        bgt     .L4
        ldr     w0, [x1, 4]
        ldr     w2, [x1, 20]
        cmp     w2, w0
        blt     .L4
        ldr     w0, [x1, 8]
        ldr     w2, [x1, 24]
        cmp     w2, w0
        blt     .L4
        ldr     w2, [x1, 12]
        ldr     w0, [x1, 28]
        cmp     w2, w0
        cset    w0, gt
        ret
.L4:
        mov     w0, 1
        ret

Which when we find an element, in order to return 1 we still go to scalar.
Obviously the scalar code is completely unneeded.

This patch teaches the vectorizer that when

1. We have no live values
2. We only have one exit (this is a restriction that will be lifted in a later
   patch and is there because we need masking to avoid false positives, but see
   testcase vect-early-break-no-epilog_11.c)
3. The loop has no side-effects

then we don't need the scalar epilogue at all.

e.g. for the above we now generate

foo:
        adrp    x0, .LANCHOR0
        add     x0, x0, :lo12:.LANCHOR0
        ptrue   p7.s, vl4
        ldp     q31, q30, [x0]
        cmplt   p15.s, p7/z, z30.s, z31.s
        cset    w0, any
        ret

gcc/ChangeLog:

PR tree-optimization/120352
* tree-vectorizer.h (LOOP_VINFO_EARLY_BRK_NEEDS_EPILOG): New.
(class _loop_vec_info): Add early_break_needs_epilogue.
* tree-vect-data-refs.cc (vect_analyze_early_break_dependences): Detect
usage of stores.
* tree-vect-loop-manip.cc (vect_do_peeling): Use them.
* tree-vect-loop.cc (_loop_vec_info::_loop_vec_info): Likewise.
(vect_create_loop_vinfo): Likewise.
(vect_update_ivs_after_vectorizer_for_early_breaks): Likewise.
* tree-vect-stmts.cc (vect_stmt_relevant_p): Likewise.

gcc/testsuite/ChangeLog:

PR tree-optimization/120352
* gcc.dg/vect/vect-early-break-no-epilog_1.c: New test.
* gcc.dg/vect/vect-early-break-no-epilog_10.c: New test.
* gcc.dg/vect/vect-early-break-no-epilog_11.c: New test.
* gcc.dg/vect/vect-early-break-no-epilog_2.c: New test.
* gcc.dg/vect/vect-early-break-no-epilog_3.c: New test.
* gcc.dg/vect/vect-early-break-no-epilog_4.c: New test.
* gcc.dg/vect/vect-early-break-no-epilog_5.c: New test.
* gcc.dg/vect/vect-early-break-no-epilog_6.c: New test.
* gcc.dg/vect/vect-early-break-no-epilog_7.c: New test.
* gcc.dg/vect/vect-early-break-no-epilog_8.c: New test.
* gcc.dg/vect/vect-early-break-no-epilog_9.c: New test.
* gcc.target/aarch64/noeffect.c: New test.
* gcc.target/aarch64/noeffect10.c: New test.
* gcc.target/aarch64/noeffect11.c: New test.
* gcc.target/aarch64/noeffect2.c: New test.
* gcc.target/aarch64/noeffect3.c: New test.
* gcc.target/aarch64/noeffect4.c: New test.
* gcc.target/aarch64/noeffect5.c: New test.
* gcc.target/aarch64/noeffect6.c: New test.
* gcc.target/aarch64/noeffect7.c: New test.
* gcc.target/aarch64/noeffect8.c: New test.
* gcc.target/aarch64/noeffect9.c: New test.
* gcc.target/aarch64/sve/noeffect.c: New test.
* gcc.target/aarch64/sve/noeffect10.c: New test.
* gcc.target/aarch64/sve/noeffect11.c: New test.
* gcc.target/aarch64/sve/noeffect2.c: New test.
* gcc.target/aarch64/sve/noeffect3.c: New test.
* gcc.target/aarch64/sve/noeffect4.c: New test.
* gcc.target/aarch64/sve/noeffect5.c: New test.
* gcc.target/aarch64/sve/noeffect6.c: New test.
* gcc.target/aarch64/sve/noeffect7.c: New test.
* gcc.target/aarch64/sve/noeffect8.c: New test.
* gcc.target/aarch64/sve/noeffect9.c: New test.

10 days agovect: refactor loop peeling to support explicit flag to redirect early exits [PR120352]
Tamar Christina [Wed, 27 May 2026 09:52:27 +0000 (10:52 +0100)] 
vect: refactor loop peeling to support explicit flag to redirect early exits [PR120352]

This patch series is the first in a few to optimize early break vectorization.

The first one addresses that certain loops don't require an epilog at all.

An example is

int a[N] = {0,0,0,1};
int b[N] = {0,0,0,1};

__attribute__((noipa, noinline))
int foo ()
{
  for (int i = 0; i < N; i++)
    {
      if (a[i] > b[i])
        return 1;
    }
  return 0;
}

where we have no value or side-effect to compute.  Naturally there's no need to
redo any work to just return 1 or 0.

Teaching the vectorizer this however re-enabled epilogue nomask for early break
and so we still need to be able to peel for the epilogues.  This peeling however
should not redirect all the alternative exits to the epilog.  To understand when
this has to happen peeling now gets an extra parameter to indicate how to handle
the multiple exits.

This had an unfortunate interaction with uncounted loops, because uncounted
loops re-used the layout (with the intermediate merge block) but just being a
fall through block.  When it did this it didn't put all PHI nodes in the final
merge block and as such relied on fixups later.

This made the actual changed needed for not needing epilogs more fragile than
needed so I first refactored peeling to be more consistent between early break
and uncounted loops and insure that all BB now explicitly mention and use all
PHI nodes from the exits.

The code should hopefully be a bit more robust now wrt to needed optimizations.

gcc/ChangeLog:

PR tree-optimization/120352
* tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg): Add
redirect_exits.
(vect_do_peeling): Use it.
* tree-vectorizer.h (slpeel_tree_duplicate_loop_to_edge_cfg): Update
prototype.

10 days agoAArch64: fix the SVE->SIMD lowering optimization [PR125148]
Tamar Christina [Wed, 27 May 2026 09:50:05 +0000 (10:50 +0100)] 
AArch64: fix the SVE->SIMD lowering optimization [PR125148]

The optimization added in g:210d06502f22964c7214586c54f8eb54a6965bfd has an
implementation bug which makes it generate bogus code.

The optimization was support to convert SVE loads with a known predicate into
Adv. SIMD loads without the predicate.

The current implementation is done at expansion time where the predicate is
still clearly available.

It does this by rewriting the loads to an Adv. SIMD load and then taking a
paradoxical subreg of the result into an SVE vector.

i.e. (subreg:VNx16QI (reg:QI 111) 0)  for a byte load with a VL1 predicate.

The issue is that the SVE loads were UNSPEC before and they didn't get optimized
by passes like forwprop and cse.  Adv. SIMD loads are.

as such in cases where you have such a pattern:

char[] p = {1,2,3,3};
load (p, VL1)

we used to generate

        mov     w0, 1
        strb    w0, [x19]
        ptrue   p7.b, vl1
        ld1b    z30.b, p7/z, [x19]

which was dumb, but valid and the above optimization now gets the load
eliminated and the constants folded.  However, in particular for scalars,
AArch64 has an optimization that's been a long for ages in which scalar FPR
constants are created using vector broadcasting operations.  It assumes scalars
are accessed as scalars (as in, in the mode that created them).

So the above gets optimized to

        movi    v30.8b, 0x1

which is invalid.  The original load requires the inactive elements to be zero,
where-as by using the paradoxical subreg it's relying on the implicit (as in,
not modelled in RTL) assumption that the load zeros the top bits, but doesn't
keep in mind that the load can be optimized away.

This patch fixes it by creating a full SVE vector of 0s and writing only the
values we want to set using an INSR. (i.e. using VL2 of bytes writes a short).

It then provides patterns to optimize this:

1. if it's still following a load, just emit the load.
2. if it's not, then optimize it to a zero'ing operation. so e.g. HI mode
   issues an fmov h0, h0 and so clears the top bits to zero.

I choose this representation because even without the above operations it is
semantically valid and will generate correct code.

The alternative would be to delay this optimization to e.g. combine however we
have two problems there:

1. It's quite late, so the above constant cases for instance don't get optimized
   and we keep the pointless store and loads.
2. Our RTX costs don't model predicates.  and so it may not accept the
   combination since the replacement is more expensive.

So I chose to keep the optimization early, but just replace the paradoxical
subreg with a zero-extend.

gcc/ChangeLog:

PR target/125148
* config/aarch64/aarch64-sve.md
(*aarch64_vec_shl_insert_into_zero_<mode>,
*aarch64_vec_shl_insert_into_zero_vnx16qi,
*aarch64_vec_shl_insert_from_load_<mode>): New.
* config/aarch64/aarch64.cc (aarch64_emit_load_store_through_mode):
Replace paradoxical subreg with zero-extend.

gcc/testsuite/ChangeLog:

PR target/125148
* gcc.target/aarch64/sve/highway_run.c: New test.

10 days agoMAINTAINERS: Add additional checking to check-MAINTAINERS.py
Richard Earnshaw [Tue, 19 May 2026 17:38:55 +0000 (18:38 +0100)] 
MAINTAINERS: Add additional checking to check-MAINTAINERS.py

In order to maintain the new sorting, add a number of additional checks
to check-MAINTAINERS.py.  In summary, these are:
- arrange to sort names by surname and then forname(s).
- rework the code to use regex matches for the fields to accommodate
some fields that spill over into the next column.
- arrange to sort by more than one field.

contrib/ChangeLog:

* check-MAINTAINERS.py (get_surname): Rename to ...
(get_name_for_sort): ... this.  Add the forenames after the
surname.
(check_group): match against regexs and support additional
fields for secondary sorting.
(sections): Rework to use regexs, add rules for the other
sections in the MAINTAINERS file.

10 days agoMAINTAINERS: Secondary sort DCO by email address
Richard Earnshaw [Tue, 19 May 2026 17:47:31 +0000 (18:47 +0100)] 
MAINTAINERS: Secondary sort DCO by email address

ChangeLog:

* MAINTAINERS (Contributing under the DCO): Secondary sort
by email address.

10 days agoMAINTAINERS: refine sort for Write After Approval
Richard Earnshaw [Tue, 19 May 2026 17:32:41 +0000 (18:32 +0100)] 
MAINTAINERS: refine sort for Write After Approval

To improve the sort slightly, add a secondary sort by email address.

ChangeLog:

* MAINTAINERS (Write After Approval): Secondary sort by email.

10 days agoMAINTAINERS: Sort the Reviewers
Richard Earnshaw [Tue, 19 May 2026 17:27:45 +0000 (18:27 +0100)] 
MAINTAINERS: Sort the Reviewers

Sorted by area and then user.

ChangeLog:

* MAINTAINERS (Reviewers): Sort entries.

10 days agoMAINTAINERS: Sort Various Maintainers
Richard Earnshaw [Tue, 19 May 2026 17:55:22 +0000 (18:55 +0100)] 
MAINTAINERS: Sort Various Maintainers

Sort the Various Maintainers by area and then name.  In a minor change
to the formatting, I've introduced the convention where if a field
overflows its allotted space, it must be terminated by at exactly two
spaces.  This makes it possible for a parser to separate the component
from the subsequent maintainer name.

ChangeLog:

* MAINTAINERS (Various Maintainers): Sort entries.

10 days agoMAINTAINERS: Sort the Language Front Ends Maintainers
Richard Earnshaw [Tue, 19 May 2026 17:56:38 +0000 (18:56 +0100)] 
MAINTAINERS: Sort the Language Front Ends Maintainers

Sort the entries by Language and then maintainer.

ChangeLog:

* MAINTAINERS (Language Front Ends Maintainers): Sort entries.

10 days agoMAINTAINERS: Sort the OS Port Maintainers.
Richard Earnshaw [Tue, 19 May 2026 16:59:34 +0000 (17:59 +0100)] 
MAINTAINERS: Sort the OS Port Maintainers.

Sort by OS then user.

ChangeLog:

* MAINTAINERS (OS Port Maintainers): Sort entries.

10 days agoMAINTAINERS: Sort the CPU maintainers entries.
Richard Earnshaw [Tue, 19 May 2026 16:55:26 +0000 (17:55 +0100)] 
MAINTAINERS: Sort the CPU maintainers entries.

These were previously unsorted, but adding a sort order will be
useful in some upcoming changes.

Also fixed some stray tab characters that leaked into this file.

ChangeLog:

* MAINTAINERS (CPU Maintainers): Sort by CPU and then user.

11 days agoc++: Don't ICE in eval_constant_of on vars with error_mark_node type [PR125412]
Jakub Jelinek [Wed, 27 May 2026 07:26:22 +0000 (09:26 +0200)] 
c++: Don't ICE in eval_constant_of on vars with error_mark_node type [PR125412]

The following testcase ICEs during error recovery, because we aren't
prepared to handle error_mark_node type.

Fixed thusly.

2026-05-27  Jakub Jelinek  <jakub@redhat.com>

PR c++/125412
* reflect.cc (process_metafunction): If ht is error_operand_p,
set *non_constant_p and return NULL_TREE.

* g++.dg/reflect/pr125412.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
11 days agoaarch64: mingw: Enable init priority order
Evgeny Karpov [Tue, 19 May 2026 16:41:32 +0000 (16:41 +0000)] 
aarch64: mingw: Enable init priority order

The patch enables init priority, which is needed for winpthreads and
supported now by aarch64-w64-mingw32.
This change allows building aarch64-w64-mingw32 from upstream
binutils/gcc/mingw repos.

gcc/ChangeLog:

* config/aarch64/aarch64-coff.h (SUPPORTS_INIT_PRIORITY):
Enable SUPPORTS_INIT_PRIORITY by default.

11 days agoMAINTAINERS: Update my email address
Evgeny Karpov [Thu, 21 May 2026 14:20:04 +0000 (14:20 +0000)] 
MAINTAINERS: Update my email address

ChangeLog:

* MAINTAINERS: Update my email address.

11 days agoada: Fix build error for POSIX sed.
Iain Sandoe [Tue, 26 May 2026 15:56:12 +0000 (16:56 +0100)] 
ada: Fix build error for POSIX sed.

We create s-intnam.ads using a sed script.  This uses the a, c and i commands
which (for Posix sed versions) all require syntax like:

[1addr]a\
text
Write text to standard output as described previously.

The current script delimits the text with only a space (rather than \<newline>)
which leads to a build fail since the s-intnam.ads is not created.

gcc/ada/ChangeLog:

* xsintnam.sed: Posix-ify the a, c and i commands.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
11 days agoi386: Disable use_gather_2parts and use_gather_4parts for Diamond Rapids
liuhongt [Tue, 26 May 2026 05:40:00 +0000 (22:40 -0700)] 
i386: Disable use_gather_2parts and use_gather_4parts for Diamond Rapids

DMR architecture achieves optimal pipeline utilization and
parallelism for gather emulation with 2/4-element vector. Adjust the
tune accordingly.

gcc/ChangeLog:

* config/i386/x86-tune.def (X86_TUNE_USE_GATHER_2PARTS): Disable
for m_DIAMONDRAPIDS.
(X86_TUNE_USE_GATHER_4PARTS): Likewise.

11 days agoDaily bump.
GCC Administrator [Wed, 27 May 2026 00:16:33 +0000 (00:16 +0000)] 
Daily bump.

11 days agolibffi: Use correct include path for tests [PR125417]
Pietro Monteiro [Tue, 26 May 2026 23:09:23 +0000 (19:09 -0400)] 
libffi: Use correct include path for tests [PR125417]

Libffi testsuite uses relative directories for include paths.  For
multilibbed targets we run the tests from the the main target build
directory, so using relative paths leads to the wrong fiules being
included by the tests.  Fix by using variables that point into the
build dir for the current multilib variant being tested.

Forwarded upstream: https://github.com/libffi/libffi/pull/965

libffi/ChangeLog:
PR libffi/125417
* testsuite/lib/libffi.exp (libffi_target_compile): Use
${libffi_include} and ${blddirffi} instead of "../include" and
".." for include paths.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
11 days agoc++/reflection: ICE when substituting base info [PR125423]
Marek Polacek [Tue, 26 May 2026 17:56:16 +0000 (13:56 -0400)] 
c++/reflection: ICE when substituting base info [PR125423]

As tsubst says, we should never be tsubsting a binfo.  So let's
bail for REFLECT_BASE.

PR c++/125423

gcc/cp/ChangeLog:

* pt.cc (tsubst_expr) <case REFLECT_EXPR>: Don't tsubst
REFLECT_BASEs.

gcc/testsuite/ChangeLog:

* g++.dg/reflect/bases_of6.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
11 days agobootstrap/125318 - fix gcc/tree-vect-stmts.cc uninit error
Sergei Trofimovich [Tue, 26 May 2026 19:53:17 +0000 (20:53 +0100)] 
bootstrap/125318 - fix gcc/tree-vect-stmts.cc uninit error

Without the change gcc fails to build on master in
--enable-checking=release mode as:

    gcc/tree-vect-stmts.cc:10408:47: error: ‘stride_step’
      may be used uninitialized [-Werror=maybe-uninitialized]

This happens due to a limit hit in uninit anaysis. To avoid intermittent
build failures dependent on code size let's unconditionally initialize
the stride_step.

PR bootstrap/125318
* tree-vect-stmts.cc (vectorizable_load): Explicitly
initialize stride_step to work around
-Werror=maybe-uninitialized build failure.

11 days agotree-cfgcleanup: Don't remove forwarder blocks (with phis) with phis that have abnorm...
Andrew Pinski [Wed, 20 May 2026 20:20:15 +0000 (13:20 -0700)] 
tree-cfgcleanup: Don't remove forwarder blocks (with phis) with phis that have abnormal uses [PR125396]

This was a latent bug in the checks for removing of a forwarder block which has a phi.

Take:
      <bb 15> [local count: 182536112]:
      # arr1$0_32 = PHI <arr1$0_36(ab)(11)>

      <bb 14> [local count: 206998870]:
      # arr1$0_43(ab) = PHI <arr1$0_25(ab)(13), 9(15)>
      # sj12_44(ab) = PHI <sj12_31(ab)(13), arr1$0_32(15)>
      f8 ();

Here bb 15 predecessor is a normal edge.
So when merging the forwarder bb 15 into bb14 we end up with:
      <bb 12> [local count: 206998870]:
      # arr1$0_42(ab) = PHI <arr1$0_24(ab)(11), 9(9)>
      # sj12_43(ab) = PHI <sj12_30(ab)(11), arr1$0_35(ab)(9)>
      f8 ();
and now there is an overlap of live range of arr1$0_35 and arr1$0_42.
So we need to reject the case where we have phis and the phi arguments that
use abnormal uses.

Changes since v1:
* v2: Look at phi arguments of the forwarder block rather than the dest bb
      having an abnormal edge out.
* v3: Fix bb_phis_references_abnormal_uses to use the gimple_phi_num_args to
      search over the phi arguments. Also fix the commit message which was wrong.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/125396

gcc/ChangeLog:

* tree-cfgcleanup.cc (bb_phis_references_abnormal_uses): New function.
(maybe_remove_forwarder_block): Check to make sure the
forwarder block does not have a phi that references ssa name that has
abnormal uses.

gcc/testsuite/ChangeLog:

* gcc.dg/torture/pr125396-1.c: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
11 days agolibstdc++: Revert making ref_view<R> statically sized.
Tomasz Kamiński [Tue, 26 May 2026 16:01:40 +0000 (18:01 +0200)] 
libstdc++: Revert making ref_view<R> statically sized.

This patch reverts all changes except introduction of
ranges::__static_size from r17-810-g7239744d25dadf.

In addition to expected errors from breaking inplace_vector
preconditions, this lead to change in the return type of
define_static_array, when applied on (adapted) ref_view:
  int x[10];
  auto x = define_static_array(x | views::transform(...));
Type of x changed from span<const ...> to span<const ..., 10>,
due size being statically know.

This was considered beyond the scope of implementation freedom,
and we should wait for acceptance of P3928R0 instead.

libstdc++-v3/ChangeLog:

* include/std/ranges (ref_view::size()): Only call ranges::size(*_M_r).
(ref_view::empty): Only call ranges::empty(*_M_r).
* testsuite/23_containers/inplace_vector/cons/from_iota_neg.cc:
Except no errors from ref_view uses.
* testsuite/23_containers/inplace_vector/cons/from_range_neg.cc:
Likewise.

11 days agoFortran: Add debug functions for OpenMP data structures
Paul-Antoine Arras [Wed, 6 May 2026 18:07:44 +0000 (20:07 +0200)] 
Fortran: Add debug functions for OpenMP data structures

show_omp_namelist and show_omp_clauses cannot be called from GDB because
dumpfile is NULL at debug time. Add debug wrappers that temporarily set it to
stderr.

gcc/fortran/ChangeLog:

* dump-parse-tree.cc (debug): Add debug functions for gfc_omp_namelist
and gfc_omp_clauses.

11 days agoada: Fix System.Interrupt_Names generation on VxWorks (continued)
Eric Botcazou [Mon, 16 Feb 2026 21:26:56 +0000 (22:26 +0100)] 
ada: Fix System.Interrupt_Names generation on VxWorks (continued)

gcc/ada/ChangeLog:

* xsintnam.sed: Disable style checks.

11 days agoada: Fix System.Interrupt_Names generation on VxWorks
Ronan Desplanques [Mon, 16 Feb 2026 14:21:18 +0000 (15:21 +0100)] 
ada: Fix System.Interrupt_Names generation on VxWorks

The spec of Ada.Interrupts.Names for VxWorks (and RTEMS) contains a
subtype declaration. This is a deviation from the Ada reference manual
and the sed script used to generate System.Interrupt_Names failed to
handle it. This patch fixes this.

gcc/ada/ChangeLog:

* xsintnam.sed: Handle special case.

11 days agoada: Fix build failure on Windows machines
Eric Botcazou [Sat, 14 Feb 2026 23:00:55 +0000 (00:00 +0100)] 
ada: Fix build failure on Windows machines

The -E switch is not recognized by old versions of GNU sed, so remove it as
well as the pipe since it hides error messages.

gcc/ada/ChangeLog:

* gcc-interface/Makefile.in ($(RTSDIR)/s-intnam.ads): Change recipe
to use a basic invocation of 'sed'.

11 days agolibstdc++: Fix <optional> for freestanding [PR125450]
Jonathan Wakely [Tue, 26 May 2026 09:50:53 +0000 (10:50 +0100)] 
libstdc++: Fix <optional> for freestanding [PR125450]

libstdc++-v3/ChangeLog:

PR libstdc++/125450
* include/std/optional (range_format): Do not define for
freestanding.

11 days agolibstdc++: Make ref_view<R> statically sized if R has static size
Tomasz Kamiński [Fri, 24 Apr 2026 03:26:13 +0000 (05:26 +0200)] 
libstdc++: Make ref_view<R> statically sized if R has static size

This patch introduces ranges::__static_size<_Range> helper functions,
that returns ranges::size(__rg) for __statically_sized_range.
This function is then used for ref_view<R>::size if R has static size,
avoiding dereference of pointer value that is not known at compile time.
Similarly for ref_view<R>::empty() we compare the size with zero, if it
is known statically.

This implements relevant part of P3928R0: static_sized_range by
Hewill Kang. As standard does not specify when constexpr functions
are usable at compile time, such implementation are allowed (but not
mandated) by current draft.

libstdc++-v3/ChangeLog:

* include/bits/ranges_base.h (ranges::__static_size): Define.
* include/std/ranges (ref_view::size()): For ranges with static
size return ranges::__static_size<_Range>.
(ref_view::empty): For ranges with static size, compare size
against zero.
* testsuite/23_containers/inplace_vector/cons/from_iota_neg.cc:
Expect errors from ref_view uses.
* testsuite/23_containers/inplace_vector/cons/from_range_neg.cc:
Expect errors from ref_view uses.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Reviewed-by: Patrick Palka <ppalka@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
11 days agolibstdc++: static_assert that static sized range size is less than inplace_vector...
Tomasz Kamiński [Fri, 24 Apr 2026 03:26:06 +0000 (05:26 +0200)] 
libstdc++: static_assert that static sized range size is less than inplace_vector capacity

Resolves LWG 4396. Improve inplace_vector(from_range_t, R&& rg)

The test case illustrates that views applied to span<T, N> are still
statically sized, but once applied to array<T, N> are not. This is
caused by the fact that ref_view stores a pointer to array, and
dereference of unknown pointers does not produce reference to unknown,
and simply yield non-constant expressions (unknown pointer is not
equivalent to pointer to unknown, as it may be null).

libstdc++-v3/ChangeLog:

* include/std/inplace_vector (inplace_vector(std::from_range, __Rg&&)):
Add static_asserts checking range size.
* testsuite/23_containers/inplace_vector/cons/from_iota_neg.cc:
New test.
* testsuite/23_containers/inplace_vector/cons/from_range_neg.cc:
New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Reviewed-by: Patrick Palka <ppalka@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
11 days agolibstdc++: Deprecate std::memory_order::consume
Jonathan Wakely [Thu, 21 May 2026 16:09:47 +0000 (17:09 +0100)] 
libstdc++: Deprecate std::memory_order::consume

This implements P3475R2, "Defang and deprecate memory_order::consume",
approved in Hagenberg, 2025.

It looks like the using-declaration for memory_order_consume in
<stdatomic.h> was not deprecated by the paper, but I don't think we can
implement that if we warn for the name in <atomic>. It doesn't make
sense to me for it to be deprecated in C++ but still usable in the C/C++
compatibility header. It's still just as useless in common C/C++
headers, so we should warn.

libstdc++-v3/ChangeLog:

* include/bits/atomic_base.h (memory_order::consume): Add
deprecate attribute.
(memory_order_consume): Likewise.
(kill_dependency): Likewise.
(atomic_flag::clear): Disable warning with pragmas.
(__atomic_base::store, __atomic_base<T*>::store): Likewise.
* include/c_compatibility/stdatomic.h (memory_order_consume):
Likewise.
* testsuite/29_atomics/atomic/requirements/compare_exchange_lowering.cc:
Ignore deprecation warnings.
* testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc:
Likewise.
* testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Add
dg-warning directives.
* testsuite/29_atomics/headers/stdatomic.h/c_compat.cc:
Likewise.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Winvalid-memory-model-2.C: Disable deprecated
warnings for C++26 and up.
* g++.dg/warn/Winvalid-memory-model.C: Likewise.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
11 days agolibstdc++: Add missing constraints to vector and deque deduction guides
Jonathan Wakely [Thu, 21 May 2026 17:58:14 +0000 (18:58 +0100)] 
libstdc++: Add missing constraints to vector and deque deduction guides

The standard requires that these deduction guides are constrained to
only accept a type that qualifies as an allocator for the second
templates argument.

libstdc++-v3/ChangeLog:

* include/bits/stl_deque.h: Add missing constraint on allocator
type in deduction guide.
* include/bits/stl_vector.h: Likewise.
* include/debug/deque: Likewise.
* include/debug/vector: Likewise.
* testsuite/23_containers/deque/cons/deduction_c++23.cc: Check
that deduction fails for a type which does not qualify as an
allocator.
* testsuite/23_containers/vector/cons/deduction_c++23.cc:
Likewise.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
11 days agolibstdc++: Split <iosfwd> and only include it in <ios> [PR125371]
Jonathan Wakely [Tue, 19 May 2026 15:51:14 +0000 (16:51 +0100)] 
libstdc++: Split <iosfwd> and only include it in <ios> [PR125371]

The standard explicitly requires the <ios> header to include <iosfwd>,
which has declarations of all the standard stream buffers and stream
types. Because we include <ios> in <istream> and <ostream>, this means
that <iosfwd> is included everywhere, and so every iostream header has a
forward declaration of every iostream type. This means that for example,
<fstream> has a declaration (but not the definition) of std::stringbuf.

This leads to a poor user experience, because the compiler's fixit hints
for undeclared types do not trigger of the type _has_ been declared,
instead users get an error about using an incomplete type. See the
example in PR 125371, where using std::istringstream after including
<fstream> fails to suggest including <sstream>.

If we stop including <ios> in <istream> and <ostream>, and instead
include _most_ of the same things that <ios> provides, then we can avoid
the unhelpful declarations of the entire family of iostream types in
every header. Users who really do want a declaration of std::filebuf
or std::istringstream (but don't want the full definition) can still
explicitly include <iosfwd> to get those declarations. But they won't
get them as a side effect of <fstream> etc.

Various headers currently include <iosfwd> because they really do want
the declaration of e.g. std::ostream of std::streambuf_iterator. We can
split <iosfwd> into five smaller headers and then only include the relevant
one where required, e.g. <fstream> only needs to include iosfwd_file.h
and not iosfwd_string.h.

We need to add an explicit include of <ios> in <iostream>.  The standard
requires it there, and after this change we no longer get it via
<istream> and <ostream>.

libstdc++-v3/ChangeLog:

PR libstdc++/125371
* config/io/basic_file_stdio.h: Include <bits/ios_base.h>
instead of <ios>.
* include/Makefile.am: Add new headers.
* include/Makefile.in: Regenerate.
* include/bits/fs_path.h: Include <bits/iosfwd.h> instead of
<iosfwd>.
* include/bits/locale_facets.h: Remove unused <iosfwd> and
<streambuf> includes.
* include/bits/localefwd.h: Include <bits/iosfwd.h> instead of
<iosfwd>.
* include/bits/ostream.h: Replace <ios> with its constituent
parts, except for <iosfwd>.
* include/bits/ostream_insert.h: Include <bits/iosfwd.h> instead
of <iosfwd>.
* include/bits/shared_ptr.h: Likewise.
* include/bits/std_thread.h: Likewise.
* include/bits/stream_iterator.h: Likewise.
* include/std/fstream: Include <bits/iosfwd_file.h>.
* include/std/iomanip: Include <bits/iosfwd.h> instead of
<iosfwd>.
* include/std/ios: Do not include <exception> or
<bits/char_traits.h>.
* include/std/iosfwd: Move declarations to new headers and
include those new headers. Tweak Doxygen comment.
* include/std/iostream: Include <ios>.
* include/std/istream: Replace <ios> with its constituent
parts, except for <iosfwd>.
* include/std/random: Include <bits/iosfwd.h> instead of
<iosfwd>.
* include/std/spanstream: Include <bits/iosfwd_span.h>.
* include/std/sstream: Include <bits/iosfwd_string.h>.
* include/std/streambuf: Include <bits/iosfwd.h> instead of
<iosfwd>.
* include/std/string_view: Likewise.
* include/std/syncstream: Include <bits/iosfwd_sync.h>.
* include/std/system_error: Include <bits/iosfwd.h> instead of
<iosfwd>.
* include/bits/iosfwd.h: New file.
* include/bits/iosfwd_file.h: New file.
* include/bits/iosfwd_span.h: New file.
* include/bits/iosfwd_string.h: New file.
* include/bits/iosfwd_sync.h: New file.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>