]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
2 weeks agodocs: Document that scatters are left-to-right.
Robin Dapp [Tue, 21 Jul 2026 08:37:46 +0000 (10:37 +0200)] 
docs: Document that scatters are left-to-right.

This changes the docs to reflect the vectorizer's assumption that
scatter stores are ordered.  Both, scatters and strided stores are
affected.

gcc/ChangeLog:

* doc/md.texi: Document that scatters are left-to-right.

2 weeks agoAVR: Tweak __muldi3_6
Georg-Johann Lay [Tue, 21 Jul 2026 13:18:27 +0000 (15:18 +0200)] 
AVR: Tweak __muldi3_6

This patch changes __muldi3_6 to

__muldi3_6:
    XCALL   __umulhisi3
    add     C2, 22
    adc     C3, 23
    adc     C4, 24
    adc     C5, 25
    adc     C6, __zero_reg__
    adc     C7, __zero_reg__
    ret

which is one cycle faster than the previous

    ...
    adc     C5, 25
    brcc    0f
    adiw    C6, 1
0:  ret

in the case where the BRCC is not taken.
__umulhisi3 clears __zero_reg__, so all is fine.

libgcc/
* config/avr/lib1funcs.S (__muldi3_6): Tweak.

2 weeks agoAVR: Add missing SET to __mulQ64_work from previous commit.
Georg-Johann Lay [Tue, 21 Jul 2026 12:25:30 +0000 (14:25 +0200)] 
AVR: Add missing SET to __mulQ64_work from previous commit.

libgcc/
* config/avr/lib1funcs-fixed.S (__mulQ64_work): Add a
SET instruction (for signed) prior to ICALL-ing.

2 weeks agotestsuite: remove xfail "vectorized 1 loops" arm_neon [PR124726]
Torbjörn SVENSSON [Mon, 20 Jul 2026 14:30:32 +0000 (16:30 +0200)] 
testsuite: remove xfail "vectorized 1 loops" arm_neon [PR124726]

gcc/testsuite/ChangeLog:

PR testsuite/124726
* gcc.dg/vect/tsvc/vect-tsvc-s124.c: Remove xfail for arm_neon.
* gcc.dg/vect/tsvc/vect-tsvc-s276.c: Likewise.
* gcc.dg/vect/tsvc/vect-tsvc-s3111.c: Likewise.
* gcc.dg/vect/tsvc/vect-tsvc-s3113.c: Likewise.
* gcc.dg/vect/tsvc/vect-tsvc-s312.c: Likewise.
* gcc.dg/vect/tsvc/vect-tsvc-s314.c: Likewise.
* gcc.dg/vect/tsvc/vect-tsvc-s316.c: Likewise.
* gcc.dg/vect/tsvc/vect-tsvc-s317.c: Likewise.
* gcc.dg/vect/tsvc/vect-tsvc-s319.c: Likewise.
* gcc.dg/vect/tsvc/vect-tsvc-s441.c: Likewise.
* gcc.dg/vect/tsvc/vect-tsvc-s443.c: Likewise.
* gcc.dg/vect/tsvc/vect-tsvc-s453.c: Likewise.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2 weeks agotestsuite: remove xfail for arm_mve from ssa-dom-cse-2.c [PR124361]
Torbjörn SVENSSON [Mon, 20 Jul 2026 17:48:27 +0000 (19:48 +0200)] 
testsuite: remove xfail for arm_mve from ssa-dom-cse-2.c [PR124361]

gcc/testsuite/ChangeLog:

PR testsuite/124361
* gcc.dg/tree-ssa/ssa-dom-cse-2.c: Remove xfail for arm_mve.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2 weeks agolibstdc++: Handle ibm128 in generate_canonical tests.
Tomasz Kamiński [Tue, 21 Jul 2026 11:25:13 +0000 (13:25 +0200)] 
libstdc++: Handle ibm128 in generate_canonical tests.

Numeric traits for ibm128 (double-double) reports is_iec559 as true,
and thus was hitting VERIFY(false) default branch.

libstdc++-v3/ChangeLog:

* testsuite/26_numerics/random/uniform_real_distribution/operators/gencanon.cc:
Remove trailing whitespace. Handle 106 (ibm128) mantissa size.

2 weeks agoAVR: Add 64-bit fixed-point multiplications to libgcc.
Georg-Johann Lay [Tue, 21 Jul 2026 10:02:40 +0000 (12:02 +0200)] 
AVR: Add 64-bit fixed-point multiplications to libgcc.

This patch adds (un)saturated 64-bit fixed-point multiplications
to libgcc.  The saturating functions are just aliases of the
vanilla versions, which are also saturating.

libgcc/
* config/avr/t-avr (FUNCS_notiny): Add: _umulditi3_raw,
_muluda3,  _muluta3,  _muludq3, _mulda3 _multa3 _muldq3,
_muluQ64_tail, _mulQ64_work, _divsa3 _udivusa3.
* config/avr/asm-defs.h (mov8, ENTRY): New .macro's.
* config/avr/lib1funcs-fixed.S (__umulditi3_raw, __muluda3)
(__muluta3, __muludq3, __muluQ64_tail, __muldq3, __mulda3)
(__multa3, __mulQ64_work): New DEFUN's.
gcc/testsuite/
* gcc.target/avr/fx24-mul.c: New test.

2 weeks agolibstdc++: Use 2 * epsilon step for piecewise_constant_distribution tests.
Tomasz Kamiński [Tue, 21 Jul 2026 10:42:18 +0000 (12:42 +0200)] 
libstdc++: Use 2 * epsilon step for piecewise_constant_distribution tests.

This is required to pass test on powerpc64le-unknown-linux-gnu, and
was already the case for piecewise_linear_distribution.

libstdc++-v3/ChangeLog:

* testsuite/26_numerics/random/piecewise_constant_distribution/operators/accessors.cc
(test_precision_depended): Define step as 2 * epsilon().

2 weeks agoi386: Split DI<->V2DI patterns before reload with -m32.
Roger Sayle [Tue, 21 Jul 2026 08:45:15 +0000 (09:45 +0100)] 
i386: Split DI<->V2DI patterns before reload with -m32.

While investigating improvements to x86's stv2 pass (to correctly cost
moves between SI<->V4SI and DI<->V2DI), I noticed that we're currently
relatively inefficient for DI mode transfers on 32-bit targets with
SSE2, where reload ultimately decides to perform these moves via the
stack.  It's possible to do better by making the highpart and lowpart
registers explicit before reload.

Consider the test case below:

typedef long long v2di __attribute__ ((__vector_size__ (16)));

long long foo(v2di x)
{
  return x[0];
}

long long ext();
v2di mem;

void bar()
{
  long long x = ext();
  mem = (v2di){x,0};
}

where foo tests V2DI->DI mode, and bar tests DI->V2DI mode.
Currently -m32 -O2 -msse2 generates:

foo:    subl    $28, %esp
        movq    %xmm0, 8(%esp)
        movl    8(%esp), %eax
        movl    12(%esp), %edx
        addl    $28, %esp
        ret

bar: subl    $28, %esp
        call    ext
        movl    %eax, 8(%esp)
        movl    %edx, 12(%esp)
        movq    8(%esp), %xmm0
        movaps  %xmm0, mem
        addl    $28, %esp
        ret

With this patch, we now avoid going via the stack:

foo: movd    %xmm0, %eax
        pshufd  $225, %xmm0, %xmm0
        movd    %xmm0, %edx
        ret

bar: subl    $12, %esp
        call    ext
        movd    %eax, %xmm0
        movd    %edx, %xmm1
        punpckldq       %xmm1, %xmm0
        movaps  %xmm0, mem
        addl    $12, %esp
        ret

2026-07-21  Roger Sayle  <roger@nextmovesoftware.com>
    Uros Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog
* config/i386/sse.md (define_split): Split *vec_extractv2di_0_sse
before reload on !TARGET_64BIT with TARGET_SSE2.
(define_split): Likewise split *vec_concatv2di_0 before reload
on !TARGET_64BIT with TARGET_SSE2.

gcc/testsuite/ChangeLog
* gcc.target/i386/sse2-stv-7.c: New test case.
* gcc.target/i386/sse4_1-stv-13.c: Likewise.

2 weeks agolibstdc++: Introduce GLIBCXX_3.4.37 version for symbols not backported to GCC-16.
Tomasz Kamiński [Mon, 20 Jul 2026 09:53:48 +0000 (11:53 +0200)] 
libstdc++: Introduce GLIBCXX_3.4.37 version for symbols not backported to GCC-16.

As part of the backport of r17-471-ge79f0f818c0e42 and r17-2193-g50cbacfaa1e776),
the corresponding exports of chrono::__detail::__recent_leap_second_info and
specializations of basic_format_arg::_M_handle_unrecognized also need to be
introduced. This also require bump of the libtool_VERSION to 3.4.36.

This patch bumps version again to 3.4.37 and moves remaining symbols defined
in GCC 17 (basic_string's _S_allocate_at_least and _M_create_plus) to it.

libstdc++-v3/ChangeLog:

* acinclude.m4 (libtool_VERSION): Bump version.
* config/abi/pre/gnu.ver (GLIBCXX_3.4.37): Add new symbol
version and move basic_string's _S_allocate_at_least and
_M_create_plus symbols to it.
* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt:
Regenerate and include new 3.4.36 symbols.
* config/abi/post/powerpc64le-linux-gnu/baseline_symbols.txt:
Likewise.
* configure: Regenerate.
* testsuite/util/testsuite_abi.cc: Update known_versions
and latestp.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
2 weeks agox86: Don't set cum->preserve_none_abi for x86-64 MS calls
H.J. Lu [Wed, 13 May 2026 00:27:50 +0000 (08:27 +0800)] 
x86: Don't set cum->preserve_none_abi for x86-64 MS calls

In 64-bit mode, preserve_none attribute uses the same number of integer
parameters passed in registers as SYSV ABI, but with a different set of
6 registers, by setting cum->preserve_none_abi to true.  Don't set
cum->preserve_none_abi to true for MS ABI functions with preserve_none
attribute to keep the number of integer parameters passed in registers
unchanged as 4.  This treats preserve_none attribute the same way as
no_callee_saved_registers attribute for MS ABI functions.

gcc/

PR target/125297
* config/i386/i386.cc (init_cumulative_args): Don't set
cum->preserve_none_abi to true for MS ABI functions.
* doc/extend.texi: Update x86-64 preserve_none attribute
documentation.

gcc/testsuite/

PR target/125297
* gcc.target/i386/preserve-none-1.c: Skip llp64 target.
* gcc.target/i386/preserve-none-31a.c: New test.
* gcc.target/i386/preserve-none-31b.c: Likewise.
* gcc.target/i386/preserve-none-32.c: Likewise.
* gcc.target/i386/preserve-none-33a.c: Likewise.
* gcc.target/i386/preserve-none-33b.c: Likewise.
* gcc.target/i386/preserve-none-34a.c: Likewise.
* gcc.target/i386/preserve-none-34b.c: Likewise.
* gcc.target/i386/preserve-none-35a.c: Likewise.
* gcc.target/i386/preserve-none-35b.c: Likewise.
* gcc.target/i386/preserve-none-35c.c: Likewise.
* gcc.target/i386/preserve-none-35d.c: Likewise.
* gcc.target/i386/preserve-none-35e.c: Likewise.
* gcc.target/i386/preserve-none-35f.c: Likewise.
* gcc.target/i386/preserve-none-35g.c: Likewise.
* gcc.target/i386/preserve-none-36a.c: Likewise.
* gcc.target/i386/preserve-none-36b.c: Likewise.
* gcc.target/i386/preserve-none-36c.c: Likewise.
* gcc.target/i386/preserve-none-36d.c: Likewise.
* gcc.target/i386/preserve-none-36e.c: Likewise.
* gcc.target/i386/preserve-none-36f.c: Likewise.
* gcc.target/i386/preserve-none-36g.c: Likewise.
* gcc.target/i386/preserve-none-37a.c: Likewise.
* gcc.target/i386/preserve-none-37b.c: Likewise.
* gcc.target/i386/preserve-none-37c.c: Likewise.
* gcc.target/i386/preserve-none-37d.c: Likewise.
* gcc.target/i386/preserve-none-37e.c: Likewise.
* gcc.target/i386/preserve-none-37f.c: Likewise.
* gcc.target/i386/preserve-none-37g.c: Likewise.
* gcc.target/i386/preserve-none-37h.c: Likewise.
* gcc.target/i386/preserve-none-37i.c: Likewise.
* gcc.target/i386/preserve-none-37j.c: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2 weeks agoDaily bump.
GCC Administrator [Tue, 21 Jul 2026 00:16:43 +0000 (00:16 +0000)] 
Daily bump.

2 weeks agoa68: fix lowering of maxabschar [PR algol68/126330]
Jose E. Marchesi [Mon, 20 Jul 2026 21:13:56 +0000 (23:13 +0200)] 
a68: fix lowering of maxabschar [PR algol68/126330]

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog

PR algol68/126330
* a68-low-chars.cc (a68_char_max): abscharmax is an int, not a
char.

gcc/testsuite/ChangeLog

* algol68/execute/max-abs-char-1.a68: New test.

2 weeks agoc++: implement CWG3020 - Missing specification for __has_cpp_attribute(indeterminate...
Jakub Jelinek [Mon, 20 Jul 2026 21:32:40 +0000 (23:32 +0200)] 
c++: implement CWG3020 - Missing specification for __has_cpp_attribute(indeterminate) [PR126309]

The paper which introduced indeterminate attribute has not added a value
for __has_cpp_attribute, so I've missed it and didn't add it to
c_common_has_attribute.  Later CWG issue fixed this up.

2026-07-20  Jakub Jelinek  <jakub@redhat.com>

PR c++/126309
* c-lex.cc: Implement CWG3020 - Missing specification for
__has_cpp_attribute(indeterminate).
(c_common_has_attribute): Handle __has_cpp_attribute (indeterminate).

* g++.dg/cpp26/feat-cxx26.C: Test __has_cpp_attribute (indeterminate).
* g++.dg/cpp29/feat-cxx29.C: Likewise.

Reviewed-by: Jason Merrill <jason@redhat.com>
2 weeks agomatch: Combine two patterns into for neeq (ne eq) and fix typo. [PR64992]
Kael Andrew Alonzo Franco [Mon, 20 Jul 2026 20:36:19 +0000 (16:36 -0400)] 
match: Combine two patterns into for neeq (ne eq) and fix typo. [PR64992]

This simplify r13-2048 and fix typo on C being zero_one_valued_p to
X being zero_one_valued_p.

Bootstrapped and regtested on x86_64-pc-linux-gnu.

PR tree-optimization/64992

gcc/ChangeLog:

* match.pd: Combine two patterns into for neeq (ne eq) and fix typo.

Signed-off-by: Kael Andrew Franco <kaelfandrew@gmail.com>
2 weeks agoa68: new version of proc whole, dependencies and test
chris hermansen [Mon, 20 Jul 2026 16:42:15 +0000 (18:42 +0200)] 
a68: new version of proc whole, dependencies and test

A replacement for proc whole provided in the Revised Report on p.159.

Several factors motivated me to propose this replacement for the RR code.

Most importantly, the RR whole fails for an argument value of -max_int - 1, as
well as any short short, short, long or long long equivalents, because the RR
version applies the operator ABS to the argument, and on any hardware using
twos-complement representation, ABS (-max_int - 1) cannot provide a correct
positive value.  This replacement code does not apply ABS to the argument and
is therefore immune to this problem.

As well, replacement works on the argument from left to right, rather than
right to left (the approach taken in the RR version).  Working from left to
right in this way requires either:
  - processing all 10 digits (speaking of 32 bit integers for the time being),
    meaning worthless effort for every leading zero digit, or
  - determining how many significant digits there are, which means some lookup
    code (I believe this is faster but I haven't benchmarked it at this point)

Having determined beforehand how many significant digits there are, we can
allocate a working buffer of exactly the right length, which eliminates:
  - the (expensive) digit-by-digit string concatenation approach used in the RR
    version
  - the need to always ensure a long-enough fixed-length buffer should GNU Algol
    68 begin to support longer integers (128, 256, whatever)
  - the need to trim a fixed-length buffer to the desired length once the
    converted integer is in place

Finally, working left to right
  - eliminates the need to apply ABS to the number to be converted, as noted
    previously, thereby eliminating the dependency on ABS
  - replaces one (expensive) integer division with one (less expensive)
    integer multiplication using a looked-up power of 10

van Vliet's proposed whole and subwhole are more efficient than the RR version,
but still depend on ABS delivering a correct value.

Included with this replacement proc whole is a test program to ensure that the
correct results for the extreme values are produced, along with a set of
randomly chosen other values distributed across the range.

Signed-off-by: Chris Hermansen <clhermansen@gmail.com>
libga68/ChangeLog

* standard.a68.in (Integer): New mode.
(whole_max_entry): New variable.
(whole_p10): Likewise.
(whole_stop_after): Likewise.
(whole_powers_of_10): Likewise.
(WHOLEDIGITS): New operator.
(whole): Rewrite.
(subwhole): Likewise.

gcc/testsuite/ChangeLog

* algol68/execute/whole-1.a68: New test.

2 weeks agobpf: TARGET_INSN_COST: don't hardcode 1 for default ...
Vineet Gupta [Mon, 20 Jul 2026 18:00:56 +0000 (11:00 -0700)] 
bpf: TARGET_INSN_COST: don't hardcode 1 for default ...

... instead use pattern_cost () as used by other backends

gcc/ChangeLog:

* config/bpf/bpf.cc (bpf_insn_cost): Return pattern_cost () by default.

Signed-off-by: Vineet Gupta <vineet.gupta@linux.dev>
2 weeks agobpf: TARGET_RTX_COSTS: treat 32-bit CONST_INT as cheap/free
Vineet Gupta [Mon, 20 Jul 2026 17:59:20 +0000 (10:59 -0700)] 
bpf: TARGET_RTX_COSTS: treat 32-bit CONST_INT as cheap/free

This is to prefer constant return to be setup from imm constant vs.
using a prior reg known to have the same value (by control flow analysis).
While there's nothing wrong with existing approach, it can sometimes leads
to additional sign-extensions and other corner cases which trip up the
bpf kernel verifier bounds checking for return reg.The verifier improvements
are being worked on but lets adjust the cost model anyways so that constants
are favored. There's no additional overhead from new codegen anyways.

For accompanying test const-cost-model.c, at -O2

          Before               |            After
-------------------------------+------------------------------
  r1 = 4                       |  r1 = 4
  call bpf_copy_from_user_str  |  call bpf_copy_from_user_str
  r1 = (s32) r0                |  ...
  ...                          |  r1 = 4                          <---
  call bpf_copy_from_user_str  |  call bpf_copy_from_user_str

This causes 4 additioanl bpf kernel selftests to pass (as of v7.1)

| -Summary: 596/5387 PASSED, 123 SKIPPED, 114 FAILED
| +Summary: 600/5422 PASSED, 123 SKIPPED, 110 FAILED
|  #77      cgroup_xattr:OK
|  #112     exe_ctx:OK
|  #220     mem_rdonly_untrusted:OK
|  #574     verifier_global_ptr_args:OK

gcc/ChangeLog:

* config/bpf/bpf.cc (bpf_rtx_costs): set CONST_INT 0 insns.
* config/bpf/bpf.h (BPF_IMM32_P): New helper macro.
* config/bpf/predicates.md (imm32_operand): Use new macro.

gcc/testsuite/ChangeLog:

* gcc.target/bpf/const-cost-model.c: New test prefers const.
* gcc.target/bpf/const-cost-model-2.c: New test prefers const.

Signed-off-by: Vineet Gupta <vineet.gupta@linux.dev>
2 weeks agobpf: TARGET_RTX_COSTS: avoid multiply synthesis
Vineet Gupta [Mon, 20 Jul 2026 17:58:31 +0000 (10:58 -0700)] 
bpf: TARGET_RTX_COSTS: avoid multiply synthesis

The default cost of MULT/DIV/MOD in rtx_cost () is high: 5,7 insns
respectively. This causes even a trivial mpy by 7 to be synthesized.
Given these have direct equivalents in BPF ISA, fix the cost to generate
native BPF insns.

Note the existing divmod-licall-2.c test was a bit fragile as it forced
cast signed an actual unsigned int which is provably non-negative.
In the new cost model compiler would generate a native unsigned divide
even though it not available for -mcpu=v3, tripping up the test.
Fix by ensuring the arg is actually signed.

gcc/ChangeLog:

* config/bpf/bpf.cc (bpf_rtx_costs): Assign MPY/DIV/MOD cost 1.

gcc/testsuite/ChangeLog:

* gcc.target/bpf/divmod-libcall-2.c: Change args/ret to signed.
* gcc.target/bpf/mult-large.c: New test.
* gcc.target/bpf/mult-small.c: New test.

Signed-off-by: Vineet Gupta <vineet.gupta@linux.dev>
2 weeks agocobol: Insert "Do not edit" text into generated DejaGNU tests.
Robert Dubner [Mon, 20 Jul 2026 17:17:25 +0000 (13:17 -0400)] 
cobol: Insert "Do not edit" text into generated DejaGNU tests.

The tests in gcc/testsuite/cobol.dg/group2 are created by a script from a
larger set of autotest tests.  After a brief comedy of procedural errors, we
decided to incorporate "Do not edit" comments into those tests.

gcc/cobol/ChangeLog:

* copybook.h (_COPYBOOK_H): Remove #include <sys/types.h>.
* gcobol.1: Documentation.
* parse.y: Use int_size_in_bytes.
* util.cc (cobol_filename): Change dbgmsg formatting.

gcc/testsuite/ChangeLog:

* cobol.dg/group2/37-digit_Initialization_of_fundamental_types.cob:
Start the test with a "Do not edit" comment.
* cobol.dg/group2/88_level_with_FALSE_IS_clause.cob: Likewise.
* cobol.dg/group2/88_level_with_FILLER.cob: Likewise.
* cobol.dg/group2/88_level_with_THRU.cob: Likewise.
* cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__1_.cob: Likewise.
* cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__2_.cob: Likewise.
* cobol.dg/group2/ACCEPT_FROM_ENVIRONMENT-NAME.cob: Likewise.
* cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__1_.cob: Likewise.
* cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.cob: Likewise.
* cobol.dg/group2/ACCEPT_foo_FROM_COMMAND-LINE_1_.cob: Likewise.
* cobol.dg/group2/ADD_1_2_TO_3_GIVING_B.cob: Likewise.
* cobol.dg/group2/ADD_CORRESPONDING.cob: Likewise.
* cobol.dg/group2/ADD_SUBTRACT_CORR_mixed_fix___float.cob: Likewise.
* cobol.dg/group2/ALLOCATE_Rules_6_-_9._Without_OPTION_INITIALIZE_Without_-fdefaultbyte___ASCII_.cob:
Likewise.
* cobol.dg/group2/ALLOCATE_Rules_6_-_9._Without_OPTION_INITIALIZE_Without_-fdefaultbyte___EBCDIC_.cob:
Likewise.
* cobol.dg/group2/ALLOCATE_Rules_6_-_9_Without_OPTION_INITIALIZE_With_-fdefaultbyte___UTF16_.cob:
Likewise.
* cobol.dg/group2/ALLOCATE___FREE_basic_default_versions.cob: Likewise.
* cobol.dg/group2/ALLOCATE___FREE_with_BASED_item__1_.cob: Likewise.
* cobol.dg/group2/ALLOCATE___FREE_with_BASED_item__2_.cob: Likewise.
* cobol.dg/group2/ALPHABETIC-LOWER_test.cob: Likewise.
* cobol.dg/group2/ALPHABETIC-UPPER_test.cob: Likewise.
* cobol.dg/group2/ALPHABETIC_test.cob: Likewise.
* cobol.dg/group2/ANY_LENGTH__1_.cob: Likewise.
* cobol.dg/group2/ANY_LENGTH__2_.cob: Likewise.
* cobol.dg/group2/ANY_LENGTH__3_.cob: Likewise.
* cobol.dg/group2/ANY_LENGTH__4_.cob: Likewise.
* cobol.dg/group2/ANY_LENGTH__5_.cob: Likewise.
* cobol.dg/group2/ANY_LENGTH__7_.cob: Likewise.
* cobol.dg/group2/Alphanumeric_MOVE_with_truncation.cob: Likewise.
* cobol.dg/group2/Alphanumeric_and_binary_numeric.cob: Likewise.
* cobol.dg/group2/Assorted_SPECIAL-NAMES_CLASS.cob: Likewise.
* cobol.dg/group2/BINARY_and_COMP-5__little-endian_.cob: Likewise.
* cobol.dg/group2/BLANK_WHEN_ZERO.cob: Likewise.
* cobol.dg/group2/CALL_with_OCCURS_DEPENDING_ON.cob: Likewise.
* cobol.dg/group2/CALL_with_OMITTED_parameter.cob: Likewise.
* cobol.dg/group2/CBL_ALLOC_MEM___CBL_FREE_MEM.cob: Likewise.
* cobol.dg/group2/CBL_CHECK_FILE_EXIST.cob: Likewise.
* cobol.dg/group2/CBL_CREATE_FILE___CBL_WRITE_FILE___CBL_CLOSE_FILE.cob: Likewise.
* cobol.dg/group2/CBL_DELETE_FILE.cob: Likewise.
* cobol.dg/group2/CBL_OPEN_FILE___CBL_CLOSE_FILE.cob: Likewise.
* cobol.dg/group2/CBL_OPEN_FILE___CBL_READ_FILE___CBL_CLOSE_FILE.cob: Likewise.
* cobol.dg/group2/CBL_READ_FILE__check_file_size_with_flags___128.cob: Likewise.
* cobol.dg/group2/CDF2_-_DEFINE_FOO_AS_literal-1.cob: Likewise.
* cobol.dg/group2/CDF2_Trouble_with___IF__1_.cob: Likewise.
* cobol.dg/group2/CDF2_Trouble_with___IF__2_.cob: Likewise.
* cobol.dg/group2/CDF4_.cob: Likewise.
* cobol.dg/group2/CDF_Feature_.cob: Likewise.
* cobol.dg/group2/CDF_IS_NOT_DEFINED.cob: Likewise.
* cobol.dg/group2/CDF__1__IF____text_.cob: Likewise.
* cobol.dg/group2/CDF__2__IF____number_.cob: Likewise.
* cobol.dg/group2/CDF__3__ALL_NUMERIC_COMPARISONS.cob: Likewise.
* cobol.dg/group2/CHAR_and_ORD_with_COLLATING_sequence_-_ASCII.cob: Likewise.
* cobol.dg/group2/CHAR_and_ORD_with_COLLATING_sequence_-_EBCDIC.cob: Likewise.
* cobol.dg/group2/COMP-3_to_COMP-3__IN-PHASE__MOVES.cob: Likewise.
* cobol.dg/group2/COMP-3_to_COMP-3__OUT-OF-PHASE__MOVES.cob: Likewise.
* cobol.dg/group2/COMP-3_to_COMP-3_size_error.cob: Likewise.
* cobol.dg/group2/COMP-3_to_numeric-display_size_error.cob: Likewise.
* cobol.dg/group2/COMP-5_Sanity_Check_.cob: Likewise.
* cobol.dg/group2/COMP-6_arithmetic.cob: Likewise.
* cobol.dg/group2/COMP-6_numeric_test.cob: Likewise.
* cobol.dg/group2/COMP-6_used_with_DISPLAY.cob: Likewise.
* cobol.dg/group2/COMP-6_used_with_MOVE.cob: Likewise.
* cobol.dg/group2/COMPUTE_multiplication_to_FIX4.cob: Likewise.
* cobol.dg/group2/CONTINUE_AFTER_1_SECONDS.cob: Likewise.
* cobol.dg/group2/CURRENCY_SIGN.cob: Likewise.
* cobol.dg/group2/CURRENCY_SIGN_WITH_PICTURE_SYMBOL.cob: Likewise.
* cobol.dg/group2/Check_for_equality_of_COMP-1___COMP-2.cob: Likewise.
* cobol.dg/group2/Checking_IS_NUMERIC.cob: Likewise.
* cobol.dg/group2/Class_check_with_reference_modification.cob: Likewise.
* cobol.dg/group2/Clear_negative_zero_after_truncated_MOVE.cob: Likewise.
* cobol.dg/group2/Compare_COMP-2_with_floating-point_literal.cob: Likewise.
* cobol.dg/group2/Complex_EVALUATE__1_.cob: Likewise.
* cobol.dg/group2/Complex_EVALUATE__2_.cob: Likewise.
* cobol.dg/group2/Complex_HEX__VALUE_and_MOVE_-_ASCII_EBCDIC.cob: Likewise.
* cobol.dg/group2/Complex_IF.cob: Likewise.
* cobol.dg/group2/Complex_INITIALIZE_with_nested_tables__1_.cob: Likewise.
* cobol.dg/group2/Complex_INITIALIZE_with_nested_tables__2_.cob: Likewise.
* cobol.dg/group2/Concatenation_operator.cob: Likewise.
* cobol.dg/group2/Contained_program_visibility__3_.cob: Likewise.
* cobol.dg/group2/Contained_program_visibility__4_.cob: Likewise.
* cobol.dg/group2/Context_sensitive_words__1_.cob: Likewise.
* cobol.dg/group2/Context_sensitive_words__2_.cob: Likewise.
* cobol.dg/group2/Context_sensitive_words__3_.cob: Likewise.
* cobol.dg/group2/Context_sensitive_words__4_.cob: Likewise.
* cobol.dg/group2/Context_sensitive_words__5_.cob: Likewise.
* cobol.dg/group2/Context_sensitive_words__6_.cob: Likewise.
* cobol.dg/group2/Context_sensitive_words__7_.cob: Likewise.
* cobol.dg/group2/Context_sensitive_words__8_.cob: Likewise.
* cobol.dg/group2/DEBUG-ITEM_using_mh_identical.cob: Likewise.
* cobol.dg/group2/DEBUG_Line.cob: Likewise.
* cobol.dg/group2/DECIMAL-POINT_is_COMMA__1_.cob: Likewise.
* cobol.dg/group2/DECIMAL-POINT_is_COMMA__2_.cob: Likewise.
* cobol.dg/group2/DECIMAL-POINT_is_COMMA__3_.cob: Likewise.
* cobol.dg/group2/DECIMAL-POINT_is_COMMA__4_.cob: Likewise.
* cobol.dg/group2/DECIMAL-POINT_is_COMMA__5_.cob: Likewise.
* cobol.dg/group2/DISPLAY_IBM-formatted_COMP-1_and_COMP-2.cob: Likewise.
* cobol.dg/group2/DISPLAY__Sign_ASCII__2_.cob: Likewise.
* cobol.dg/group2/DISPLAY_and_assignment_NumericDisplay.cob: Likewise.
* cobol.dg/group2/DISPLAY_data_items_with_MOVE_statement.cob: Likewise.
* cobol.dg/group2/DISPLAY_data_items_with_VALUE_clause.cob: Likewise.
* cobol.dg/group2/DISPLAY_literals__DECIMAL-POINT_is_COMMA.cob: Likewise.
* cobol.dg/group2/DIVIDE_binary-long_giving_remainder.cob: Likewise.
* cobol.dg/group2/DIVIDE_numeric-display_giving_remainder.cob: Likewise.
* cobol.dg/group2/Default_Arithmetic__1_.cob: Likewise.
* cobol.dg/group2/Dynamic_reference_modification.cob: Likewise.
* cobol.dg/group2/EC-BOUND-REF-MOD_checking_process_termination.cob: Likewise.
* cobol.dg/group2/EC-SIZE-TRUNCATION_EC-SIZE-OVERFLOW.cob: Likewise.
* cobol.dg/group2/EC-SIZE-ZERO-DIVIDE__fixed_and_float.cob: Likewise.
* cobol.dg/group2/ENTRY_statement.cob: Likewise.
* cobol.dg/group2/EVALUATE_WHEN_NEGATIVE.cob: Likewise.
* cobol.dg/group2/EVALUATE__A__OR__a_.cob: Likewise.
* cobol.dg/group2/EVALUATE_condition__1_.cob: Likewise.
* cobol.dg/group2/EVALUATE_condition__2_.cob: Likewise.
* cobol.dg/group2/EVALUATE_doubled_WHEN.cob: Likewise.
* cobol.dg/group2/EVALUATE_with_WHEN_using_condition-1.cob: Likewise.
* cobol.dg/group2/EXIT_PARAGRAPH.cob: Likewise.
* cobol.dg/group2/EXIT_PERFORM.cob: Likewise.
* cobol.dg/group2/EXIT_PERFORM_CYCLE.cob: Likewise.
* cobol.dg/group2/EXIT_SECTION.cob: Likewise.
* cobol.dg/group2/FIND-STRING__forward_.cob: Likewise.
* cobol.dg/group2/FIND-STRING__reverse_.cob: Likewise.
* cobol.dg/group2/FIXED_FORMAT_data_in_cols_73_and_beyond.cob: Likewise.
* cobol.dg/group2/FIXED_FORMAT_data_misplaced_asterisk.cob: Likewise.
* cobol.dg/group2/FLOAT-LONG_with_SIZE_ERROR.cob: Likewise.
* cobol.dg/group2/FLOAT-SHORT___FLOAT-LONG_w_o_SIZE_ERROR.cob: Likewise.
* cobol.dg/group2/FLOAT-SHORT_with_SIZE_ERROR.cob: Likewise.
* cobol.dg/group2/FUNCTION_ABS.cob: Likewise.
* cobol.dg/group2/FUNCTION_ACOS.cob: Likewise.
* cobol.dg/group2/FUNCTION_ALL_INTRINSIC_simple_test.cob: Likewise.
* cobol.dg/group2/FUNCTION_ANNUITY.cob: Likewise.
* cobol.dg/group2/FUNCTION_ASIN.cob: Likewise.
* cobol.dg/group2/FUNCTION_ATAN.cob: Likewise.
* cobol.dg/group2/FUNCTION_BIGGER-POINTER.cob: Likewise.
* cobol.dg/group2/FUNCTION_BIGGER-POINTER__2_.cob: Likewise.
* cobol.dg/group2/FUNCTION_BYTE-LENGTH.cob: Likewise.
* cobol.dg/group2/FUNCTION_CHAR.cob: Likewise.
* cobol.dg/group2/FUNCTION_COMBINED-DATETIME.cob: Likewise.
* cobol.dg/group2/FUNCTION_CONCAT___CONCATENATE.cob: Likewise.
* cobol.dg/group2/FUNCTION_CONCAT_with_reference_modding.cob: Likewise.
* cobol.dg/group2/FUNCTION_CONVERT.cob: Likewise.
* cobol.dg/group2/FUNCTION_COS.cob: Likewise.
* cobol.dg/group2/FUNCTION_CURRENT-DATE.cob: Likewise.
* cobol.dg/group2/FUNCTION_DATE-OF-INTEGER.cob: Likewise.
* cobol.dg/group2/FUNCTION_DATE-TO-YYYYMMDD.cob: Likewise.
* cobol.dg/group2/FUNCTION_DATE___TIME_OMNIBUS.cob: Likewise.
* cobol.dg/group2/FUNCTION_DAY-OF-INTEGER.cob: Likewise.
* cobol.dg/group2/FUNCTION_DAY-TO-YYYYDDD.cob: Likewise.
* cobol.dg/group2/FUNCTION_E.cob: Likewise.
* cobol.dg/group2/FUNCTION_EXCEPTION-FILE.cob: Likewise.
* cobol.dg/group2/FUNCTION_EXCEPTION-STATEMENT.cob: Likewise.
* cobol.dg/group2/FUNCTION_EXCEPTION-STATUS.cob: Likewise.
* cobol.dg/group2/FUNCTION_EXP.cob: Likewise.
* cobol.dg/group2/FUNCTION_EXP10.cob: Likewise.
* cobol.dg/group2/FUNCTION_FACTORIAL.cob: Likewise.
* cobol.dg/group2/FUNCTION_FORMATTED-DATE.cob: Likewise.
* cobol.dg/group2/FUNCTION_FORMATTED-DATETIME.cob: Likewise.
* cobol.dg/group2/FUNCTION_FORMATTED-DATETIME_with_ref_modding.cob: Likewise.
* cobol.dg/group2/FUNCTION_FORMATTED-DATE_TIME_DATETIME.cob: Likewise.
* cobol.dg/group2/FUNCTION_FORMATTED-DATE_with_ref_modding.cob: Likewise.
* cobol.dg/group2/FUNCTION_FORMATTED-TIME_DP.COMMA.cob: Likewise.
* cobol.dg/group2/FUNCTION_FORMATTED-TIME_with_ref_modding.cob: Likewise.
* cobol.dg/group2/FUNCTION_FRACTION-PART.cob: Likewise.
* cobol.dg/group2/FUNCTION_HEX-OF.cob: Likewise.
* cobol.dg/group2/FUNCTION_HIGHEST-ALGEBRAIC.cob: Likewise.
* cobol.dg/group2/FUNCTION_INTEGER-OF-DATE.cob: Likewise.
* cobol.dg/group2/FUNCTION_INTEGER-OF-DAY.cob: Likewise.
* cobol.dg/group2/FUNCTION_INTEGER-OF-FORMATTED-DATE.cob: Likewise.
* cobol.dg/group2/FUNCTION_INTEGER-PART.cob: Likewise.
* cobol.dg/group2/FUNCTION_INTEGER.cob: Likewise.
* cobol.dg/group2/FUNCTION_LENGTH__1_.cob: Likewise.
* cobol.dg/group2/FUNCTION_LENGTH__2_.cob: Likewise.
* cobol.dg/group2/FUNCTION_LOCALE-COMPARE.cob: Likewise.
* cobol.dg/group2/FUNCTION_LOCALE-DATE.cob: Likewise.
* cobol.dg/group2/FUNCTION_LOCALE-TIME-FROM-SECONDS.cob: Likewise.
* cobol.dg/group2/FUNCTION_LOCALE-TIME.cob: Likewise.
* cobol.dg/group2/FUNCTION_LOG.cob: Likewise.
* cobol.dg/group2/FUNCTION_LOG10.cob: Likewise.
* cobol.dg/group2/FUNCTION_LOWER-CASE.cob: Likewise.
* cobol.dg/group2/FUNCTION_LOWER-CASE_with_reference_modding.cob: Likewise.
* cobol.dg/group2/FUNCTION_LOWEST-ALGEBRAIC.cob: Likewise.
* cobol.dg/group2/FUNCTION_MAX.cob: Likewise.
* cobol.dg/group2/FUNCTION_MEAN.cob: Likewise.
* cobol.dg/group2/FUNCTION_MEDIAN.cob: Likewise.
* cobol.dg/group2/FUNCTION_MIDRANGE.cob: Likewise.
* cobol.dg/group2/FUNCTION_MIN.cob: Likewise.
* cobol.dg/group2/FUNCTION_MODULE-NAME.cob: Likewise.
* cobol.dg/group2/FUNCTION_MOD__invalid_.cob: Likewise.
* cobol.dg/group2/FUNCTION_MOD__valid_.cob: Likewise.
* cobol.dg/group2/FUNCTION_NUMVAL-C.cob: Likewise.
* cobol.dg/group2/FUNCTION_NUMVAL-C_DP.COMMA.cob: Likewise.
* cobol.dg/group2/FUNCTION_NUMVAL-F.cob: Likewise.
* cobol.dg/group2/FUNCTION_NUMVAL.cob: Likewise.
* cobol.dg/group2/FUNCTION_ORD-MAX.cob: Likewise.
* cobol.dg/group2/FUNCTION_ORD-MIN.cob: Likewise.
* cobol.dg/group2/FUNCTION_ORD.cob: Likewise.
* cobol.dg/group2/FUNCTION_PI.cob: Likewise.
* cobol.dg/group2/FUNCTION_PRESENT-VALUE.cob: Likewise.
* cobol.dg/group2/FUNCTION_RANDOM.cob: Likewise.
* cobol.dg/group2/FUNCTION_RANGE.cob: Likewise.
* cobol.dg/group2/FUNCTION_REM__invalid_.cob: Likewise.
* cobol.dg/group2/FUNCTION_REM__valid_.cob: Likewise.
* cobol.dg/group2/FUNCTION_REVERSE.cob: Likewise.
* cobol.dg/group2/FUNCTION_REVERSE_with_reference_modding.cob: Likewise.
* cobol.dg/group2/FUNCTION_SECONDS-FROM-FORMATTED-TIME.cob: Likewise.
* cobol.dg/group2/FUNCTION_SECONDS-PAST-MIDNIGHT.cob: Likewise.
* cobol.dg/group2/FUNCTION_SIGN.cob: Likewise.
* cobol.dg/group2/FUNCTION_SIN.cob: Likewise.
* cobol.dg/group2/FUNCTION_SQRT.cob: Likewise.
* cobol.dg/group2/FUNCTION_SQRT__2_.cob: Likewise.
* cobol.dg/group2/FUNCTION_STANDARD-DEVIATION.cob: Likewise.
* cobol.dg/group2/FUNCTION_SUBSTITUTE-CASE.cob: Likewise.
* cobol.dg/group2/FUNCTION_SUBSTITUTE-CASE_with_reference_mod.cob: Likewise.
* cobol.dg/group2/FUNCTION_SUBSTITUTE.cob: Likewise.
* cobol.dg/group2/FUNCTION_SUBSTITUTE_with_reference_modding.cob: Likewise.
* cobol.dg/group2/FUNCTION_SUM.cob: Likewise.
* cobol.dg/group2/FUNCTION_TAN.cob: Likewise.
* cobol.dg/group2/FUNCTION_TEST-DATE-YYYYMMDD.cob: Likewise.
* cobol.dg/group2/FUNCTION_TEST-DAY-YYYYDDD__1_.cob: Likewise.
* cobol.dg/group2/FUNCTION_TEST-DAY-YYYYDDD__2_.cob: Likewise.
* cobol.dg/group2/FUNCTION_TEST-FORMATTED-DATETIME_DP.COMMA.cob: Likewise.
* cobol.dg/group2/FUNCTION_TEST-FORMATTED-DATETIME_additional.cob: Likewise.
* cobol.dg/group2/FUNCTION_TEST-FORMATTED-DATETIME_with_dates.cob: Likewise.
* cobol.dg/group2/FUNCTION_TEST-FORMATTED-DATETIME_with_datetimes.cob: Likewise.
* cobol.dg/group2/FUNCTION_TEST-FORMATTED-DATETIME_with_times.cob: Likewise.
* cobol.dg/group2/FUNCTION_TEST-NUMVAL-C.cob: Likewise.
* cobol.dg/group2/FUNCTION_TEST-NUMVAL-F.cob: Likewise.
* cobol.dg/group2/FUNCTION_TEST-NUMVAL.cob: Likewise.
* cobol.dg/group2/FUNCTION_TRIM.cob: Likewise.
* cobol.dg/group2/FUNCTION_TRIM_with_NATIONAL_characters.cob: Likewise.
* cobol.dg/group2/FUNCTION_TRIM_with_extra_characters.cob: Likewise.
* cobol.dg/group2/FUNCTION_TRIM_with_reference_modding.cob: Likewise.
* cobol.dg/group2/FUNCTION_TRIM_zero_length.cob: Likewise.
* cobol.dg/group2/FUNCTION_UPPER-CASE.cob: Likewise.
* cobol.dg/group2/FUNCTION_UPPER-CASE_with_reference_modding.cob: Likewise.
* cobol.dg/group2/FUNCTION_VARIANCE.cob: Likewise.
* cobol.dg/group2/FUNCTION_WHEN-COMPILED.cob: Likewise.
* cobol.dg/group2/FUNCTION_YEAR-TO-YYYY.cob: Likewise.
* cobol.dg/group2/FUNCTION_as_CALL_parameter_BY_CONTENT.cob: Likewise.
* cobol.dg/group2/Fixed_continuation_indicator.cob: Likewise.
* cobol.dg/group2/Floating_continuation_indicator__1_.cob: Likewise.
* cobol.dg/group2/Fundamental_INSPECT_BACKWARD_REPLACING.cob: Likewise.
* cobol.dg/group2/Fundamental_INSPECT_BACKWARD_TALLYING.cob: Likewise.
* cobol.dg/group2/Fundamental_INSPECT_REPLACING.cob: Likewise.
* cobol.dg/group2/Fundamental_INSPECT_TALLYING.cob: Likewise.
* cobol.dg/group2/GCC_125616_RT3601_-_IBM_incorrect_DISPLAY_of_COMP-1_COMP-2_float.cob:
Likewise.
* cobol.dg/group2/GLOBAL_FD__1_.cob: Likewise.
* cobol.dg/group2/GLOBAL_FD__2_.cob: Likewise.
* cobol.dg/group2/GLOBAL_FD__3_.cob: Likewise.
* cobol.dg/group2/GLOBAL_FD__4_.cob: Likewise.
* cobol.dg/group2/GLOBAL_at_lower_level.cob: Likewise.
* cobol.dg/group2/GLOBAL_at_same_level.cob: Likewise.
* cobol.dg/group2/Hexadecimal_literal.cob: Likewise.
* cobol.dg/group2/IBM_dialect_COMP_redefined_by_POINTER_as_64-bit.cob: Likewise.
* cobol.dg/group2/INITIALIZE_OCCURS_with_SIGN_LEADING___TRAILING.cob: Likewise.
* cobol.dg/group2/INITIALIZE_OCCURS_with_numeric_edited.cob: Likewise.
* cobol.dg/group2/INITIALIZE_complex_group__1_.cob: Likewise.
* cobol.dg/group2/INITIALIZE_complex_group__2_.cob: Likewise.
* cobol.dg/group2/INITIALIZE_group_entry_with_OCCURS.cob: Likewise.
* cobol.dg/group2/INITIALIZE_of_EXTERNAL_data_items.cob: Likewise.
* cobol.dg/group2/INITIALIZE_with_-defaultbyte__ASCII_.cob: Likewise.
* cobol.dg/group2/INITIALIZE_with_-defaultbyte__EBCDIC_.cob: Likewise.
* cobol.dg/group2/INITIALIZE_with_FILLER.cob: Likewise.
* cobol.dg/group2/INITIALIZE_with_REDEFINES.cob: Likewise.
* cobol.dg/group2/INITIALIZE_with_reference_modification.cob: Likewise.
* cobol.dg/group2/INSPECT_BACKWARD_REPLACING_LEADING.cob: Likewise.
* cobol.dg/group2/INSPECT_BACKWARD_REPLACING_TRAILING.cob: Likewise.
* cobol.dg/group2/INSPECT_BACKWARD_simple_CONVERTING.cob: Likewise.
* cobol.dg/group2/INSPECT_BACKWARD_simple_REPLACING.cob: Likewise.
* cobol.dg/group2/INSPECT_BACKWARD_simple_TALLYING.cob: Likewise.
* cobol.dg/group2/INSPECT_CONVERTING_NULL.cob: Likewise.
* cobol.dg/group2/INSPECT_CONVERTING_TO_figurative_constant.cob: Likewise.
* cobol.dg/group2/INSPECT_CONVERTING_TO_figurative_constants.cob: Likewise.
* cobol.dg/group2/INSPECT_ISO_Example_1.cob: Likewise.
* cobol.dg/group2/INSPECT_ISO_Example_2.cob: Likewise.
* cobol.dg/group2/INSPECT_ISO_Example_3.cob: Likewise.
* cobol.dg/group2/INSPECT_ISO_Example_4.cob: Likewise.
* cobol.dg/group2/INSPECT_ISO_Example_5-f.cob: Likewise.
* cobol.dg/group2/INSPECT_ISO_Example_5-r.cob: Likewise.
* cobol.dg/group2/INSPECT_ISO_Example_5.cob: Likewise.
* cobol.dg/group2/INSPECT_ISO_Example_6.cob: Likewise.
* cobol.dg/group2/INSPECT_ISO_Example_7.cob: Likewise.
* cobol.dg/group2/INSPECT_No_repeat_conversion_check.cob: Likewise.
* cobol.dg/group2/INSPECT_REPLACING_LEADING_ZEROS_BY_SPACES.cob: Likewise.
* cobol.dg/group2/INSPECT_REPLACING_figurative_constant.cob: Likewise.
* cobol.dg/group2/INSPECT_TALLYING_AFTER.cob: Likewise.
* cobol.dg/group2/INSPECT_TALLYING_BEFORE.cob: Likewise.
* cobol.dg/group2/INSPECT_TALLYING_REPLACING_ISO_Example.cob: Likewise.
* cobol.dg/group2/INSPECT_TRAILING.cob: Likewise.
* cobol.dg/group2/Index_and_parenthesized_expression.cob: Likewise.
* cobol.dg/group2/Indicators_______________-____D__.cob: Likewise.
* cobol.dg/group2/Intrinsic_Function_ABS.cob: Likewise.
* cobol.dg/group2/Intrinsic_Function_ACOS.cob: Likewise.
* cobol.dg/group2/Intrinsic_Function_ANNUITY.cob: Likewise.
* cobol.dg/group2/Intrinsic_Function_DATE-YYYYMMDD.cob: Likewise.
* cobol.dg/group2/Intrinsic_Function_NUMVAL.cob: Likewise.
* cobol.dg/group2/Intrinsics_without_FUNCTION_keyword__3_.cob: Likewise.
* cobol.dg/group2/LENGTH_OF_omnibus.cob: Likewise.
* cobol.dg/group2/LOCAL-STORAGE__3__with_recursive_PROGRAM-ID.cob: Likewise.
* cobol.dg/group2/LOCAL-STORAGE__4__with_recursive_PROGRAM-ID_..._USING.cob: Likewise.
* cobol.dg/group2/Large_PIC_10000000_.cob: Likewise.
* cobol.dg/group2/Length_overflow__1_.cob: Likewise.
* cobol.dg/group2/Length_overflow__2_.cob: Likewise.
* cobol.dg/group2/Length_overflow_with_offset__1_.cob: Likewise.
* cobol.dg/group2/Length_overflow_with_offset__2_.cob: Likewise.
* cobol.dg/group2/Length_overflow_with_offset__3_.cob: Likewise.
* cobol.dg/group2/Long_Division.cob: Likewise.
* cobol.dg/group2/MOVE_LEVEL_78.cob: Likewise.
* cobol.dg/group2/MOVE_NumericDisplay_to_COMP-3.cob: Likewise.
* cobol.dg/group2/MOVE_X_000203_.cob: Likewise.
* cobol.dg/group2/MOVE_Z_literal_.cob: Likewise.
* cobol.dg/group2/MOVE_indexes.cob: Likewise.
* cobol.dg/group2/MOVE_integer_literal_to_alphanumeric.cob: Likewise.
* cobol.dg/group2/MOVE_to_JUSTIFIED_items.cob: Likewise.
* cobol.dg/group2/MOVE_to_edited_item__1_.cob: Likewise.
* cobol.dg/group2/MOVE_to_edited_item__2_.cob: Likewise.
* cobol.dg/group2/MOVE_to_item_with_simple_and_floating_insertion.cob: Likewise.
* cobol.dg/group2/MOVE_to_itself.cob: Likewise.
* cobol.dg/group2/MOVE_with_group_refmod.cob: Likewise.
* cobol.dg/group2/MOVE_with_refmod.cob: Likewise.
* cobol.dg/group2/MOVE_with_refmod__variable_.cob: Likewise.
* cobol.dg/group2/MULTIPLY_BY_literal_in_INITIAL_program.cob: Likewise.
* cobol.dg/group2/MULTIPLY_to_FIX4.cob: Likewise.
* cobol.dg/group2/Multi-target_MOVE_with_subscript_re-evaluation.cob: Likewise.
* cobol.dg/group2/Multiple_INDEXED_BY_variables_with_the_same_name.cob: Likewise.
* cobol.dg/group2/N-Queens_algorithm.cob: Likewise.
* cobol.dg/group2/Named_conditionals_-_fixed__float__and_alphabetic.cob: Likewise.
* cobol.dg/group2/Nested_PERFORM.cob: Likewise.
* cobol.dg/group2/Non-numeric_data_in_numeric-display__1_.cob: Likewise.
* cobol.dg/group2/Non-numeric_data_in_packed_decimal.cob: Likewise.
* cobol.dg/group2/Non-overflow_after_overflow.cob: Likewise.
* cobol.dg/group2/Numeric-display_sign_encoding__2_.cob: Likewise.
* cobol.dg/group2/Numeric-display_sign_encoding_sanity_check.cob: Likewise.
* cobol.dg/group2/Numeric_operations__1_.cob: Likewise.
* cobol.dg/group2/Numeric_operations__2_.cob: Likewise.
* cobol.dg/group2/Numeric_operations__3_.cob: Likewise.
* cobol.dg/group2/Numeric_operations__4_.cob: Likewise.
* cobol.dg/group2/Numeric_operations__5_.cob: Likewise.
* cobol.dg/group2/Numeric_operations__6_.cob: Likewise.
* cobol.dg/group2/Numeric_operations__7_.cob: Likewise.
* cobol.dg/group2/Numeric_operations__8_.cob: Likewise.
* cobol.dg/group2/OCCURS_clause_with_1_entry.cob: Likewise.
* cobol.dg/group2/OSVS_Arithmetic_Test__2_.cob: Likewise.
* cobol.dg/group2/Occurs_DEPENDING_ON__source_and_dest.cob: Likewise.
* cobol.dg/group2/Offset_overflow.cob: Likewise.
* cobol.dg/group2/Offset_underflow.cob: Likewise.
* cobol.dg/group2/Overlapping_MOVE.cob: Likewise.
* cobol.dg/group2/PACKED-DECIMAL_arithmetic.cob: Likewise.
* cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__1_.cob: Likewise.
* cobol.dg/group2/PACKED-DECIMAL_basic_comp-3_comp-6__2_.cob: Likewise.
* cobol.dg/group2/PACKED-DECIMAL_dump.cob: Likewise.
* cobol.dg/group2/PACKED-DECIMAL_numeric_test__1_.cob: Likewise.
* cobol.dg/group2/PACKED-DECIMAL_numeric_test__2_.cob: Likewise.
* cobol.dg/group2/PACKED-DECIMAL_used_with_DISPLAY.cob: Likewise.
* cobol.dg/group2/PACKED-DECIMAL_used_with_INITIALIZE.cob: Likewise.
* cobol.dg/group2/PACKED-DECIMAL_used_with_MOVE.cob: Likewise.
* cobol.dg/group2/PERFORM_..._CONTINUE.cob: Likewise.
* cobol.dg/group2/PERFORM_TIMES_subscripted.cob: Likewise.
* cobol.dg/group2/PERFORM_VARYING_BY_-0.2.cob: Likewise.
* cobol.dg/group2/PERFORM_inline__1_.cob: Likewise.
* cobol.dg/group2/PERFORM_inline__2_.cob: Likewise.
* cobol.dg/group2/PERFORM_type_OSVS.cob: Likewise.
* cobol.dg/group2/PIC_ZZZ-__ZZZ_.cob: Likewise.
* cobol.dg/group2/POINTER__display.cob: Likewise.
* cobol.dg/group2/PR39_RT3573_-_Parser_issue_w_concat._source_lines.cob: Likewise.
* cobol.dg/group2/Preserve_collation_past_a_CALL.cob: Likewise.
* cobol.dg/group2/Program-to-program_parameters_and_retvals.cob: Likewise.
* cobol.dg/group2/Quick_check_of_PIC_XX_COMP-5.cob: Likewise.
* cobol.dg/group2/Quote_marks_in_comment_paragraphs.cob: Likewise.
* cobol.dg/group2/REDEFINES__chained.cob: Likewise.
* cobol.dg/group2/REDEFINES_values_on_FILLER_and_INITIALIZE.cob: Likewise.
* cobol.dg/group2/RETURN-CODE_moving.cob: Likewise.
* cobol.dg/group2/RETURN-CODE_nested.cob: Likewise.
* cobol.dg/group2/RETURN-CODE_with_INITIAL_and_RECURSIVE.cob: Likewise.
* cobol.dg/group2/ROUNDED_AWAY-FROM-ZERO.cob: Likewise.
* cobol.dg/group2/ROUNDED_NEAREST-AWAY-FROM-ZERO.cob: Likewise.
* cobol.dg/group2/ROUNDED_NEAREST-EVEN.cob: Likewise.
* cobol.dg/group2/ROUNDED_NEAREST-TOWARD-ZERO.cob: Likewise.
* cobol.dg/group2/ROUNDED_TOWARD-GREATER.cob: Likewise.
* cobol.dg/group2/ROUNDED_TOWARD-LESSER.cob: Likewise.
* cobol.dg/group2/ROUNDED_TRUNCATION.cob: Likewise.
* cobol.dg/group2/ROUNDING_omnibus_Floating-Point_from_COMPUTE.cob: Likewise.
* cobol.dg/group2/ROUNDING_omnibus_NumericDisplay_from_COMPUTE.cob: Likewise.
* cobol.dg/group2/Recursive_FUNCTION_with_local-storage.cob: Likewise.
* cobol.dg/group2/Recursive_PERFORM_paragraph.cob: Likewise.
* cobol.dg/group2/Recursive_subscripts.cob: Likewise.
* cobol.dg/group2/Refmod__comparisons_inside_numeric-display.cob: Likewise.
* cobol.dg/group2/Refmod_sources_are_figurative_constants.cob: Likewise.
* cobol.dg/group2/Repository_functions_clause.cob: Likewise.
* cobol.dg/group2/Rounding_from_BINARY_signable_and_negative.cob: Likewise.
* cobol.dg/group2/Rounding_from_BINARY_signable_and_positive.cob: Likewise.
* cobol.dg/group2/Rounding_from_BINARY_unsignable.cob: Likewise.
* cobol.dg/group2/SEARCH_ALL_with_OCCURS_DEPENDING_ON.cob: Likewise.
* cobol.dg/group2/SORT__EBCDIC_table_sort__1_.cob: Likewise.
* cobol.dg/group2/SORT__EBCDIC_table_sort__2_.cob: Likewise.
* cobol.dg/group2/SORT__table_sort.cob: Likewise.
* cobol.dg/group2/SORT__table_sort__2___ASCII_.cob: Likewise.
* cobol.dg/group2/SORT__table_sort__2___EBCDIC_.cob: Likewise.
* cobol.dg/group2/SORT__table_sort__3A_.cob: Likewise.
* cobol.dg/group2/SORT__table_sort__3B_.cob: Likewise.
* cobol.dg/group2/SOURCE_FIXED_FREE_directives.cob: Likewise.
* cobol.dg/group2/STOP_RUN_WITH_ERROR_STATUS.cob: Likewise.
* cobol.dg/group2/STOP_RUN_WITH_NORMAL_STATUS.cob: Likewise.
* cobol.dg/group2/STRING___UNSTRING__NOT__ON_OVERFLOW.cob: Likewise.
* cobol.dg/group2/STRING_with_subscript_reference.cob: Likewise.
* cobol.dg/group2/Sanity_check_for_ENTRY.cob: Likewise.
* cobol.dg/group2/Separate_sign_positions__1_.cob: Likewise.
* cobol.dg/group2/Separate_sign_positions__2_.cob: Likewise.
* cobol.dg/group2/Simple_COMP-X.cob: Likewise.
* cobol.dg/group2/Simple_DEBUG-ITEM.cob: Likewise.
* cobol.dg/group2/Simple_ENVIRONMENT-NAME_with_exception.cob: Likewise.
* cobol.dg/group2/Simple_TYPEDEF.cob: Likewise.
* cobol.dg/group2/Simple_floating-point_MOVE.cob: Likewise.
* cobol.dg/group2/Simple_floating-point_VALUE_and_MOVE.cob: Likewise.
* cobol.dg/group2/Simple_p-scaling.cob: Likewise.
* cobol.dg/group2/Static_CALL_with_ON_EXCEPTION__with_-fno-static-call_.cob: Likewise.
* cobol.dg/group2/Static_reference_modification.cob: Likewise.
* cobol.dg/group2/Subscript_by_arithmetic_expression.cob: Likewise.
* cobol.dg/group2/Subscript_out_of_bounds__1_.cob: Likewise.
* cobol.dg/group2/Subscript_out_of_bounds__2_.cob: Likewise.
* cobol.dg/group2/Subscripted_refmods.cob: Likewise.
* cobol.dg/group2/UDF_RETURNING_group_and_PIC_9_5_.cob: Likewise.
* cobol.dg/group2/UDF_fibonacci_recursion.cob: Likewise.
* cobol.dg/group2/UDF_in_COMPUTE.cob: Likewise.
* cobol.dg/group2/UDF_with_recursion.cob: Likewise.
* cobol.dg/group2/UNSTRING_DELIMITED_ALL_LOW-VALUE.cob: Likewise.
* cobol.dg/group2/UNSTRING_DELIMITED_ALL_SPACE-2.cob: Likewise.
* cobol.dg/group2/UNSTRING_DELIMITED_POINTER.cob: Likewise.
* cobol.dg/group2/UNSTRING_DELIMITER_IN.cob: Likewise.
* cobol.dg/group2/UNSTRING_with_FUNCTION___literal.cob: Likewise.
* cobol.dg/group2/UNSTRING_with_refmods.cob: Likewise.
* cobol.dg/group2/USING_COMP-3_BY_REFERENCE.cob: Likewise.
* cobol.dg/group2/USING_COMP-3_BY_VALUE.cob: Likewise.
* cobol.dg/group2/USING_FLOAT-SLX_BY_REFERENCE.cob: Likewise.
* cobol.dg/group2/USING_FLOAT-SLX_BY_VALUE.cob: Likewise.
* cobol.dg/group2/USING_NumericDisplay_BY_REFERENCE.cob: Likewise.
* cobol.dg/group2/USING_NumericDisplay_BY_VALUE.cob: Likewise.
* cobol.dg/group2/USING_Signed_-_COMP-3_BY_REFERENCE.cob: Likewise.
* cobol.dg/group2/USING_Signed_-_COMP-3_BY_VALUE.cob: Likewise.
* cobol.dg/group2/USING_Signed_-_NumericDisplay_BY_REFERENCE.cob: Likewise.
* cobol.dg/group2/USING_Signed_-_NumericDisplay_BY_VALUE.cob: Likewise.
* cobol.dg/group2/USING_Signed___COMP-3_BY_REFERENCE.cob: Likewise.
* cobol.dg/group2/USING_Signed___COMP-3_BY_VALUE.cob: Likewise.
* cobol.dg/group2/USING_Signed___NumericDisplay_BY_REFERENCE.cob: Likewise.
* cobol.dg/group2/USING_Signed___NumericDisplay_BY_VALUE.cob: Likewise.
* cobol.dg/group2/access_to_OPTIONAL_LINKAGE_item_not_passed.cob: Likewise.
* cobol.dg/group2/add_-1_to_negative_pic_S9999.cob: Likewise.
* cobol.dg/group2/add_-1_to_pic_9999.cob: Likewise.
* cobol.dg/group2/add_-1_to_positive_pic_S9999.cob: Likewise.
* cobol.dg/group2/add_1_to_pic_9999.cob: Likewise.
* cobol.dg/group2/add_1_to_positive_pic_S9999.cob: Likewise.
* cobol.dg/group2/add__1_to_negative_pic_S9999.cob: Likewise.
* cobol.dg/group2/ambiguous_PERFORM.cob: Likewise.
* cobol.dg/group2/call_subprogram_using_pointer__passing_pointer.cob: Likewise.
* cobol.dg/group2/command-line.cob: Likewise.
* cobol.dg/group2/compare_alpha_to_all__literal_.cob: Likewise.
* cobol.dg/group2/compare_float_to_other_types.cob: Likewise.
* cobol.dg/group2/compare_national_to_display.cob: Likewise.
* cobol.dg/group2/comprensive_compare_comp-1_comp-5.cob: Likewise.
* cobol.dg/group2/debugging_lines__WITH_DEBUGGING_MODE_.cob: Likewise.
* cobol.dg/group2/debugging_lines__not_active_.cob: Likewise.
* cobol.dg/group2/floating-point_ADD_FORMAT_1.cob: Likewise.
* cobol.dg/group2/floating-point_ADD_FORMAT_2.cob: Likewise.
* cobol.dg/group2/floating-point_DIVIDE_FORMAT_1.cob: Likewise.
* cobol.dg/group2/floating-point_DIVIDE_FORMAT_2.cob: Likewise.
* cobol.dg/group2/floating-point_FORMAT_1.cob: Likewise.
* cobol.dg/group2/floating-point_FORMAT_2.cob: Likewise.
* cobol.dg/group2/floating-point_MULTIPLY_FORMAT_1.cob: Likewise.
* cobol.dg/group2/floating-point_MULTIPLY_FORMAT_2.cob: Likewise.
* cobol.dg/group2/floating-point_SUBTRACT_FORMAT_1.cob: Likewise.
* cobol.dg/group2/floating-point_SUBTRACT_FORMAT_2.cob: Likewise.
* cobol.dg/group2/floating-point_literals.cob: Likewise.
* cobol.dg/group2/integer_arithmetic_on_floating-point_var.cob: Likewise.
* cobol.dg/group2/length_of_ODO_Rules_7__8A__and_8B.cob: Likewise.
* cobol.dg/group2/length_of_ODO_w_-_reference_modification.cob: Likewise.
* cobol.dg/group2/move_numeric_to_alphanumeric.cob: Likewise.
* cobol.dg/group2/numeric-display_to_COMP-3_size_error.cob: Likewise.
* cobol.dg/group2/procedure_division_using_by.cob: Likewise.
* cobol.dg/group2/refmod_with_nested_parentheses.cob: Likewise.
* cobol.dg/group2/repository.cob: Likewise.
* cobol.dg/group2/signed_unsigned_compare.cob: Likewise.
* cobol.dg/group2/skipping_at_the_top.cob: Likewise.
* cobol.dg/group2/source-computer_object-computer_repository__2_.cob: Likewise.
* cobol.dg/group2/README.txt: New file.

2 weeks agopasses: Make gcc buildable again with mawk <= 1.3.3
Jakub Jelinek [Mon, 20 Jul 2026 17:27:23 +0000 (19:27 +0200)] 
passes: Make gcc buildable again with mawk <= 1.3.3

On Wed, Jul 15, 2026 at 12:49:50PM -0400, Nathan Sidwell wrote:
> Fair enough, I committed this

Unfortunately it seems some versions of Debian/Ubuntu use mawk instead
of gawk by default, and mawk pretends to be POSIX compatible, but at least
versions <= 1.3.3 didn't support POSIX character classes.
We don't really need the various UTF-8 fancy blanks, and even this very
own script already uses sub(/^[ \t]*/, "", arg3); elsewhere, so this
patch just replaces [[:blank:]] with [ \t].

2026-07-20  Jakub Jelinek  <jakub@redhat.com>

* gen-pass-instances.awk: Use [ \t] instead of [[:blank:]]
for compatibility with mawk <= 1.3.3.

Reviewed-by: Richard Biener <rguenth@suse.de>
2 weeks agoc++: Make contract assertions have side effects [PR125904]
Ville Voutilainen [Sun, 5 Jul 2026 15:07:07 +0000 (18:07 +0300)] 
c++: Make contract assertions have side effects [PR125904]

gcc/cp/ChangeLog:
PR c++/125904
* contracts.cc (build_contract_check): Set TREE_SIDE_EFFECTS.

gcc/testsuite/ChangeLog:
PR c++/125904
* g++.dg/contracts/cpp26/pr125904.C: New test.

2 weeks agofortran: Use the setter to update the descriptor data field
Mikael Morin [Wed, 15 Jul 2026 15:29:38 +0000 (17:29 +0200)] 
fortran: Use the setter to update the descriptor data field

A MODIFY_EXPR was generated manually using the data reference returned by
the getter.  Just use the setter instead.  Fixed in two different places.

gcc/fortran/ChangeLog:

* trans-expr.cc (gfc_conv_class_to_class): Use the data setter
instead of generating a MODIFY_EXPR of the result of the data
getter.
* trans-intrinsic.cc (conv_intrinsic_move_alloc): Likewise.

2 weeks agotestsuite: cast argument to char* in can_deref_null [PR126261]
Torbjörn SVENSSON [Mon, 20 Jul 2026 15:07:07 +0000 (17:07 +0200)] 
testsuite: cast argument to char* in can_deref_null [PR126261]

gcc/testsuite/ChangeLog:

PR testsuite/126261
* lib/target-supports.exp (check_effective_target_can_deref_null):
Cast argument to char*.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2 weeks agoFortran, OpenMP: Consolidate iterator group start/finish code
Sandra Loosemore [Sun, 19 Jul 2026 02:49:55 +0000 (02:49 +0000)] 
Fortran, OpenMP: Consolidate iterator group start/finish code

This patch consolidates some repetitive code from gfc_trans_omp_clauses
into new functions, and adds some comments.  There are no functional
changes.

gcc/fortran/ChangeLog
* trans-openmp.cc (handle_iterator):  Add comments.  Rename
iter_block parameter to outer_block, since that's what's actually
being passed; the start/end/step expressions are outside the scope
of the iterator variables.
(start_iterator_group, finish_iterator_group): New functions,
broken out from...
(gfc_trans_omp_clauses): ...here.

2 weeks agoaarch64: Fix up TME deprecation warning
Alex Coplan [Fri, 17 Jul 2026 17:40:52 +0000 (18:40 +0100)] 
aarch64: Fix up TME deprecation warning

This is a follow-up patch to Richard E's r17-2498-g17f084306c68c4 (#186
on the Forge).  As Alice pointed out in her review:
https://gcc.gnu.org/pipermail/gcc-patches/2026-July/724391.html
the original patch missed things like +memtag+tme due to the string
parsing approach.  This instead just inspects the parsed feature flags
from aarch64_parse_extension to determine whether to warn in the target
attribute/pragma case.

+tme on the command line is handled as per Richard's original patch (no
change there).

gcc/ChangeLog:

* config/aarch64/aarch64.cc (aarch64_handle_attr_isa_flags):
Warn if +tme is enabled by the target attribute/pragma, relying
on the feature flags from aarch64_parse_extension.
(aarch64_process_target_attr): Drop +tme warning based on custom
string parsing.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/deprecate-tme.c: New test.

2 weeks agotestsuite: arm: remove xfail for MVE, NEON and thumb1 [PR124364]
Torbjörn SVENSSON [Tue, 14 Jul 2026 17:39:15 +0000 (19:39 +0200)] 
testsuite: arm: remove xfail for MVE, NEON and thumb1 [PR124364]

On MVE or NEON capable targers and thumb1 targets, I see these:

XPASS: gcc.dg/Wstringop-overflow-47.c pr97027 (test for warnings, line 72)
XPASS: gcc.dg/Wstringop-overflow-47.c pr97027 (test for warnings, line 77)
XPASS: gcc.dg/Wstringop-overflow-47.c pr97027 note (test for warnings, line 68)

gcc/testsuite/ChangeLog:

PR target/124364
* gcc.dg/Wstringop-overflow-47.c: Remove xfail.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2 weeks agoopenmp: Update GOMP_{distribute,loop}_static_worksharing_dispatch
Paul-Antoine Arras [Fri, 17 Jul 2026 10:40:09 +0000 (12:40 +0200)] 
openmp: Update GOMP_{distribute,loop}_static_worksharing_dispatch

Replace the 5-argument OMPT dispatch builtins and libgomp implementations
(niter, start, incr, chunk_size, istart) with a 2-argument form (start,
iterations) describing the chunk actually being dispatched, which is all the
information OMPT needs.

gcc/ChangeLog:

* builtin-types.def (BT_FN_VOID_ULONGLONG_ULONGLONG): New.
(BT_FN_VOID_ULONGLONG_ULONGLONG_ULONGLONG_ULONGLONG_ULONGLONG):
Remove.
* omp-builtins.def (BUILT_IN_GOMP_LOOP_STATIC_WORKSHARING_DISPATCH,
BUILT_IN_GOMP_DISTRIBUTE_STATIC_WORKSHARING_DISPATCH): Update
signature.
* omp-expand.cc (expand_omp_for_static_nochunk): Pass chunk start
and iteration count instead of loop bounds.
(expand_omp_for_static_chunk): Likewise.

gcc/fortran/ChangeLog:

* types.def (BT_FN_VOID_ULONGLONG_ULONGLONG): New.
(BT_FN_VOID_ULONGLONG_ULONGLONG_ULONGLONG_ULONGLONG_ULONGLONG):
Remove.

libgomp/ChangeLog:

* config/gcn/teams.c (GOMP_distribute_static_worksharing_dispatch):
Update signature and comment.
* config/nvptx/teams.c (GOMP_distribute_static_worksharing_dispatch):
Likewise.
* libgomp_g.h (GOMP_loop_static_worksharing_dispatch,
GOMP_distribute_static_worksharing_dispatch): Update prototypes.
* loop.c (GOMP_loop_static_worksharing_dispatch): Update signature
and comment.
* teams.c (GOMP_distribute_static_worksharing_dispatch): Likewise.
* testsuite/libgomp.c-c++-common/for-static-3.c: Update scan-dump
pattern.

gcc/testsuite/ChangeLog:

* c-c++-common/gomp/for-static-3.c: Update scan-dump pattern.

2 weeks agoopenmp: Add OMPT variants of GOMP_scope_start
Paul-Antoine Arras [Mon, 20 Jul 2026 09:48:59 +0000 (11:48 +0200)] 
openmp: Add OMPT variants of GOMP_scope_start

GOMP_scope_start is emitted only for task reductions without -fopenmp-ompt
(unchanged). With -fopenmp-ompt, both GOMP_scope_start_with_end and
GOMP_scope_end are emitted, whether a task reduction is specified or not.

gcc/ChangeLog:

* omp-builtins.def (BUILT_IN_GOMP_SCOPE_START_WITH_END): New
builtin.
(BUILT_IN_GOMP_SCOPE_END): Likewise.
* omp-low.cc (lower_omp_scope): Emit calls to
GOMP_scope_start_with_end and GOMP_scope_end when -fopenmp-ompt.

libgomp/ChangeLog:

* libgomp.map: Add GOMP_scope_start_with_end and GOMP_scope_end.
* libgomp_g.h (GOMP_scope_start_with_end): Declare.
(GOMP_scope_end): Likewise.
* scope.c (GOMP_scope_start_with_end): New function.
(GOMP_scope_end): New stub.

gcc/testsuite/ChangeLog:

* c-c++-common/gomp/scope-7.c: New test.
* c-c++-common/gomp/scope-8.c: New test.

2 weeks agotestsuite: skip test for targets that can deref null [PR126261]
Torbjörn SVENSSON [Tue, 14 Jul 2026 14:38:10 +0000 (16:38 +0200)] 
testsuite: skip test for targets that can deref null [PR126261]

As arm-none-eabi targets might have readable memory at address 0,
g++.dg/torture/pr101373.C test will "work" on some targets, while others
might tigger a fault. To avoid the ambiguity, lets skip the test if
target allows null to be dereferenced.

PR testsuite/126261

gcc/ChangeLog:

* doc/sourcebuild.texi (can_deref_null): Document.

gcc/testsuite/ChangeLog:

* g++.dg/torture/pr101373.C: Use effective-target can_deref_null.
* lib/target-supports.exp (check_effective_target_can_deref_null):
New proc.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2 weeks agotestsuite: arm: xfail predcom-8.c test in hard float without MVE [PR118407]
Torbjörn SVENSSON [Tue, 14 Jul 2026 08:22:06 +0000 (10:22 +0200)] 
testsuite: arm: xfail predcom-8.c test in hard float without MVE [PR118407]

In r15-6807-g68326d5d1a593d, more early break loops were vectorized.
This change causes the test to fail:

$ arm-none-eabi-gcc gcc.dg/tree-ssa/predcom-8.c \
    -mthumb -march=armv7ve+neon -mtune=cortex-a7 -mfloat-abi=hard -mfpu=auto \
    -O3 -fdump-tree-pcom-details-blocks -S -o predcom-8.s && grep "Invalid sum" predcom-8.*.pcom
;;   Invalid sum of incoming counts 267993001 (estimated locally, freq 2.3331), should be 234459439 (estimated locally, freq 2.0412)
;;   Invalid sum of incoming counts 31724316 (estimated locally, freq 0.2762), should be 78153146 (estimated locally, freq 0.6804)
;;   Invalid sum of incoming counts 37162368 (estimated locally, freq 0.3235), should be 67298542 (estimated locally, freq 0.5859)
;;   Invalid sum of incoming counts 487993506 (estimated locally, freq 4.2485), should be 471089795 (estimated locally, freq 4.1013)
;;   Invalid sum of incoming counts 140991263 (estimated locally, freq 1.2275), should be 114863531 (estimated locally, freq 1.0000)

The failures only happens for non-MVE targets in hard float ABI, thus
xfail test for these targets.

gcc/testsuite/ChangeLog:

PR testsuite/118407
* gcc.dg/tree-ssa/predcom-8.c: Xfail test for arm*-*-* in hard
float ABI without MVE.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2 weeks agotestsuite: arm: xfail crypto tests for -mthumb -mfloat-abi=hard [PR124043]
Torbjörn SVENSSON [Tue, 14 Jul 2026 17:08:34 +0000 (19:08 +0200)] 
testsuite: arm: xfail crypto tests for -mthumb -mfloat-abi=hard [PR124043]

In r15-1579-g792f97b44ffc5e, a new late-combine pass was introduced that
changes the generated assembler from
       ldr     r3, [sp]
       vdup.32 q8, r3
to
       vld1.32 {d16[], d17[]}, [sp]
with -mthumb -mfloat-abi=hard. Due to this changed, the check

/* { dg-final { scan-assembler-times {vdup.32\tq[0-9]+, r[0-9]+} 4 } } */

will no longer match. Mark the test as xfail when testing with -mthumb
-mfloat-abi=hard.

gcc/testsuite/ChangeLog:

PR testsuite/124043
* gcc.target/arm/crypto-vsha1cq_u32.c: Xfail test for -mthumb
-mfloat-abi=hard.
* gcc.target/arm/crypto-vsha1h_u32.c: Likewise.
* gcc.target/arm/crypto-vsha1mq_u32.c: Likewise.
* gcc.target/arm/crypto-vsha1pq_u32.c: Likewise.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2 weeks ago[PATCH][RISC-V][PR target/124741] Improving atomic sequences
Shreya Munnangi [Mon, 20 Jul 2026 13:02:48 +0000 (07:02 -0600)] 
[PATCH][RISC-V][PR target/124741] Improving atomic sequences

 In PR 124741, we have a testcase:

typedef struct
{
  int x;
  unsigned repr;
} atomic_u_t;

unsigned
atomic_load_u (const atomic_u_t *a)
{
  unsigned result;
  __atomic_load (&a->repr, &result, 0);
  return result;
}

When compiled with rv64, it outputs:

addi    a5,a0,4
lw      a0,0(a5)
sext.w  a0,a0
ret

Here we have a redundant sign extension and inefficient address arithmetic.
This can be simplified into two instructions, a load and a return.

The lw insn is already doing a sign extension from 32 to 64 bits, making
the separate sext.w unnecessary. Adding a copy of the pattern that
explicitly shows the sign extension in the RTL, with the modes adjusted
accordingly, no longer emits the sext.w insn. I also generalized the pattern to
support both sign and zero extension. These changes have been reflected
on the total store ordering memory consistency model as well. As Zalrsc
doesn't support zero extending load-acquire instructions, I introduced a new
iterator, ensuring zero extend is limited to !TARGET_ZALRSC for load.

The addi and lw are combined into lw a0,4(a5) by adjusting the memory
operand constraint to handle offsets in the load patterns. The validity of
the memory operand constraint depends on the value of operand 2 - the
memory model. I introduced new constraint alternatives, such that the
behavior of the memory operand constraint is triggered on whether the
memory model acquire is being used or not and the Zalrsc or non-Zalrsc
targets accordingly. Similar changes were made for the store patterns
where the inefficient address arithmetic problem was also present.

PR target/124741

gcc/
* config/riscv/constraints.md (B1, B2, B3, B4): New constraints for
atomic loads with and without ZALASR & MEMMODEL_ACQUIRE.
* config/riscv/iterators.md (cond_extend): New iterator to for use
in extending atomic loads.
* config/riscv/sync-rvwmo.md (atomic_load_rvwmo<mode>): Adjust
contraints to enable folding small offsets into memory load.
(atomic_store_rvwmo): Likewise.
(extending atomic_load_rvwmo): New pattern.
* config/riscv/sync-ztso.md (atomic_load_ztso<mode>): Adjust
constraints to enable folding small offsets into memory load.
(atomic_store_ztso): Likewise.
(extending atomic_load_ztso): New pattern.

gcc/testsuite/
* gcc.target/riscv/load-zalasr.c: Testcases for atomic load compiled
with rv64 and zalasr ext.
* gcc.target/riscv/load.c: Testcases for atomic load compiled with
rv64.
* gcc.target/riscv/load32-zalasr.c: Testcases for atomic load
compiled with rv32 and zalasr ext.
* gcc.target/riscv/load32.c: Testcases for atomic load compiled with
rv32.
* gcc.target/riscv/store-zalasr.c: Testcases for atomic store
compiled with rv64 and zalasr ext.
* gcc.target/riscv/store.c: Testcases for atomic store compiled
with rv64.
* gcc.target/riscv/store32-zalasr.c: Testcases for atomic store
compiled with rv32 and zalasr ext.
* gcc.target/riscv/store32.c: Testcases for atomic store compiled
with rv32.

Co-authored-by: Jeff Law <jeffrey.law@oss.qualcomm.com>
2 weeks agos390x: Fix singlefloat iterator.
Juergen Christ [Mon, 20 Jul 2026 08:06:11 +0000 (10:06 +0200)] 
s390x: Fix singlefloat iterator.

The VEC_SET_SINGLEFLOAT iterator erroneously included V1TF.  Remove it.

gcc/ChangeLog:

* config/s390/vector.md (VEC_SET_SINGLEFLOAT): Remove V1TF.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
2 weeks agotarget/126271 - honor v2df_reduction_prefer_haddpd better
Richard Biener [Thu, 16 Jul 2026 13:20:25 +0000 (15:20 +0200)] 
target/126271 - honor v2df_reduction_prefer_haddpd better

The following makes sure to honor v2df_reduction_prefer_haddpd
when expanding reduc_plus_scal_V2DF via ix86_expand_reduc.

There is test coverage in gcc.target/i386/pr54400.c

PR target/126271
* config/i386/i386-expand.cc (ix86_expand_reduc): Honor
TARGET_V2DF_REDUCTION_PREFER_HADDPD and expand via
gen_sse3_haddv2df3.

2 weeks agolibstdc++: Implement zic writezone merge optimization [PR124854]
Tomasz Kamiński [Mon, 20 Jul 2026 07:15:28 +0000 (09:15 +0200)] 
libstdc++: Implement zic writezone merge optimization [PR124854]

When two adjacent Zone lines have different total offsets and the
new line's rule set has a rule firing within jump of the boundary
(where jump = old_total - new_total > 0, i.e. local time goes
backward at the boundary), zic folds that rule into the boundary
itself: the single transition emitted has the rule's save value
already applied, so the new line begins with the post-rule save
rather than briefly using the pre-rule save and then transitioning
again moments later.

Canonical examples handled by the new merge block:
* America/Argentina/Buenos_Aires 1999-10-03: lines change
  stdoff -3 → -4 with an Argentina DST rule firing on the same
  day. Without the merge, chrono emits a 1-hour stretch of
  offset=-4 save=0 and then transitions to offset=-3 save=1;
  with the merge, the boundary itself is at offset=-3 save=1.
* Europe/Berlin 1945-05-24: lines split a rule set, with the
  So 1945-May-24 rule (save=2, "CEMT") firing at 01:00 UTC in
  the new frame, inside the 1h backward window.

Similarly, when the zone expansion algorithm is resumed after DST
span (save = 1h), we will revisit the corresponding STD transition,
for example: given offset +2h, the transition happening at 12:00
local time, will be considered twice:
 * 09:00 UT (2h + 1h) - proper ending of DST span
 * 10:00 UT (2h) - after re-entry.
Previously this transition were rejected using the (now removed)
rule_start - t < days(1) check, preventing us from emitting the one
hour STD time range followed by rest of same range. In this patch,
we reuse same merge logic, as such STD transition happens during
backward jump from boundary introduced by previous expansion.

This patch address both of the above by computing length of the
backward jump (merge_window) at the start of the expansion (regardless
if initial or re-entry), and then considering initial rule transition
happening in [info.begin + merge_window] to apply at info.begin.

libstdc++-v3/ChangeLog:

PR libstdc++/124854
* src/c++20/tzdb.cc (ZoneInfo::save): Define.
(time_zone::_M_get_sys_info): Fold initial transition if they
occurs in duplicated local time window (merge_window) due move
from DST to STD zone.
* testsuite/std/time/time_zone/wall_cascade.cc (test_next_year):
Test that 1945 Pacific/Auckland transition is properly handled.
(test_negative): Adjust test to avoid zone merge.
* testsuite/std/time/time_zone/zone_merge.cc: New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Co-authored-by: Álvaro Begué <alvaro.begue@gmail.com>
Signed-off-by: Álvaro Begué <alvaro.begue@gmail.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
2 weeks agofortran: array descriptor: Add internal field accessor for data [PR122521]
Mikael Morin [Mon, 20 Jul 2026 09:10:00 +0000 (11:10 +0200)] 
fortran: array descriptor: Add internal field accessor for data [PR122521]

Add a static function producing a reference to the data field of array
descriptors, like those existing for the other fields.

PR fortran/122521

gcc/fortran/ChangeLog:

* trans-descriptor.cc (conv_descriptor_data): New function.
(gfc_conv_descriptor_data_get, gfc_conv_descriptor_data_set): Use
it.

2 weeks agofortran: array descriptor: Rename internal field accessor for span [PR122521]
Mikael Morin [Mon, 20 Jul 2026 09:09:46 +0000 (11:09 +0200)] 
fortran: array descriptor: Rename internal field accessor for span [PR122521]

Make the internal accessor for span respect the convention that static
functions don't have the `gfc_' prefix.

PR fortran/122521

gcc/fortran/ChangeLog:

* trans-descriptor.cc (gfc_conv_descriptor_span): Rename ...
(conv_descriptor_span): ... to this.
(gfc_conv_descriptor_span_get, gfc_conv_descriptor_span_set): Update
callers.

2 weeks agofortran: array descriptor: Rename dim subfields internal accessors [PR122521]
Mikael Morin [Mon, 20 Jul 2026 09:09:33 +0000 (11:09 +0200)] 
fortran: array descriptor: Rename dim subfields internal accessors [PR122521]

Drop the gfc prefix from the internal function giving access to the lbound,
ubound, and stride fields.  This aligns the function names with the rest of
the compiler dropping the prefix for static functions.

PR fortran/122521

gcc/fortran/ChangeLog:

* trans-descriptor.cc (gfc_conv_descriptor_stride): Rename ...
(conv_descriptor_stride): ... to this.
(gfc_conv_descriptor_stride_get, gfc_conv_descriptor_stride_set):
Update caller.
(gfc_conv_descriptor_lbound): Rename ...
(conv_descriptor_lbound): ... to this.
(gfc_conv_descriptor_lbound_get, gfc_conv_descriptor_lbound_set):
Update caller.
(gfc_conv_descriptor_ubound): Rename ...
(conv_descriptor_ubound): ... to this.
(gfc_conv_descriptor_ubound_get, gfc_conv_descriptor_ubound_set):
Update caller.

2 weeks agofortran: array descriptor: Add a setter for the token field [PR122521]
Mikael Morin [Mon, 20 Jul 2026 09:09:22 +0000 (11:09 +0200)] 
fortran: array descriptor: Add a setter for the token field [PR122521]

Add a setter function to set the value of the token field of array
descriptors.

Contrary to the preceding patches touching the other fields, this one
doesn't create a getter and retains direct access to the field.  Indeed,
token is special because its address is taken and passed to library
functions to implement coarray behaviour.

PR fortran/122521

gcc/fortran/ChangeLog:

* trans-descriptor.cc (gfc_conv_descriptor_token_set): New function.
* trans-descriptor.h (gfc_conv_descriptor_token_set): New
declaration.
* trans-array.cc (gfc_conv_expr_descriptor,
gfc_conv_array_parameter, gfc_trans_deferred_array): Use
gfc_conv_descriptor_token_set to set the value of the token.
* trans-expr.cc (gfc_conv_derived_to_class,
gfc_trans_subcomponent_assign, gfc_trans_scalar_assign): Likewise.
* trans-intrinsic.cc (conv_intrinsic_move_alloc): Likewise.

2 weeks agofortran: array descriptor: Remove access to dim field elements [PR122521]
Mikael Morin [Mon, 20 Jul 2026 09:09:11 +0000 (11:09 +0200)] 
fortran: array descriptor: Remove access to dim field elements [PR122521]

Remove from the public API the function giving direct acces to individual
dimension descriptors.  Another function remains giving access to the full
array of dimension descriptors.

PR fortran/122521

gcc/fortran/ChangeLog:

* trans-descriptor.cc (gfc_conv_descriptor_dimension): Make static
and rename ...
(conv_descriptor_dimension): ... to this.
(gfc_conv_descriptor_subfield): Update caller.
* trans-descriptor.h (gfc_conv_descriptor_dimension): Remove
declaration.

2 weeks agofortran: array descriptor: Remove access to the attribute field [PR122521]
Mikael Morin [Mon, 20 Jul 2026 09:09:01 +0000 (11:09 +0200)] 
fortran: array descriptor: Remove access to the attribute field [PR122521]

The attribute field is not used, this removes the single function giving
direct access to it.

PR fortran/122521

gcc/fortran/ChangeLog:

* trans-descriptor.cc (gfc_conv_descriptor_attribute): Remove
function.
* trans-descriptor.h (gfc_conv_descriptor_attribute): Remove
declaration.

2 weeks agofortran: array descriptor: Add accessors for the dtype field [PR122521]
Mikael Morin [Mon, 20 Jul 2026 09:08:51 +0000 (11:08 +0200)] 
fortran: array descriptor: Add accessors for the dtype field [PR122521]

Use accessor functions to get or set the dtype field of array descriptors
and remove from the public API the function giving direct acces to the
field.

PR fortran/122521

gcc/fortran/ChangeLog:

* trans-descriptor.cc (gfc_conv_descriptor_dtype): Make static and
rename ...
(conv_descriptor_dtype): ... to this.
(conv_descriptor_rank conv_descriptor_version,
conv_descriptor_elem_len, gfc_conv_descriptor_attribute,
conv_descriptor_type): Update callers.
(gfc_conv_descriptor_dtype_get, gfc_conv_descriptor_dtype_set):
New functions.
* trans-descriptor.h (gfc_conv_descriptor_dtype): Remove
declaration.
(gfc_conv_descriptor_dtype_get, gfc_conv_descriptor_dtype_set):
New declarations.
* trans-array.cc (gfc_trans_create_temp_array, gfc_array_init_size,
gfc_conv_expr_descriptor, gfc_resize_assumed_rank_dim_field,
gfc_conv_array_parameter, structure_alloc_comps,
gfc_alloc_allocatable_for_assignment, gfc_trans_class_array,
gfc_trans_deferred_array): Use gfc_conv_descriptor_dtype_get to get
the value of the dtype field and gfc_conv_descriptor_dtype_set to
update it.
* trans-decl.cc (gfc_conv_cfi_to_gfc): Likewise.
* trans-expr.cc (gfc_conv_scalar_to_descriptor,
gfc_class_array_data_assign, gfc_conv_derived_to_class,
gfc_conv_class_to_class, set_dtype_for_unallocated,
gfc_trans_pointer_assignment, fcncall_realloc_result): Likewise.
* trans-intrinsic.cc (conv_isocbinding_subroutine): Likewise.
* trans-stmt.cc (trans_associate_var): Likewise.

2 weeks agofortran: array descriptor: Add accessors for the type field [PR122521]
Mikael Morin [Mon, 20 Jul 2026 09:08:40 +0000 (11:08 +0200)] 
fortran: array descriptor: Add accessors for the type field [PR122521]

Add accessor functions to get or set the value of the type field of array
descriptors, and remove from the public API the function giving direct acces
to the field.

PR fortran/122521

gcc/fortran/ChangeLog:

* trans-descriptor.cc (get_type_field): New function.
(gfc_get_descriptor_field): Use it.
(gfc_conv_descriptor_type): Make static and rename ...
(conv_descriptor_type): ... to this.
(gfc_conv_descriptor_type_get, gfc_conv_descriptor_type_set): New
functions.
* trans-descriptor.h (gfc_conv_descriptor_type): Remove declaration.
(gfc_conv_descriptor_type_get, gfc_conv_descriptor_type_set): New
declarations.
* trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Use
gfc_conv_descriptor_type_get to get the value of the type field.
* trans-decl.cc (gfc_conv_cfi_to_gfc): Use
gfc_conv_descriptor_type_set to set the value of the type field.

2 weeks agofortran: array descriptor: Add accessors for the rank field [PR122521]
Mikael Morin [Mon, 20 Jul 2026 09:08:29 +0000 (11:08 +0200)] 
fortran: array descriptor: Add accessors for the rank field [PR122521]

Add accessor functions to get or set the value of the rank field of array
descriptors, and remove from the public API the function giving direct acces
to the field.

PR fortran/122521

gcc/fortran/ChangeLog:

* trans-descriptor.cc (gfc_conv_descriptor_rank): Make static and
rename ...
(conv_descriptor_rank): ... to this.
(gfc_conv_descriptor_rank_get, gfc_conv_descriptor_rank_set): New
functions.
* trans-descriptor.h (gfc_conv_descriptor_rank): Remove declaration.
(gfc_conv_descriptor_rank_get, gfc_conv_descriptor_rank_set): New
declarations.
* trans-array.cc (gfc_trans_create_temp_array,
gfc_conv_ss_startstride, gfc_tree_array_size,
gfc_resize_assumed_rank_dim_field, gfc_conv_array_parameter,
gfc_full_array_size, duplicate_allocatable_coarray): Use
gfc_conv_descriptor_rank_get to get the value of the rank field,
and gfc_conv_descriptor_rank_set to set it.
* trans-decl.cc (gfc_conv_cfi_to_gfc): Likewise.
* trans-expr.cc (gfc_conv_derived_to_class, gfc_conv_variable,
gfc_conv_gfc_desc_to_cfi_desc, conv_null_actual,
gfc_trans_structure_assign): Likewise.
* trans-intrinsic.cc (gfc_conv_intrinsic_rank,
gfc_conv_intrinsic_bound, gfc_conv_intrinsic_sizeof,
gfc_conv_associated): Likewise.
* trans-openmp.cc (gfc_omp_get_array_size): Likewise.
* trans-stmt.cc (gfc_trans_select_rank_cases): Likewise.

2 weeks agofortran: array descriptor: Add accessors for the version field [PR122521]
Mikael Morin [Mon, 20 Jul 2026 09:08:15 +0000 (11:08 +0200)] 
fortran: array descriptor: Add accessors for the version field [PR122521]

Add accessor functions to get or set the value of the version field of array
descriptors, and remove from the public API the function giving direct acces
to the field.

PR fortran/122521

gcc/fortran/ChangeLog:

* trans-descriptor.cc (gfc_conv_descriptor_version): Make static and
rename ...
(conv_descriptor_version): ... to this.
(gfc_conv_descriptor_version_get, gfc_conv_descriptor_version_set):
New functions.
* trans-descriptor.h (gfc_conv_descriptor_version): Remove
declaration.
(gfc_conv_descriptor_version_get, gfc_conv_descriptor_version_set):
New declarations.
* trans.cc (gfc_deallocate_with_status): Use
gfc_conv_descriptor_version_get to get the value of the version
field, and gfc_conv_descriptor_version_set to set it.
* trans-array.cc (gfc_array_allocate, structure_alloc_comps,
gfc_alloc_allocatable_for_assignment): Likewise.

2 weeks agofortran: array descriptor: Add accessors for the elem_len field [PR122521]
Mikael Morin [Mon, 20 Jul 2026 09:07:59 +0000 (11:07 +0200)] 
fortran: array descriptor: Add accessors for the elem_len field [PR122521]

Add accessor functions to get or set the value of the elem_len field of
array descriptors, and remove from the public API the function giving direct
acces to the field.

PR fortran/122521

gcc/fortran/ChangeLog:

* trans-descriptor.cc (gfc_conv_descriptor_elem_len): Make static
and rename ...
(conv_descriptor_elem_len): ... to this.
(gfc_conv_descriptor_elem_len_get,
gfc_conv_descriptor_elem_len_set): New functions.
* trans-descriptor.h (gfc_conv_descriptor_elem_len): Remove
declaration.
(gfc_conv_descriptor_elem_len_get,
gfc_conv_descriptor_elem_len_set): New declarations.
* trans-decl.cc (gfc_conv_cfi_to_gfc): Use
gfc_conv_descriptor_elem_len_get to get the value of the elem_len
field and gfc_conv_descriptor_elem_len_set to set it.
* trans-array.cc (gfc_array_init_size,
gfc_alloc_allocatable_for_assignment): Likewise.
* trans-expr.cc (gfc_conv_scalar_to_descriptor,
gfc_conv_gfc_desc_to_cfi_desc, gfc_trans_pointer_assignment):
Likewise.
* trans-intrinsic.cc (gfc_conv_is_contiguous_expr,
gfc_conv_intrinsic_sizeof): Likewise.
* trans-openmp.cc (gfc_omp_array_size, gfc_omp_deep_mapping_item):
Likewise.

2 weeks agofortran: array descriptor: Use the setter to modify the offset [PR122521]
Mikael Morin [Mon, 20 Jul 2026 09:07:41 +0000 (11:07 +0200)] 
fortran: array descriptor: Use the setter to modify the offset [PR122521]

Use the setter function to generate code modifying the array descriptor
offset and remove from the public API the function giving direct access to
that field.

PR fortran/122521

gcc/fortran/ChangeLog:

* trans-descriptor.cc (gfc_conv_descriptor_offset): Make static and
rename ...
(conv_descriptor_offset): ... to this.
(gfc_conv_descriptor_offset_get,
gfc_conv_descriptor_offset_set): Update callers.
* trans-descriptor.h (gfc_conv_descriptor_offset): Remove
declaration.
* trans-array.cc (gfc_alloc_allocatable_for_assignment): Use the
setter function to generate a modification of the array descriptor
offset.

2 weeks agolibstc++: Use standard FLT_EVAL_METHOD in piecewise distributions tests.
Tomasz Kamiński [Mon, 20 Jul 2026 07:10:57 +0000 (09:10 +0200)] 
libstc++: Use standard FLT_EVAL_METHOD in piecewise distributions tests.

libstdc++-v3/ChangeLog:

* testsuite/26_numerics/random/piecewise_constant_distribution/operators/serialize2.cc:
Include <cfloat> and use FLT_EVAL_METHOD instead of
__FLT_EVAL_METHOD__.
* testsuite/26_numerics/random/piecewise_linear_distribution/operators/serialize2.cc:
Likewise.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
2 weeks agolibsanitizer: Initialize local_head member [PR126307]
Jakub Jelinek [Mon, 20 Jul 2026 08:30:43 +0000 (10:30 +0200)] 
libsanitizer: Initialize local_head member [PR126307]

The following patch cherry picks an upstream fix for this.

2026-07-20  Jakub Jelinek  <jakub@redhat.com>

PR sanitizer/126307
* tsan/tsan_trace.h: Cherry-pick llvm-project revision
cdfdb06c9155080ec97d6e4f4dd90b6e7cefb0ca.

2 weeks agoFortran/OpenMP: Add parsing support for spatial dimensions
Tobias Burnus [Mon, 20 Jul 2026 07:19:04 +0000 (09:19 +0200)] 
Fortran/OpenMP: Add parsing support for spatial dimensions

Adds 'dim(...)' modifier parsing for spatial dimensions to the num_teams,
thread_limit, and num_threads clauses.

Add strict + relaxed modifier support to the thread_limit and num_threads
clauses. [For teams, the effect of strict/relaxed is provided by the
lower_bound feature.]

For num_threads, support specifying multiple values - to be applicable
for nested parallel constructs.

NOTE: All added features (but 'relaxed') will fail after parsing with
a 'sorry, unimplemented' as only the parsing support has been added and
not the actual feature.

gcc/fortran/ChangeLog:

* dump-parse-tree.cc (show_omp_clauses): Handle spatial dimension
in num_teams and it and strict/relaxed in thread_limits and
num_threads.
* trans-openmp.cc (gfc_trans_omp_clauses, gfc_split_omp_clauses,
gfc_trans_omp_target): Likewise.
* openmp.cc (gfc_free_omp_clauses, gfc_match_omp_clauses,
resolve_omp_clauses): Likewise.
(match_omp_oacc_expr_list): Return current locus for a parse
fail instead of resetting the locus.
* gfortran.h (gfc_omp_clauses): Changed gfc_expr num_threads,
num_teams_lower, num_teams_upper, and thread_limit to
gfc_expr_list num_threads_list, num_teams_list, and thread_limit_list.
Add thread_limit_strict, num_threads_strict, num_teams_dims,
thread_limit_dims, and num_threads_dims.
* frontend-passes.cc (gfc_code_walker): Update for this change.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/spatial-dimensions-1.f90: New test.
* gfortran.dg/gomp/spatial-dimensions-2.f90: New test.
* gfortran.dg/gomp/spatial-dimensions-3.f90: New test.

2 weeks agolibstdc++: Fix condition for stopping lazy zone expansion [PR116110]
Tomasz Kamiński [Fri, 17 Jul 2026 19:14:42 +0000 (21:14 +0200)] 
libstdc++: Fix condition for stopping lazy zone expansion [PR116110]

At indicated by the pre-existing comment, the lazy zone expansion can be
only resumed from STD (save == 0) zone. However, the current condition
for stopping on DST (save != 0) doesn't ensure that, as some rule specify
transitions between DST zones. For example August 1945 of Y rule used by
America/Dawson only change letters:
  Y 1942 o - F 9 2 1 W
  Y 1945 o - Au 14 23u 1 P

This patch correct the condition, by using next_rule (i.e. one applying
after last expanded zone): either there is no zone (last expanded range)
or it have save zero.

libstdc++-v3/ChangeLog:

PR libstdc++/116110
* src/c++20/tzdb.cc (time_zone::_M_get_sys_info): Correct
condition for stopping zone expansion before STD zone.
* testsuite/std/time/time_zone/116110.cc (test_dawson):
Add test for America/Dawson August 1945 transition.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
2 weeks agolibstdc++: Prevent overflow in find_active_rule to_local conversion. [PR116110]
Tomasz Kamiński [Fri, 17 Jul 2026 11:21:39 +0000 (13:21 +0200)] 
libstdc++: Prevent overflow in find_active_rule to_local conversion. [PR116110]

As when member of Transitions::Entries that do not correspond
to rule activation (rule is empty) is either minimum or maximum
value of sys_seconds, adjusting it to std_offset lead to overflow
(and UB). In practice this caused next.when to have very low value,
and thus considered to be active rule. The to_local conversion now
return local_seconds constucted directly from time_since_epoch
(i.e. minimum and maximum).

In consequence above, the save was still not applied for zones
that specified UNTIL after firing of last rule, that also have
non zero save (e.g. Asia/Bishkek 2005 transition).

libstdc++-v3/ChangeLog:

PR libstdc++/116110
* src/c++20/tzdb.cc (find_active_rule::to_local): Do not
modify min/max values for rules.
* testsuite/std/time/time_zone/wall_cascade.cc: Add test
for last_transition.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
2 weeks agoRISC-V: Adjust test case due to allow vwcvt.f.f.v overlap
Pan Li [Sun, 19 Jul 2026 09:55:49 +0000 (17:55 +0800)] 
RISC-V: Adjust test case due to allow vwcvt.f.f.v overlap

Remove the xfail due to overlap changes.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/base/pr112431-7.c: Remove xfail.
* gcc.target/riscv/rvv/base/pr112431-8.c: Ditto.
* gcc.target/riscv/rvv/base/pr112431-9.c: Ditto.

Signed-off-by: Pan Li <pan2.li@intel.com>
2 weeks agoRISC-V: Add test cases for vfwcvt.f.f.v reg overlap
Pan Li [Sun, 19 Jul 2026 09:25:21 +0000 (17:25 +0800)] 
RISC-V: Add test cases for vfwcvt.f.f.v reg overlap

Add test cases for vfwcvt.f.f.v register group overlap, please
note it is not overlap as much as possible.

Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-m1.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-m2.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-m4.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-mf2.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f16-mf4.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-m1.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-m2.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-m4.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_f-f32-mf2.c: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>
2 weeks agoRISC-V: Allow RVV register overlap for vfwcvt.f.f.v
Pan Li [Sun, 19 Jul 2026 09:23:36 +0000 (17:23 +0800)] 
RISC-V: Allow RVV register overlap for vfwcvt.f.f.v

Like v[sz]ext.vf8, allow the rvv register overlap
for vfwcvt.f.f.v.

gcc/ChangeLog:

* config/riscv/vector.md: Leverage Wvr constraint.

Signed-off-by: Pan Li <pan2.li@intel.com>
2 weeks agomatch.pd: Make the (trunc)copysign(extend x, extend y) vector-safe [PR126291]
Philipp Tomsich [Sun, 19 Jul 2026 16:26:41 +0000 (18:26 +0200)] 
match.pd: Make the (trunc)copysign(extend x, extend y) vector-safe [PR126291]

The (convert (copysigns (convert@2 @0) (convert @1))) rules evaluate
TYPE_PRECISION on the outer and inner types after only types_match, so
a vectorized copysign chain like

  vect_1 = (vector(2) float) vect_0;
  vect_2 = (vector(2) float) vect_3;
  vect_4 = .COPYSIGN (vect_1, vect_2);
  vect_5 = (vector(2) double) vect_4;

trips the vector_type tree check while gimple_simplify evaluates the
guard (the ICE does not require the precision test to hold: evaluating
TYPE_PRECISION on a vector type is what triggers it).

Use element_precision, mirroring the abs fix.  No equivalent of the
target_supports_op_p check is needed here, since the existing
direct_internal_fn_supported_p guard already handles vector types
correctly.
The REAL_CST variant cannot match vectors (a vector constant is a
VECTOR_CST), but is converted as well for consistency.

Bootstrapped and regtested on x86_64-pc-linux-gnu.

PR tree-optimization/126291

gcc/ChangeLog:

* match.pd ((trunc)copysign ((extend)x, (extend)y) -> copysign
(x, y), (trunc)copysign ((extend)x, CST) -> copysign (x, CST)):
Use element_precision.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/pr126291-2.c: New test.

2 weeks agoDaily bump.
GCC Administrator [Mon, 20 Jul 2026 00:16:33 +0000 (00:16 +0000)] 
Daily bump.

2 weeks agomatch.pd: Make the (trunc)abs(extend x) guard vector-safe [PR126291]
Philipp Tomsich [Thu, 16 Jul 2026 04:45:03 +0000 (06:45 +0200)] 
match.pd: Make the (trunc)abs(extend x) guard vector-safe [PR126291]

The (convert (abs (convert@1 @0))) -> (abs @0) rule added by
r17-2276-ge2c4fc6b1cff evaluates TYPE_PRECISION on the outer and inner types
after only types_match, so a vectorized abs-of-narrowed chain like

  vect_1 = (vector(2) int) vect_0;
  vect_2 = ABS_EXPR <vect_1>;
  vect_3 = (vector(2) signed long) vect_2;

trips the vector_type tree check when gimple_simplify visits the
outer conversion (ICE during fre). Use element_precision
so the guard is evaluable for vectors, and require target support
for ABS on the narrow vector type before enabling the transform
there.

Bootstrapped and regtested on aarch64-unknown-linux-gnu, x86_64-pc-linux-gnu
and riscv64-unknown-linux-gnu.

PR tree-optimization/126291

gcc/ChangeLog:

* match.pd ((trunc)abs (extend x) -> abs (x)): Use
element_precision. Require target ABS support for the
vector case.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/pr126291.c: New test.

2 weeks agofortran: Implement list directed read of hex float formats.
Jerry DeLisle [Thu, 16 Jul 2026 03:29:38 +0000 (20:29 -0700)] 
fortran: Implement list directed read of hex float formats.

PR libfortran/93727

libgfortran/ChangeLog:

* io/list_read.c (parse_real): Parse the possible hexadecimal
float formatted and then allow the convert_real function to
validate the result.

gcc/testsuite/ChangeLog:

* gfortran.dg/EXformat_5.F90: New test.

2 weeks agoRISC-V: Add minimal Svrsw60t59b extension support
Jiawei [Wed, 24 Jun 2026 13:47:24 +0000 (21:47 +0800)] 
RISC-V: Add minimal Svrsw60t59b extension support

This adds minimal support for the Svrsw60t59b[1] (Page-table reserved-for-
software bits 60-59) extension, and it will be a new part of RVA23.1[2].

[1] https://github.com/riscv/riscv-isa-manual/blob/main/src/priv/svrsw60t59b.adoc
[2] https://github.com/riscv/riscv-isa-manual/pull/3170

gcc/ChangeLog:

* config/riscv/riscv-ext.def (svrsw60t59b): Add new extension.
* config/riscv/riscv-ext.opt: Ditto.
* doc/riscv-ext.texi: Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/svrsw60t59b-version.c: New test.

2 weeks agoRISC-V: Add minimal Ssqosid extension support
Jiawei [Wed, 24 Jun 2026 13:46:35 +0000 (21:46 +0800)] 
RISC-V: Add minimal Ssqosid extension support

This adds minimal support for the Ssqosid[1] (Supervisor-mode
quality-of-service ID) extension.

[1] https://github.com/riscv/riscv-ssqosid

gcc/ChangeLog:

* config/riscv/riscv-ext.def (ssqosid): Add new extension.
* config/riscv/riscv-ext.opt: Ditto.
* doc/riscv-ext.texi: Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/ssqosid-version.c: New test.

2 weeks agoRISC-V: Add minimal Ssctr extension support
Jiawei [Wed, 24 Jun 2026 13:45:46 +0000 (21:45 +0800)] 
RISC-V: Add minimal Ssctr extension support

This adds minimal support for the Ssctr[1] (Supervisor-mode control transfer
records) extension, which depends on Zicsr.

gcc/ChangeLog:

* config/riscv/riscv-ext.def (ssctr): Add new extension.
* config/riscv/riscv-ext.opt: Ditto.
* doc/riscv-ext.texi: Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/ssctr-version.c: New test.

2 weeks agoRISC-V: Add minimal Smctr extension support
Jiawei [Wed, 24 Jun 2026 13:44:21 +0000 (21:44 +0800)] 
RISC-V: Add minimal Smctr extension support

This adds minimal support for the Smctr[1] (Machine-mode control transfer
records) extension, which depends on Zicsr.

[1] https://github.com/riscv/riscv-isa-manual/blob/main/src/priv/smctr.adoc

gcc/ChangeLog:

* config/riscv/riscv-ext.def (smctr): Add new extension.
* config/riscv/riscv-ext.opt: Ditto.
* doc/riscv-ext.texi: Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/smctr-version.c: New test.

2 weeks agoRISC-V: Add minimal Smcdeleg extension support
Jiawei [Wed, 24 Jun 2026 13:43:16 +0000 (21:43 +0800)] 
RISC-V: Add minimal Smcdeleg extension support

This adds minimal support for the Smcdeleg[1] (Machine-mode counter
delegation) extension, which depends on Ssccfg.

[1] https://github.com/riscvarchive/riscv-smcdeleg-ssccfg

gcc/ChangeLog:

* config/riscv/riscv-ext.def (smcdeleg): Add new extension.
* config/riscv/riscv-ext.opt: Ditto.
* doc/riscv-ext.texi: Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/smcdeleg-version.c: New test.

2 weeks agoRISC-V: Add minimal Ssccfg extension support
Jiawei [Wed, 24 Jun 2026 13:42:37 +0000 (21:42 +0800)] 
RISC-V: Add minimal Ssccfg extension support

This adds minimal support for the Ssccfg[1] (Supervisor-mode counter
configuration) extension, which depends on Sscsrind.

[1] https://github.com/riscvarchive/riscv-smcdeleg-ssccfg

gcc/ChangeLog:

* config/riscv/riscv-ext.def (ssccfg): Add new extension.
* config/riscv/riscv-ext.opt: Ditto.
* doc/riscv-ext.texi: Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/ssccfg-version.c: New test.

2 weeks agoRISC-V: Add minimal Ziccamoc extension support
Jiawei [Wed, 24 Jun 2026 13:42:00 +0000 (21:42 +0800)] 
RISC-V: Add minimal Ziccamoc extension support

This adds minimal support for the Ziccamoc[1] (Main memory supports
compare-and-swap atomics) extension.

[1] https://github.com/riscv/riscv-isa-manual/blob/main/src/unpriv/ziccamoc.adoc

gcc/ChangeLog:

* config/riscv/riscv-ext.def (ziccamoc): Add new extension.
* config/riscv/riscv-ext.opt: Ditto.
* doc/riscv-ext.texi: Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/ziccamoc-version.c: New test.

2 weeks agoRISC-V: Add minimal Ziccid extension support
Jiawei [Sun, 14 Jun 2026 13:51:00 +0000 (21:51 +0800)] 
RISC-V: Add minimal Ziccid extension support

This adds minimal support for the Ziccid[1] (Instruction/data coherence
and consistency) extension, which depends on Ziccif.

[1] https://github.com/riscv/riscv-isa-manual/blob/main/src/unpriv/ziccid.adoc

gcc/ChangeLog:

* config/riscv/riscv-ext.def (ziccid): Add new extension.
* config/riscv/riscv-ext.opt: Ditto.
* doc/riscv-ext.texi: Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/zi-ext.c: Add ziccid to arch test.
* gcc.target/riscv/ziccid-version.c: New test.
* gcc.target/riscv/ziccid.c: New test.

2 weeks agoShowing ALLOCATE typespecs and walking character lengths in code walker.
Thomas Koenig [Sun, 19 Jul 2026 14:17:28 +0000 (16:17 +0200)] 
Showing ALLOCATE typespecs and walking character lengths in code walker.

This dumps the typespec of an ALLOCATE statement and also walks the charlen
of a character espression and an array if present.

gcc/fortran/ChangeLog:

* dump-parse-tree.cc (show_code_node): Show typespec for
ALLOCATE if present.
* frontend-passes.cc (gfc_expr_walker): Walk the character
typespec length for array expressions.
(gfc_code_walker): Walk the typespec for ALLOCATE if present.

2 weeks ago[committed] Improve select across A/A OP C where C is 2^n
Jeff Law [Sun, 19 Jul 2026 14:11:23 +0000 (08:11 -0600)] 
[committed] Improve select across A/A OP C where C is 2^n

Testing for PR125731 exposed a bit of unexpected behavior on loongarch.

Basically the PR125731 patch allows if-conversion to again handle generating
conditional zero based sequences where one of the two operands in the original
sequence was a constant integer.  Generating a conditional zero based sequence
usually results in better code than a generalized conditional move.

Discovering those cases better led to a regression on loongarch which seems to
want to generate even more specialized sequences than a conditional select
across 0,2^n for things like conditional add.  Consider this loongarch
assembly:

        sltu    $r12,$r0,$r12
        slli.d  $r12,$r12,16
        add.d   $r14,$r14,$r12

That's a conditional add by 65536.   We use the sltu to generate 1/0, shift
that by 16 generating 65536/0, then add that result to the other operand.  With
the work for PR125731 we get this instead:

        lu12i.w $r16,16                 # 0x10
        maskeqz $r12,$r16,$r12
        add.d   $r14,$r14,$r12

Normally I would prefer the 2nd sequence as the high part load has no
dependencies and can issue whenever is convenient, but loongarch explicitly
prefers the first sequence and I'm willing to assume that was done for a good
reason.  For RISC-V it's probably a toss-up.  The first form likely compresses
better and doesn't rely on zicond, but the second form has one less incoming
dependency.  Barring hard data, I'm going to declare them equivalent and target
the sequence loongarch wants.

Thankfully this is a class of problems that's been on my radar for a while.

Given a select across A and A OP C where C is 2^N we can left shift the result
of the SCC to give us a select across 0 and 2^n, then we emit A OP X (where X
holds the result of that left shift).  We can do this add, sub, shifts,
rotates, ior, xor, basically anything where "0" is a neutral operand.  That
obviously excludes AND where -1 is the neutral.  That's ultimately the same set
of operators as the condzero arithmetic supports except we'd need to filter out
AND.

The implementation is structured similar to store_flag_constants, though
simplified where obviously possible.

If we look at a couple subtests within the loongarch conditional-move-opt-1.c
testcase, but compiling for RISC-V:

extern long lm, lr;

void
test_nez ()
{
  if (lm != 0)
    lr <<= (1 << 4);
  lr += lm;
}

void
test_eqz ()
{
  if (lm == 0)
    lr >>= (1 << 2);
  lr += lm;
}

The relevant conditional move sequences look like this:

        slli    a3,a5,16
        czero.eqz       t1,a3,t0
        czero.nez       t2,a5,t0
        add     a0,t2,t1
        add     a1,t0,a0

and:

        srai    a3,a5,4
        czero.nez       t1,a3,t0
        czero.eqz       t2,a5,t0
        add     a0,t2,t1
        add     a1,t0,a0

Not bad, but with this patch we clearly do better:

        snez    a3,t0
        slli    t1,a3,4
        sll     t2,a4,t1
        add     a0,t0,t2

and

        seqz    a3,t0
        slli    t1,a3,2
        sra     t2,a4,t1
        add     a0,t0,t2

Probably the same performance as the czeros can execute in parallel, but it's
smaller from an encoding standpoint and doesn't require zicond.

Bootstrapped and regression tested on x86_64, alpha, armv7, loongarch64,
riscv64 (k3, k1 and c920). Probably others as well, though I didn't check other
natives explicitly to see if it'd picked up the latest version of the patch.
Interestingly enough this does trigger meaningfully during bootstraps on
various targets as I stumbled across multiple failures due to a couple logic
errors in earlier versions.

There's still things that could be improved in here.  Most obviously AND
handling, cases where STORE_FLAG_VALUE != 1 (which likely work due to
normalization, but our ability to test is limited), exploiting negated logicals
for things like conditional bit clear, etc.  Even with the limitations, this
seems worthwhile to go forward now.

Pushing to the trunk.

PR target/125731

gcc/
* ifcvt.cc (noce_cond_zero_binary_op_supported): Move earlier.
(noce_try_shifted_store_flag): New function.
(noce_process_if_block): Use it.

gcc/testsuite
* gcc.target/riscv/pr125731-1.c: New test.
* gcc.target/riscv/rvv/vsetvl/vsetvl-15.c: Drop shift count test.

2 weeks agouse vrp_operand_equal_p in points to comparisons.
Andrew MacLeod [Fri, 17 Jul 2026 15:53:51 +0000 (11:53 -0400)] 
use vrp_operand_equal_p in points to comparisons.

IPA iunshares points-to info for prange storage objects. This means they
may point to the same logical object, but have different physical pointer
values.

A prange_storage object is a hunk of memory, and it will continue to use
raw pointer comparisons for equality.  Otherwise things like hash table
lookups will think there are different hashs for the same item.

Prange however should use vrp_operand_equal_p for comparisons.  This will
prevent two prange objects from comparing unequal due to tree unsharing.

PR tree-optimization/126222
* value-range-storage.cc (prange_storage::equal_p): Comment change.
* value-range.h (prange::pt_equal_p): Use vrp_operand_equal_p.

2 weeks agoRecompute relations during a relation query walk.
Andrew MacLeod [Thu, 16 Jul 2026 15:56:17 +0000 (11:56 -0400)] 
Recompute relations during a relation query walk.

While querying relations we do a DOM walk.  This patch adds a query that
will recompute potential relations on edges which look promising.

PR tree-optimization/126212
gcc/
* value-relation.cc (dom_oracle::set_one_relation): Start with
first dominator in the dominator search.
(dom_oracle::recomputed_relation): New.
(dom_oracle::find_relation_dom): query recomputed_relation.
* value-relation.h (dom_oracle::recomputed_relation): New prototype.

gcc/testsuite/
* gcc.dg/pr126212.c: New.

2 weeks agoEnhance logical AND and OR op1_range.
Andrew MacLeod [Thu, 16 Jul 2026 20:43:40 +0000 (16:43 -0400)] 
Enhance logical AND and OR op1_range.

The rangeops should recognize that
  [0, 0] = op1 & TRUE    -->  op1 must be [0, 0]
  [1, 1] = op1 | FALSE   -->  op1 must be [1, 1]

op2_range simple transposes the operands, so this covers both cases.

PR tree-optimization/126212
* range-op.cc (operator_logical_and::op1_range): Add case for
[0, 0] = op1 & [1, 1]
(operator_logical_or::op1_range): Add case for [1, 1] = op1 | [0, 0]

2 weeks agoDaily bump.
GCC Administrator [Sun, 19 Jul 2026 00:16:30 +0000 (00:16 +0000)] 
Daily bump.

2 weeks ago[PATCH] RISC-V: Fix the LRA crashing triggered by TLSDESC clobber updates
Luke Zhuang [Sat, 18 Jul 2026 20:29:18 +0000 (14:29 -0600)] 
[PATCH] RISC-V: Fix the LRA crashing triggered by TLSDESC clobber updates

An LRA crashing is found by fuzz-testing, and is triggered by
<0748d2c83fc>. We can avoid it by replacing RVVM8QI with RVVM1QI,
and may need to fix the LRA later.

A reduced test is appended as well, demonstrating the crash.

gcc/ChangeLog:

* config/riscv/riscv.md (@tlsdesc<mode>): Use individual
RVVM1QI clobbers instead of four RVVM8QI.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/tlsdesc_clobber_lra.c: New test.

Co-authored-by: Kito Cheng <kito.cheng@sifive.com>
2 weeks ago[PATCH] RISC-V: Do not grow complete unrolling at -O2
wangjue [Sat, 18 Jul 2026 16:52:23 +0000 (10:52 -0600)] 
[PATCH] RISC-V: Do not grow complete unrolling at -O2

RISC-V enables -funroll-loops at -O2 for small-loop unrolling.  Keep
size-growing complete unrolling disabled unless unrolling is explicitly
requested.

gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_override_options_after_change): New
function.
(riscv_option_override): Call it.
(TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): Define.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/unroll-explicit-attr-cunroll.c: New test.
* gcc.target/riscv/unroll-small-loop-cunroll.c: New test.

2 weeks ago[PR target/123883] Inefficient bit manipulation code on RISC-V port
Dusan Stojkovic [Sat, 18 Jul 2026 16:38:41 +0000 (10:38 -0600)] 
[PR target/123883] Inefficient bit manipulation code on RISC-V port

With changes to the RISC-V backend, it's possible to get the desired code
generation for this test with a simple match.pd pattern.

Essentially we have (1 << N) & (1 << N) where each shift is in a different
type.  With some constraints, we can collapse that down to just (1 << N) in
the wider type.  That in turn allows collapsing the entire sequence down to
a single bit set (6 instructions -> 3 instructions on rv64gcb).

PR target/123883

gcc/ChangeLog:

* match.pd ((1<<N) & (1<<N) with different types): New
pattern.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/pr123883-a.c: New test.
* gcc.target/riscv/pr123883-b.c: New test.

2 weeks ago[PATCH] lra: mark the hard frame pointer live when LRA decides it is needed [PR117184]
Matt Turner [Sat, 18 Jul 2026 16:32:39 +0000 (10:32 -0600)] 
[PATCH] lra: mark the hard frame pointer live when LRA decides it is needed [PR117184]

ira_setup_eliminable_regset calls df_set_regs_ever_live for the hard frame
pointer when it decides frame_pointer_needed.  LRA can reach that decision
later instead, in setup_can_eliminate, when it finds the frame pointer to
stack pointer elimination is not possible after all, but it does not mark the
register live there.

A target whose prologue decides which registers to save from
df_regs_ever_live_p then sets up the frame pointer without saving the caller's
value.  On alpha this miscompiles pge while bootstrapping the Modula-2 front
end (PR117184): alpha_compute_frame_layout leaves $15 out of the save mask, so
alpha_expand_prologue emits the "mov $30,$15" that clobbers it but no matching
store, while alpha_expand_epilogue restores the register whenever
frame_pointer_needed, from an fp_offset that stayed 0 -- the return address
slot.  The caller gets its call-saved $15 back as a code address, which shows
up much later as a NULL dereference, and the Modula-2 runtime turns the
resulting SIGSEGV into an unhandled exception:

  terminate called after throwing an instance of 'unsigned int'

The testcase needs the VLA to reach the caller by inlining: a caller with its
own VLA has cfun->calls_alloca set, so IRA already knows a frame pointer is
needed and marks $15 live itself.

Do what IRA does, so the two paths agree.

PR target/117184
gcc/
* lra-eliminations.cc (setup_can_eliminate): Mark the hard frame
pointer live when setting frame_pointer_needed.

gcc/testsuite/
* gcc.target/alpha/frame-pointer-save-1.c: New test.

2 weeks agoLoongArch: fix par_const_vector_shf_set_operand for vshuf4i [PR 126200]
Xi Ruoyao [Tue, 14 Jul 2026 07:03:19 +0000 (15:03 +0800)] 
LoongArch: fix par_const_vector_shf_set_operand for vshuf4i [PR 126200]

The logic of par_const_vector_shf_set_operand (actually,
loongarch_const_vector_shuffle_set_p) expect mode to have the same
element count as the shuffled vector.  But the lsx_vshuf4i_<lsxfmt_f>
definition have VOIDmode for the mode of the selector, thus the
predicate actually accepts anything.  The issue was somehow latent until
recently fwprop1 seems improved on folding two vec_select into one.

Change par_const_vector_shf_set_operand to a special predicate so we can
specify a mode different from the actual mode of the selector parallel
(in VOIDmode) to the predicate.  Then specify VIMODE to satisfy the
expectation of loongarch_const_vector_shuffle_set_p.

PR target/126200

gcc/

* config/loongarch/predicates.md
(par_const_vector_shf_set_operand): Define as special predicate.
* config/loongarch/lsx.md (lsx_vshuf4i_<lsxfmt_f>): Pass VIMODE
to the predicate of selector.

gcc/testsuite/

* gcc.target/loongarch/vector/lsx/pr126200.c: New test.

2 weeks agoRISC-V: Split the pr112431-13 test in to 2 file
Pan Li [Sat, 18 Jul 2026 03:23:16 +0000 (11:23 +0800)] 
RISC-V: Split the pr112431-13 test in to 2 file

The vfwcvt_x_f_v and vfwcvt_rtz_x_f_v are placed in
one file, and when allow overlap for vfwcvt_x_f_v.
The csrr scan still xfail.

Therefore, split it into two files to make sure
both the vfwcvt_x_f_v and vfwcvt_rtz_x_f_v has
no csrr after enable overlap.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/base/pr112431-13.c: Move to...
* gcc.target/riscv/rvv/base/pr112431-13-0.c: ...here.
* gcc.target/riscv/rvv/base/pr112431-13-1.c: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>
2 weeks agoRISC-V: Add test cases for vfwcvtu.xu.f.v reg overlap
Pan Li [Thu, 16 Jul 2026 04:57:53 +0000 (12:57 +0800)] 
RISC-V: Add test cases for vfwcvtu.xu.f.v reg overlap

Add test cases for vfwcvt.xu.f.v register group overlap, please
note it is not overlap as much as possible.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_xu-f16-m1.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_xu-f16-m2.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_xu-f16-m4.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_xu-f16-mf2.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_xu-f16-mf4.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_xu-f32-m1.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_xu-f32-m2.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_xu-f32-m4.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_xu-f32-mf2.c: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>
2 weeks agoRISC-V: Add test cases for vfcvt.x.f.v reg overlap
Pan Li [Thu, 16 Jul 2026 04:57:02 +0000 (12:57 +0800)] 
RISC-V: Add test cases for vfcvt.x.f.v reg overlap

Add test cases for vfwcvt.x.f.v register group overlap, please
note it is not overlap as much as possible.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_x-f16-m1.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_x-f16-m2.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_x-f16-m4.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_x-f16-mf2.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_x-f16-mf4.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_x-f32-m1.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_x-f32-m2.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_x-f32-m4.c: New test.
* gcc.target/riscv/rvv/autovec/group_overlap/vfwcvt_x-f32-mf2.c: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>
2 weeks agoRISC-V: Allow RVV register overlap for vfwcvt.x[u].f.v
Pan Li [Thu, 16 Jul 2026 04:55:25 +0000 (12:55 +0800)] 
RISC-V: Allow RVV register overlap for vfwcvt.x[u].f.v

Like v[sz]ext.vf8, allow the rvv register overlap
for vfwcvt.x[u].f.v.

gcc/ChangeLog:

* config/riscv/vector.md: Leverage Wvr constraint.

Signed-off-by: Pan Li <pan2.li@intel.com>
2 weeks agoShow details of attr->allocated with -fdump-fortran-original.
Thomas Koenig [Sat, 18 Jul 2026 08:41:23 +0000 (10:41 +0200)] 
Show details of attr->allocated with -fdump-fortran-original.

This simple and obvious patch adds output for the var_allocated enum,
to make the status of where the gfortran thinks a potential allocation
came from more clear.

Instead of (example from warn_unused_but_set_variable_4.f90)

attributes: (VARIABLE  ALLOCATABLE DIMENSION REFERENCED VALUE-SET(INTENT-OUT) ALLOCATED)

this now displays

attributes: (VARIABLE  ALLOCATABLE DIMENSION REFERENCED VALUE-SET(INTENT-OUT) ALLOCATED(ARG))

No user impact (unless the user is exceptionally curious) and no test
case.

gcc/fortran/ChangeLog:

PR fortran/126058
* dump-parse-tree.cc (show_attr): Show details of
attr->allocated.

2 weeks agoDaily bump.
GCC Administrator [Sat, 18 Jul 2026 00:16:38 +0000 (00:16 +0000)] 
Daily bump.

2 weeks agocobol: portability for Darwin.
James K. Lowden [Fri, 17 Jul 2026 20:25:30 +0000 (16:25 -0400)] 
cobol: portability for Darwin.

With this change https://github.com/iains/gcc-darwin-arm64 commit
f576c64ad77e65fb054365839a4ea80a79398e45 builds successfully.

gcc/cobol/ChangeLog:

PR cobol/122466
* copybook.h: Include sys/types.h
* parse.y: Cast size for printf %lu parameter.
* util.cc (cobol_filename): Same.

2 weeks agotestsuite, aarch64: Require -mbig-endian support where it is missing.
Iain Sandoe [Wed, 15 Jul 2026 06:42:35 +0000 (07:42 +0100)] 
testsuite, aarch64: Require -mbig-endian support where it is missing.

The tests here require support for big endian code generation but do
not require a big endian host.

We provide an aarch64_mbig_endian target supports check fot this an
use it to gate the tests.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/and-be.c: Require big-endian support.
* gcc.target/aarch64/fmov-1-be.c: Likewise.
* gcc.target/aarch64/fmov-2-be.c: Likewise.
* gcc.target/aarch64/fmov-3-be.c: Likewise.
* gcc.target/aarch64/fmov-4-be.c: Likewise.
* gcc.target/aarch64/fmov-5-be.c: Likewise.
* gcc.target/aarch64/ins_bitfield_2.c: Likewise.
* gcc.target/aarch64/ins_bitfield_4.c: Likewise.
* gcc.target/aarch64/ins_bitfield_6.c: Likewise.
* gcc.target/aarch64/pr124078-1.c: Likewise.
* gcc.target/aarch64/pr62308.c: Likewise.
* gcc.target/aarch64/pr87305.c: Likewise.
* gcc.target/aarch64/sve/acle/general/dupq_2.c: Likewise.
* gcc.target/aarch64/sve/acle/general/dupq_4.c: Likewise.
* gcc.target/aarch64/sve/acle/general/dupq_6.c: Likewise.
* gcc.target/aarch64/sve/acle/general/dupq_lane_9.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_5_be_bf16.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_5_be_f16.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_5_be_f32.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_5_be_f64.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_5_be_mf8.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_5_be_s16.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_5_be_s32.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_5_be_s64.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_5_be_s8.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_5_be_u16.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_5_be_u32.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_5_be_u64.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_5_be_u8.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_6_be_bf16.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_6_be_f16.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_6_be_f32.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_6_be_f64.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_6_be_mf8.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_6_be_s16.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_6_be_s32.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_6_be_s64.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_6_be_s8.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_6_be_u16.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_6_be_u32.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_6_be_u64.c: Likewise.
* gcc.target/aarch64/sve/pcs/args_6_be_u8.c: Likewise.
* gcc.target/aarch64/sve/pcs/saves_1_be_nowrap.c: Likewise.
* gcc.target/aarch64/sve/pcs/saves_1_be_wrap.c: Likewise.
* gcc.target/aarch64/sve/pcs/saves_2_be_nowrap.c: Likewise.
* gcc.target/aarch64/sve/pcs/saves_2_be_wrap.c: Likewise.
* gcc.target/aarch64/sve/pcs/saves_4_be.c: Likewise.
* gcc.target/aarch64/sve/pcs/saves_5_be.c: Likewise.
* gcc.target/aarch64/sve/pr88847.c: Likewise.
* gcc.target/aarch64/sve/revb_2.c: Likewise.
* gcc.target/aarch64/sve/revh_2.c: Likewise.
* gcc.target/aarch64/sve/revhw_2.c: Likewise.
* gcc.target/aarch64/sve/revw_2.c: Likewise.
* gcc.target/aarch64/sve/struct_move_1.c: Likewise.
* gcc.target/aarch64/sve/struct_move_2.c: Likewise.
* gcc.target/aarch64/sve/struct_move_3.c: Likewise.
* gcc.target/aarch64/sve/vec_init_4.c: Likewise.
* lib/target-supports.exp: Provide aarch64_mbig_endian.

gcc/ChangeLog:

* doc/sourcebuild.texi: Document aarch64_mbig_endian.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2 weeks agocobol: Repair errors in man page.
James K. Lowden [Fri, 17 Jul 2026 19:56:05 +0000 (15:56 -0400)] 
cobol: Repair errors in man page.

gcc/cobol/ChangeLog:

PR cobol/122916
* gcobol.1: Remove blank line and escape characters in width arguments.

2 weeks agomatch: Move tree_expr_nonnegative_p (@1) to tree_expr_nonnegative_p@1. [PR126087]
Kael Andrew Alonzo Franco [Fri, 17 Jul 2026 18:14:26 +0000 (14:14 -0400)] 
match: Move tree_expr_nonnegative_p (@1) to tree_expr_nonnegative_p@1. [PR126087]

This simplify r17-2487.

Bootstrapped and tested on x86_64-pc-linux-gnu.

PR tree-optimization/126087

gcc/ChangeLog:

* match.pd: Move tree_expr_nonnegative_p (@1) to tree_expr_nonnegative_p@1.

Signed-off-by: Kael Andrew Franco <kaelfandrew@gmail.com>
2 weeks agoOpenMP: docs - improve -fopenmp-ompt(-detailed) description + update impl. status
Tobias Burnus [Fri, 17 Jul 2026 15:19:46 +0000 (17:19 +0200)] 
OpenMP: docs - improve -fopenmp-ompt(-detailed) description + update impl. status

invoke.texi: Improve the wording for -fopenmp-ompt(-detailed) that was
added in r17-2288-gab0dd7d5e16fcd.

libgomp.texi: Mark OpenMP 5.1's 'device_type(...)' for variables on
'declare target' as partially implemented as parsing support was added for
C/C++ in r10-2342-g77eb117f588686 and for Fortran in r11-2858-gd58e7173ef964d.

(device_type: It actually seems to work fine, even though there is almost no
code to handle 'host' differently; still host/nohost handling should be
improved for vars and funcs; hence, marked as only partial not as fully
supported.)

gcc/ChangeLog:

* doc/invoke.texi (-fopenmp-ompt, -fopenmp-ompt-detailed): Improve
wording.

libgomp/ChangeLog:

* libgomp.texi (OpenMP 5.1 Impl Status): Mark device_type on vars
in declare target as 'P'.

2 weeks agoaarch64: deprecate the TME extension
Richard Earnshaw [Tue, 7 Jul 2026 16:14:07 +0000 (17:14 +0100)] 
aarch64: deprecate the TME extension

Arm has sunset the TME extension from the aarch64 architecture since
there are no known implementations.  Since this has been present in the
compiler for a while though, we need to go through a deprecation cycle.

This patch starts that process by:
 - removing it from the documentation
 - warning if the option is used during compilation
 - removing the tests for it.

gcc/ChangeLog:

* config/aarch64/aarch64.cc (aarch64_override_options): Warn if
+tme is used as an architecture feature
(aarch64_process_target_attr): Similarly, but only if TME
was previously disabled.
* doc/invoke.texi (aarch64): Remove mentions of +tme.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/pragma_cpp_predefs_2.c: Drop tests for TME.
* gcc.target/aarch64/acle/tme.c: Removed.
* gcc.target/aarch64/acle/tme_guard-1.c: Removed.
* gcc.target/aarch64/acle/tme_guard-2.c: Removed.
* gcc.target/aarch64/acle/tme_guard-3.c: Removed.
* gcc.target/aarch64/acle/tme_guard-4.c: Removed.

2 weeks ago[PATCH] alpha: do not gate cannot_copy_insn_p on reload_completed
Matt Turner [Fri, 17 Jul 2026 13:26:12 +0000 (07:26 -0600)] 
[PATCH] alpha: do not gate cannot_copy_insn_p on reload_completed

alpha_legitimize_address emits movdi_er_tlsgd and movdi_er_tlsldm together
with their paired call_value_osf_tlsgd/tlsldm at expand time, and both halves
already carry the sequence number that ties the pair together.  Those patterns
are marked with the cannot_copy attribute, but alpha_cannot_copy_insn_p
returned false whenever !reload_completed, so the hook had no effect on any
pass running before register allocation.

Unrolling a loop whose body contains such a pair therefore copies the sequence
number along with it.  With

  extern __thread int tv;
  extern int cond (int);
  int f (int n)
  {
    int s = 0;
    for (int i = 0; i < n; i++)
      if (cond (i))
s += tv;
    return s;
  }

compiled with -O2 -funroll-loops -fno-move-loop-invariants -fPIC
-ftls-model=global-dynamic, the unroller produces seven copies of !tlsgd!1 and
the assembler rejects the result:

  Error: duplicate !tlsgd!1
  Error: too many lituse insns for !lituse_tlsgd!1

Drop the reload_completed test.  The gpdisp pairs are only created after
reload, so this does not change their handling; it only lets the hook protect
the TLS pairs that already exist before register allocation.  This is
independent of the register allocator: the failure reproduces identically with
both reload and LRA.

gcc/
* config/alpha/alpha.cc (alpha_cannot_copy_insn_p): Do not return
false before reload_completed.  Update comment.

gcc/testsuite/
* gcc.target/alpha/tlsgd-dup-1.c: New test.

2 weeks agocobol: Filename-as-device; normalize special registers.
Robert Dubner [Fri, 17 Jul 2026 12:19:51 +0000 (08:19 -0400)] 
cobol: Filename-as-device; normalize special registers.

The compiler now parses a new feature where a filename can be
established using the device syntax.  It awaits implementation in the
code generator.

The variables "literally_zero" and "literally_zero" are now established
as global constants in libgcobol instead of as constructed temporary
variables.

The initialization of "special registers", and the necessary
coordination between their compile-time cbl_field_t and run-time
cblc_field_t counterparts has been normalized.

gcc/cobol/ChangeLog:

* genapi.cc (parser_file_open): New filename-as-device feature
awaiting implementation.
* lexio.h (struct filespan_t): Variable name change.
* parse.y: Filename-as-device.
* parse_ante.h (field_find): Likewise.
(data_division_ready): _literally_zero and _literally_one global
constants.
* scan.l: Require separate space after '<', '>' and '=' comparison
operators.
* scan_ante.h (update_location): Change debug message text.
* symbols.cc (constq): Eliminate #define in favor of explicit
(constant_e | quoted_e).
(label_cmp): Formatting: eliminate trailing space.
(symbol_elem_cmp): Filename-as-device.
(enum protoreq_t): Formatting: eliminate trailing space.
(cbl_field_t::clear_attr): Likewise.
(symbols_dump): Likewise.
(cbl_field_t::attr_str): Likewise.
(field_str): Likewise.
(symbols_update): Use _literally_zero and _literally_one.
(endian_bit): Compact access to cobol_target_big_endian().
(symbol_table_init): Normalize initialization of "special
registers".
(symbol_registers_add): Likewise.
(cbl_perform_tgt_t::recurses): Formatting: eliminate trailing space.
(symbol_literalA): Replace constq.
(cbl_alphabet_t::reencode): Eliminate trailing space.
(symbol_temporary_alphanumerics): Likewise.
(new_literal_add): Likewise.
(new_temporary_clone): Ensure FldLiteralBin5 has the endian attribute of
the target architecture.
(iconv_cd): Formatting: eliminate trailing space.
(cbl_field_t::encode): Likewise.
(cbl_field_t::set_capacity): Formatting: eliminate trailing space.
(cbl_label_t::str): Likewise.
(cbl_file_t::special_index): New function supporting
filename-as-device.
(cbl_file_t::filename_of): Likewise.
* symbols.h (struct cbl_special_name_t): Support filename as device.
(struct cbl_file_t): Likewise.
(symbol_typedef): Likewise.
(symbol_special_index): Likewise.

libgcobol/ChangeLog:

* charmaps.h (ebcdic_newline): Use just SPACES instead of both
SPACE and SPACES.
* constants.cc (INTEGER_CONSTANT1): Eliminate.
(struct cblc_field_t): Eliminate __gg__data_space.
(INTEGER_CONSTANT2): Eliminate.
(endian): Adjust the initialization of __ggsr__spaces and the
various DEBUG-ITEM components.
* libgcobol.cc (alpha_to_alpha_move_from_location): Correct a comment.
(__gg__codeset_figurative_constants): Normalize using SPACES when SPACE is
specified.
(__gg__get_figconst_data): Likewise.

gcc/testsuite/ChangeLog:

* cobol.dg/group2/INITIALIZE_with_-defaultbyte__ASCII_.cob: Use
"VALUE '-'" instead of "VALUE'-'".
* cobol.dg/group2/INITIALIZE_with_-defaultbyte__EBCDIC_.cob:
Likewise.
* cobol.dg/group2/PR59_RT3586_-_Code_format_heuristic_fails.cob: Removed.
* cobol.dg/group2/RT3609_Unexpected_PROCESS.cob: Removed.
* cobol.dg/group2/DEBUG-ITEM_using_mh_identical.cob: New test.
* cobol.dg/group2/DEBUG-ITEM_using_mh_identical.out: New test.

2 weeks agoFix signed char test assumption [Was Re: [Linaro-TCWG-CI] gcc-17-2261-g649b2a6d9f9f...
Jeff Law [Fri, 17 Jul 2026 13:14:13 +0000 (07:14 -0600)] 
Fix signed char test assumption [Was Re: [Linaro-TCWG-CI] gcc-17-2261-g649b2a6d9f9f: 7 regressions on arm]

> Dear contributor,
>
> Our automatic CI has detected problems related to your patch(es). Please find some details below.
>
> In  armv8l-unknown-linux-gnueabihf native, after:
>   | commit gcc-17-2261-g649b2a6d9f9f
>   | Author: Jeff Law <jeffrey.law@oss.qualcomm.com>
>   | Date:   Wed Jul 8 12:30:56 2026 -0600
>   |
>   |     [PR rtl-optimization/126136] Fix dest = cond ? x : -1 when STORE_FLAG_VALUE is -1
>   |
>   |     So a while back I added support for selecting x/-1 into the ifcvt.cc by using
>   |     scc and a couple ALU operations.  That code explicitly rejects STORE_FLAG_VALUE
>   |     if it is not 1 or -1.
>   | ... 20 lines of the commit log omitted.
>
> Produces 7 regressions:
>   |
>   | regressions.sum:
>   | Running gcc:gcc.dg/torture/dg-torture.exp ...
>   | FAIL: gcc.dg/torture/pr126136.c -O0  execution test
>   | FAIL: gcc.dg/torture/pr126136.c -O1  execution test
>   | FAIL: gcc.dg/torture/pr126136.c -O2  execution test
>   | FAIL: gcc.dg/torture/pr126136.c -O2 -flto -fno-use-linker-plugin -flto-partition=none  execution test
>   | ... and 3 more
>
> Used configuration :
>  *CI config* tcwg_gcc_check armv8l-unknown-linux-gnueabihf
>  *configure and test flags:* none, autodetected on armv8l-unknown-linux-gnueabihf--disable-multilib --with-float=hard --with-mode=thumb --with-tune=cortex-a9 --with-arch=armv7-a --with-fpu=neon-fp-armv8
>
> We track this bug report under https://linaro.atlassian.net/browse/GNU-1959. (Require Linaro login) Please let us know if you have a fix.

As others noted, this is a case where the test assumed signed chars.  The patch
makes the signedness explicit.

Bootstrapped and regression tested on armv7 and verified the test now passes on
that platform.  Pushing to the trunk.

gcc/testsuite

* gcc.dg/torture/pr126136.c: Make chars explicitly signed.

2 weeks ago[PATCH] RISC-V: Remove zama16b from xt-c9501fdvt
Wang Yaduo [Fri, 17 Jul 2026 13:08:16 +0000 (07:08 -0600)] 
[PATCH] RISC-V: Remove zama16b from xt-c9501fdvt

The binutils has not supported zama16b.  Do not enable the extension
through -mcpu=xt-c9501fdvt.

gcc/ChangeLog:

* config/riscv/riscv-cores.def (RISCV_CORE): Remove zama16b from
xt-c9501fdvt.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/mcpu-xt-c9501fdvt.c: Expect __riscv_zama16b
to be undefined.

Signed-off-by: Wang Yaduo <wangyaduo@linux.alibaba.com>
2 weeks agolto: Support #pragma GCC diagnostic [PR80922] [PR106823] [PR107936]
Lewis Hyatt [Sat, 11 Jul 2026 18:21:12 +0000 (14:21 -0400)] 
lto: Support #pragma GCC diagnostic [PR80922] [PR106823] [PR107936]

After the previous changes in this series, the LTO front end always has an
appropriate linemap structure for interpreting diagnostic pragmas, so it is
straightforward to implement them, as is done here.

The pragmas are streamed out in each linemap section; since all locations
from a given linemap section will be contiguous in the reconstructed
linemap, they are automatically ordered properly for the existing diagnostic
pragma infrastructure to work as-is.

One wrinkle is that a single function may have been streamed out in multiple
sections. (For example, an inline function will be streamed out in all
partitions that need it.) In this case, when merging them, LTO keeps only
one of the sections, as directed by the linker resolution, so the diagnostic
pragmas that will be in force (in case they were not the same for the
different translation units) will be whichever were applicable to the
section LTO decided to keep.

gcc/ChangeLog:

PR middle-end/80922
PR middle-end/106823
PR lto/107936
* lto-streamer-in.cc (lto_create_loc_map): Process diagnostic
pragmas from the linemap sections.
* lto-streamer-out.cc (location_output::produce_linemap_section):
Stream diagnostic pragmas into the linemap section.

gcc/testsuite/ChangeLog:

PR middle-end/80922
PR middle-end/106823
PR lto/107936
* gcc.dg/lto/pr106823_0.c: New test.
* gcc.dg/lto/pr107936_0.c: New test.
* gcc.dg/lto/pr107936_1.c: New test.
* gcc.dg/lto/pr80922-1_0.c: New test.
* gcc.dg/lto/pr80922-1_1.c: New test.
* gcc.dg/lto/pr80922-2_0.c: New test.
* gcc.dg/lto/pr80922-2_1.c: New test.
* gcc.dg/lto/pr80922-2_2.c: New test.

2 weeks agolto: Overhaul approach to location streaming [PR65536]
Lewis Hyatt [Sat, 11 Jul 2026 18:21:12 +0000 (14:21 -0400)] 
lto: Overhaul approach to location streaming [PR65536]

PR65536 is about location-related issues that arise when the LTO front end
reads one or several large object files and runs out of location_t space to
encode all the locations. The main reason for the potential problem is that
the libcpp linemap is designed to be used for incrementally reading source
files (and their included header files) in the natural order. When it is
used in another way, such as by LTO, which adds locations in the order in
which it happened to read different entities, then the assumptions that
justify its design are no longer applicable, and it is not hard to run out
of location_t values (e.g., because of a large number of file changes, or
lines being added out of order.)

The PR remains open because it is not theoretically resolved, but it has
been resolved for all practical purposes by the following two improvements:

    1) The lto_location_cache class now tries hard to optimize the number of
       maps that it creates, especially by sorting the locations before
       adding them. This approach only goes so far, because it can only work
       at the LTO section level, so each function is handled independently
       of the others, but it helps a lot with reducing the number of maps
       required for a single function.

    2) We moved to 64-bit location_t, which means everything is a lot more
       forgiving of wasting location_t space.

Point 2) made this not much of an issue in practice, although sufficiently
large files (especially with very long lines) could still trigger a problem
in theory. While locations are now by and large working fine in LTO, there
was an interesting discussion on PR65536, starting around:

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65536#c8

about how the location streaming might be optimized by streaming the linemap
structure itself, rather than a (file name, line number, column number)
triplet for each location. In the end, this approach was not taken because
solution 1) above was adequate and less disruptive. But the arguments
presented in favor of streaming the linemap directly are still interesting.

That discussion did not touch on another topic, namely the need to make
`#pragma GCC diagnostic' usable in LTO. Right now, it does not work, because
the diagnostic pragmas are not streamed out. But even if they were streamed
out, the existing approach to locations in the LTO front end is not
compatible with enforcing the pragmas. Diagnostic pragmas require a global
ordering on location_t values, so that the machinery in option-classifier.cc
can determine which pragmas are in force at each location. This requires
remembering the order in which each source line was encountered, and that is
exactly what is encoded in the linemap. This cannot be reconstructed just
from source file names and line numbers; consider, for example, that the
same file might be used in different translation units or multiple times in
the same translation unit with different diagnostic pragmas in place each
time.

These considerations tip the scales in favor of adding linemap streaming as
Manuel proposed on the PR. This patch prepares to support `#pragma GCC
diagnostic' in the LTO front end by changing the approach to location
streaming along these lines. The new approach has these general
characteristics:

    o There is a new LTO section (LTO_section_linemap) that contains the
      information needed to reconstruct the linemap. There is an entry for
      each line_map_ordinary object that was used by at least one
      streamed-out location. When the LTO front end reads one of these map
      entries, it adds a new map with the corresponding properties to its
      own linemap using the new line_map_add_raw_map interface in libcpp.

    o When a location needs to be output, we stream out two integers: one to
      identify which linemap contains the location, and one containing the
      offset from the start of that map to the location.

    o When the language front ends stream out their data, they produce a
      single linemap section (labeled as linemap.0) that applies to the
      whole translation unit. When WPA prepares partitioned files for
      LTRANS, it may copy function bodies into the LTRANS files without
      reading them, so it needs also to copy the linemap sections they refer
      to. Since the same linemap section will often be needed by more than
      one partition, this is done by putting all of the linemap sections
      into one additional object file, which is provided as input to each
      LTRANS process via the new option -fltrans-linemap-file.

    o The naming of the LTRANS linemap sections is stable so as not to
      inhibit incremental LTO.

    o Once the reader has processed the linemap sections, there is no
      further overhead associated with inputting a location, unless it is an
      adhoc location for the purpose of associating a discriminator or a
      tree with the location. For the adhoc location case, the existing
      lto_location_cache setup is still useful to avoid creating unneeded
      adhoc locations, so this has been left in place as before. The
      restriction that there be only one lto_location_cache at a time is no
      longer strictly necessary; but it is still useful so that the IPA
      passes can access the currently active one simply, so I have not
      changed this for now.

With this new setup, PR65536 can be closed.  The subsequent patches in this
series will enable support for diagnostic pragmas.

gcc/lto/ChangeLog:

PR lto/65536
* lang.opt: Add -fltrans-linemap-file.
* lto-common.cc (lto_read_in_decl_state): Read the linemap ID from
function sections.
(linemap_section_id): New function.
(create_subid_section_table): Note how many linemap sections were
found in each input section.
(loc_map_decl_data): New GC root.
(lto_file_read): Make ORDER into a static variable so it counts
continuously across all files and sub-files provided on the command
line.
(lto_file_finalize): Handle reading the new LTRANS linemap file.
(read_cgraph_and_symbols): Likewise. Also stop freeing
ALL_FILE_DECL_DATA at the end; the ordered list of files is now
useful later on for lto_copy_linemaps().
* lto.cc (stream_out_linemaps): New function.
(lto_wpa_write_files): Stream out the linemaps for LTRANS to use.

gcc/testsuite/ChangeLog:

PR lto/65536
* gcc.misc-tests/outputs.exp: Adjust LTO -save-temps tests to expect
the new linemap file.

gcc/ChangeLog:

PR lto/65536
* doc/lto.texi: Document the new LTO_section_linemap and the new
option -fltrans-linemap-file.
* lto-opts.cc (lto_write_options): Handle the new option.
* opts.cc (gen_command_line_string): Likewise.
* lto-section-in.cc (lto_section_name[]): Add new name for
LTO_section_linemap.
* lto-streamer-in.cc (get_location_from_idx): New function.
(lto_location_cache::cmp_loc): Remove.
(bp_unpack_delta): New function.
(create_loc_map): New function.
(get_loc_map): New function.
(lto_location_cache::override_loc_map): New function.
(lto_location_cache::apply_location_cache): Pervasive changes to
implement new location streaming format.
(lto_location_cache::input_location_and_block): Likewise.
(lto_location_cache::input_location): Rename argument LOC -> DEST
for clarity.
(lto_read_body_or_constructor): Handle LINEMAP_ID in the decl state.
(lto_data_in_create): Add NEED_LOCATION_CACHE argument. Rename local
variable DATA_IN to D to avoid clash with the type name.
* lto-streamer-out.cc (clear_line_info): Update for change to class
output_block.
(compute_map_hash): New function.
(class location_output): New class.
(location_output::record_location): New function.
(bp_pack_delta): New function.
(location_output::produce_linemap_section): New function.
(lto_output_location_1): Pervasive changes to implement new location
streaming format.
(copy_function_or_variable): Set the LINEMAP_ID in the decl state.
(copy_linemap_section): New function.
(copy_linemap_sections): New function.
(lto_copy_linemaps): New function.
(lto_register_linemap_for_output): New function.
(lto_output_decl_state_refs): Output the LINEMAP_ID for function
decls.
(lto_out_decl_state_written_size): Adapt for new LINEMAP_ID output.
(produce_asm_for_decls): Output the linemap section when needed.
* lto-streamer.cc (lto_get_section_name): Handle linemap sections,
which need an order suffix.
* lto-streamer.h (enum lto_section_type): Fix typo in the
comment. Add LTO_section_linemap.
(struct lto_loc_map): New struct.
(class lto_location_cache): Pervasive changes to implement new
location streaming format.
(struct lto_in_decl_state): Add LINEMAP_ID member.
(struct lto_out_decl_state): Likewise.
(struct lto_file_decl_data): Add LOC_MAP_DECL_DATA, LOC_MAPS,
and NUM_LINEMAP_SECTIONS members.
(lto_linemap_output_id): New function.
(struct output_block): Adjust members for new streaming format.
(data_in::data_in): New function.
(lto_data_in_create): Adjust prototype for new NEED_LOCATION_CACHE
argument.
(lto_register_linemap_for_output): Declare.
(lto_copy_linemaps): Declare.
* lto-wrapper.cc (run_gcc): Pass new argument -fltrans-linemap-file.
* timevar.def (TV_IPA_LTO_LINEMAP_IN): New timevar.
(TV_IPA_LTO_LINEMAP_OUT): New timevar.
(TV_IPA_LTO_LINEMAP_COPY): New timevar.

2 weeks agotestsuite: Add { dg-lto-do incr-link } option
Lewis Hyatt [Sat, 11 Jul 2026 18:21:12 +0000 (14:21 -0400)] 
testsuite: Add { dg-lto-do incr-link } option

Similar to { dg-lto-do ar-link }, which allows testing the combination of
multiple LTO objects into an archive before linking, this new directive
allows testing the incremental linking modes of the LTO front end.

gcc/ChangeLog:

* doc/sourcebuild.texi: Document ar-link and incr-link options to
dg-lto-do directive.

gcc/testsuite/ChangeLog:

* gcc.dg/lto/README: Update to document ar-link and incr-link.
* lib/lto.exp: Support incr-link directive throughout.

2 weeks agotestsuite: Add dg-lto-additional-options directive
Lewis Hyatt [Sat, 11 Jul 2026 18:21:12 +0000 (14:21 -0400)] 
testsuite: Add dg-lto-additional-options directive

In the LTO testsuite, tests run by default with a variety of options. If
the dg-lto-options directive is used, the default list is replaced with just
the requested options, so there is no convenient way, for instance, to add a
given option like -Wall to all of the options being tested.

This will be handy for testing `#pragma GCC diagnostic' in the next patch in
this series, so this patch adds a new directive dg-lto-additional-options
for that purpose. This keeps the list of options to test unchanged, and
just adds the requested options to all of them.

gcc/ChangeLog:

* doc/sourcebuild.texi: Document dg-lto-additional-options
directive.

gcc/testsuite/ChangeLog:

* gcc.dg/lto/README: Document dg-lto-additional-options directive.
* lib/lto.exp (lto-get-options-main): Implement
dg-lto-additional-options directive.
(lto-execute-1): Likewise.

2 weeks agodiagnostics: Preparation for LTO diagnostic pragma support
Lewis Hyatt [Sat, 11 Jul 2026 18:21:12 +0000 (14:21 -0400)] 
diagnostics: Preparation for LTO diagnostic pragma support

The next patches in this series will enable support for `#pragma GCC
diagnostic' in the LTO streaming code.  This requires some minor changes to
the diagnostics interface so that LTO can access what it needs:

    1) Make the name of the type option_classifier::classification_change_t
       publicly accessible. The actual m_classification_history object is
       already public via an accessor function, which was needed for C++
       modules; this patch just additionally makes the name of the type
       accessible for convenience.

    2) Add a trailing member to enum diagnostics::kind indicating the
       maximum possible value. This is for the benefit of LTO streaming that
       can make use of the range information.

    3) The function option_classifier::classify_diagnostic() does some work
       to return a value; when a diagnostic kind is changed, it claims to
       return the previous kind. The returned value is incorrect, however;
       it does not attempt to follow the history of diagnostic pop pragmas
       to return the actual previous value, and it could also misinterpret a
       pop directive if the pop index happens to match the index of the
       option being processed.  There is no actual need to compute this
       value, and it has never been used by any callers, so remove it
       entirely.

       This change is not strictly necessary for the rest of this
       patch series, but the extra work being done here may be a bigger
       concern for LTO, which could potentially have a rather large list of
       diagnostic pragmas to work with, so it seemed worthwhile to include
       this fix now.

gcc/ChangeLog:

* diagnostic.h (diagnostic_classify_diagnostic): Adapt for removal
of return value in option_classifier::classify_diagnostic.
* diagnostics/context.h: Likewise.
* diagnostics/kinds.h (enum kind): Add trailing element to indicate
the total number of kinds.
* diagnostics/option-classifier.cc
(option_classifier::classify_diagnostic): Remove the return value,
which was not correct and which was not used anyway.
* diagnostics/option-classifier.h (class option_classifier): Adjust
prototype for classify_diagnostic.  Make the name of nested strruct
classification_change_t publicly accessible.