Age | Commit message (Collapse) | Author | Files | Lines |
|
The problem is that a temporary is created for the conversion because of the
representation change, and it is finalized without having been initialized.
gcc/ada/ChangeLog:
* exp_ch4.adb (Handle_Changed_Representation): Alphabetize local
variables. Set the No_Finalize_Actions flag on the assignment.
|
|
The Potentially_Invalid aspect is used to disable the SPARK assumption
that all read data is valid on a case-by-case basis in GNATprove.
gcc/ada/ChangeLog:
* aspects.ads: Define an identifier for Potentially_Invalid.
* doc/gnat_rm/implementation_defined_aspects.rst: Add section for Potentially_Invalid.
* sem_attr.adb (Analyze_Attribute_Old_Result): Attribute Old is allowed to occur in a
Potentially_Invalid aspect.
* sem_ch13.adb (Analyze_Aspect_Specifications): Handle Potentially_Invalid.
* sem_util.adb (Has_Potentially_Invalid): Returns True iff an entity is subject to the
Potentially_Invalid aspect.
* sem_util.ads (Has_Potentially_Invalid): Idem.
* snames.ads-tmpl: New name for Potentially_Invalid.
* gnat_rm.texi: Regenerate.
|
|
When GNAT was compiling a ghost unit, the ALI file wrongly suggested that this
unit required elaboration counters, which caused linking errors to non-existing
objects.
gcc/ada/ChangeLog:
* sem_ch10.adb (Analyze_Compilation_Unit): Ignored ghost unit need no
elaboration checks.
|
|
This uses truncation for all bases instead of for base 10 only.
gcc/ada/ChangeLog:
* libgnat/s-valued.adb (Integer_to_Decimal): Use truncation for the
scaled divide operation performed for bases other than 10.
|
|
The vectorizer tracks alignment of datarefs with dr_aligned
and dr_unaligned_supported but that's aligned with respect to
the target alignment which can be less aligned than the mode
used for the access. The following fixes this discrepancy
for vectorizing loads and stores. The issue is visible for
aarch64 SVE and risc-v where VLA vector modes have larger than
element alignment but the target handles element alignment
just fine.
PR tree-optimization/118669
* tree-vect-stmts.cc (vectorizable_load): Emit loads
with proper (element) alignment.
(vectorizable_store): Likewise.
|
|
*tls_global_dynamic_64_largepic, *tls_local_dynamic_64_<mode> and
*tls_local_dynamic_base_64_largepic use RDI as the __tls_get_addr
argument. Add RDI clobber to these patterns to show it.
gcc/
PR target/120908
* config/i386/i386.cc (legitimize_tls_address): Pass RDI to
gen_tls_local_dynamic_64.
* config/i386/i386.md (*tls_global_dynamic_64_largepic): Add
RDI clobber and use it to generate LEA.
(*tls_local_dynamic_64_<mode>): Likewise.
(*tls_local_dynamic_base_64_largepic): Likewise.
(@tls_local_dynamic_64_<mode>): Add a clobber.
gcc/testsuite/
PR target/120908
* gcc.target/i386/pr120908.c: New test.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
|
In r15-7532 for PR118856 I introduced a TARGET_EXPR with a
TARGET_EXPR_INITIAL of void_node to express that no initialization is done.
And indeed evaluating that doesn't store a value for the TARGET_EXPR_SLOT
variable.
But then at the end of the full-expression, destroy_value stores void_node
to express that its lifetime has ended. If we evaluate the same
full-expression again, global_ctx->values still holds the void_node, causing
confusion when we try to destroy it again. So clear out any value before
evaluating a TARGET_EXPR_INITIAL of void_type.
PR c++/120684
PR c++/118856
gcc/cp/ChangeLog:
* constexpr.cc (cxx_eval_constant_expression) [TARGET_EXPR]: Clear
the value first if is_complex.
gcc/testsuite/ChangeLog:
* g++.dg/cpp23/range-for10.C: New test.
|
|
|
|
*tls_global_dynamic_64_<mode> uses RDI as the __tls_get_addr argument.
Add RDI clobber to tls_global_dynamic_64 patterns to show it.
PR target/120908
* config/i386/i386.cc (legitimize_tls_address): Pass RDI to
gen_tls_global_dynamic_64.
* config/i386/i386.md (*tls_global_dynamic_64_<mode>): Add RDI
clobber and use it to generate LEA.
(@tls_global_dynamic_64_<mode>): Add a clobber.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
|
Some test cases explicitly set -march or -mcpu with extensions which
are not compatible with the E ABI variants. This leads to spurious
errors when toolchain has been configured for RV32E base ISA and
ILP32E ABI:
cc1: error: ILP32E ABI does not support the 'D' extension
Also, test gcc.target/riscv/rvv/base/pr119164.c implicitly requires
rv64 since it explicitly selects -march=rv64gcv_zvl256b:
cc1: error: ABI requires '-march=rv32'
Testing done:
- Ensured cross riscv64-unknown-linux-gnu has no difference in test
output with and without the patch.
- For riscv32-unknown-elf there are no new failures. Test case pr119164.c
no longer fails and is now marked as unsupported.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/mcpu-xt-c908.c: Disable for E ABI variants.
* gcc.target/riscv/mcpu-xt-c908v.c: Ditto.
* gcc.target/riscv/mcpu-xt-c910.c: Ditto.
* gcc.target/riscv/mcpu-xt-c910v2.c: Ditto.
* gcc.target/riscv/mcpu-xt-c920.c: Ditto.
* gcc.target/riscv/mcpu-xt-c920v2.c: Ditto.
* gcc.target/riscv/pr118241.c: Ditto.
* gcc.target/riscv/pr120223.c: Ditto.
* gcc.target/riscv/rvv/base/pr119164.c: Disable for E ABI variants
and for 32-bit ISA.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
|
|
It corrects the shift type of interleaved stepped patterns for const vector
expanding in LRA. The shift instruction was initially LSHIFTRT, and it seems
still should be the same type for both LRA and other cases.
PR target/120356
gcc/ChangeLog:
* config/riscv/riscv-v.cc
(expand_const_vector_interleaved_stepped_npatterns):
Fix ASHIFT to LSHIFTRT insn.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/pr120356.c: New test.
|
|
When doing --param vect-partial-vector-usage=1 we'd continue querying
the target whether it wants more vector epilogues, but when it comes
back with a suggestion we then might iterate endlessly. Do not
even ask the target when we decided for the last epilogue to be
one with partial vectors.
PR tree-optimization/120927
* tree-vect-loop.cc (vect_analyze_loop): Stop querying
further epilogues after one with partial vectors.
|
|
distinguished
We will use AMX-FP8 for DMR since it is a smaller and more unique feature.
gcc/ChangeLog:
* config/i386/driver-i386.cc (host_detect_local_cpu): Change
to AMX-FP8 for Diamond Rapids.
|
|
|
|
Current array bound checker only instruments ARRAY_REF, and the INDEX
information is the 2nd operand of the ARRAY_REF.
When extending the array bound checker to pointer references with
counted_by attributes, the hardest part is to get the INDEX of the
corresponding array ref from the offset computation expression of
the pointer ref. I.e.
Given an OFFSET expression, and the ELEMENT_SIZE,
get the index expression from the OFFSET.
For example:
OFFSET:
((long unsigned int) m * (long unsigned int) SAVE_EXPR <n>) * 4
ELEMENT_SIZE:
(sizetype) SAVE_EXPR <n> * 4
get the index as (long unsigned int) m.
gcc/c-family/ChangeLog:
* c-gimplify.cc (is_address_with_access_with_size): New function.
(ubsan_walk_array_refs_r): Instrument an INDIRECT_REF whose base
address is .ACCESS_WITH_SIZE or an address computation whose base
address is .ACCESS_WITH_SIZE.
* c-ubsan.cc (ubsan_instrument_bounds_pointer_address): New function.
(struct factor_t): New structure.
(get_factors_from_mul_expr): New function.
(get_index_from_offset): New function.
(get_index_from_pointer_addr_expr): New function.
(is_instrumentable_pointer_array_address): New function.
(ubsan_array_ref_instrumented_p): Change prototype.
Handle MEM_REF in addtional to ARRAY_REF.
(ubsan_maybe_instrument_array_ref): Handle MEM_REF in addtional
to ARRAY_REF.
gcc/testsuite/ChangeLog:
* gcc.dg/ubsan/pointer-counted-by-bounds-2.c: New test.
* gcc.dg/ubsan/pointer-counted-by-bounds-3.c: New test.
* gcc.dg/ubsan/pointer-counted-by-bounds-4.c: New test.
* gcc.dg/ubsan/pointer-counted-by-bounds-5.c: New test.
* gcc.dg/ubsan/pointer-counted-by-bounds.c: New test.
|
|
gcc/ChangeLog:
* tree-object-size.cc (access_with_size_object_size): Update comments
for pointers with .ACCESS_WITH_SIZE.
(collect_object_sizes_for): Propagate size info through GIMPLE_ASSIGN
for pointers with .ACCESS_WITH_SIZE.
gcc/testsuite/ChangeLog:
* gcc.dg/pointer-counted-by-4-char.c: New test.
* gcc.dg/pointer-counted-by-4-float.c: New test.
* gcc.dg/pointer-counted-by-4-struct.c: New test.
* gcc.dg/pointer-counted-by-4-union.c: New test.
* gcc.dg/pointer-counted-by-4.c: New test.
* gcc.dg/pointer-counted-by-5.c: New test.
* gcc.dg/pointer-counted-by-6.c: New test.
* gcc.dg/pointer-counted-by-7.c: New test.
|
|
pointer reference with counted_by attribute to .ACCESS_WITH_SIZE.
For example:
struct PP {
size_t count2;
char other1;
char *array2 __attribute__ ((counted_by (count2)));
int other2;
} *pp;
specifies that the "array2" is an array that is pointed by the
pointer field, and its number of elements is given by the field
"count2" in the same structure.
gcc/c-family/ChangeLog:
* c-attribs.cc (handle_counted_by_attribute): Accept counted_by
attribute for pointer fields.
gcc/c/ChangeLog:
* c-decl.cc (verify_counted_by_attribute): Change the 2nd argument
to a vector of fields with counted_by attribute. Verify all fields
in this vector.
(finish_struct): Collect all the fields with counted_by attribute
to a vector and pass this vector to verify_counted_by_attribute.
* c-typeck.cc (build_counted_by_ref): Handle pointers with counted_by.
Add one more argument, issue error when the pointee type is a structure
or union including a flexible array member.
(build_access_with_size_for_counted_by): Handle pointers with counted_by.
(handle_counted_by_for_component_ref): Call build_counted_by_ref
with the new prototype.
gcc/ChangeLog:
* doc/extend.texi: Extend counted_by attribute to pointer fields in
structures. Add one more requirement to pointers with counted_by
attribute.
gcc/testsuite/ChangeLog:
* gcc.dg/flex-array-counted-by.c: Update test.
* gcc.dg/pointer-counted-by-1.c: New test.
* gcc.dg/pointer-counted-by-2.c: New test.
* gcc.dg/pointer-counted-by-3.c: New test.
* gcc.dg/pointer-counted-by.c: New test.
|
|
gcc/fortran/ChangeLog:
* coarray.cc (check_add_new_component): Treat pure and elemental
intrinsic functions the same as non-intrinsic ones.
(create_caf_add_data_parameter_type): Fix front-end memleaks.
* trans-intrinsic.cc (conv_caf_func_index): Likewise.
|
|
If GCOBOL_INSTALL_NAME fails to install, do not install GCOBC_INSTALL_NAME.
gcc/cobol/ChangeLog:
* Make-lang.in: Use && instead of semicolon between commands.
|
|
test (test UB) [PR120919]
In my reading of the test and the instructions emitted by the
builtins, it invokes UB 4 times, each time overwriting one byte
after some variable (sc, then ss, then si and then sll).
If we are lucky, like at -O0 -mcpu=power10, there is just padding
there or something that doesn't make the tests fail, if unlucky
like with -O0 -mcpu=power10 -fstack-protector-strong,
&sc + 1 == &expected_sc
and so it overwrites the expected_sc variable.
The test fails when testing with
RUNTESTFLAGS="--target_board=unix/'{,-fstack-protector-strong}'"
on power10.
The following patch fixes that by using arrays of 2 elements, so that
the overwriting of 1 byte happens to the part of the same variable.
2025-07-01 Jakub Jelinek <jakub@redhat.com>
PR testsuite/120919
* gcc.target/powerpc/builtin_altivec_tr_stxvr_runnable.c (main): Change
sc, ss, si and sll vars from scalars to arrays of 2 elements,
initialize and test just the first one though.
|
|
This patch introduces the procedure GetFile into the supplementary
ISO style library IOChanUtils.
gcc/m2/ChangeLog:
PR modula2/120912
* gm2-libs-iso/IOChanUtils.def (GetFile): New procedure function.
* gm2-libs-iso/IOChanUtils.mod (GetFile): New procedure function.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
|
|
This fixes an assertion failure for the Finalizable aspect applied on a
tagged type with discriminant-dependent component.
gcc/ada/
PR ada/120705
* exp_ch6.adb (Needs_BIP_Collection): Always return False if the
type has relaxed finalization.
gcc/testsuite/
* gnat.dg/specs/finalizable2.ads: New test.
|
|
gcc/cobol/ChangeLog:
* parse.y: printf() of size_t is %zu, not %ld.
|
|
In Fedora/RHEL we usually test with
make check RUNTESTFLAGS="--target_board=unix/'{,-fstack-protector-strong}'"
because -fstack-protector-strong is used when building pretty much all the
packages.
In the past Marek Polacek has committed tweaks to various tests to make
them PASS in such testing, see e.g. r14-6276 or r14-2200.
These 3 tests FAIL with -fstack-protector-strong on s390x because they
use check-function-bodies and aren't prepared for the extra
-fstack-protector-{strong,all} extra code in the prologue/epilogue.
The following patch should fix that.
2025-07-01 Jakub Jelinek <jakub@redhat.com>
* gcc.target/s390/vector/vec-abs-emu.c: Add -fno-stack-protector
to dg-options.
* gcc.target/s390/vector/vec-max-emu.c: Likewise.
* gcc.target/s390/vector/vec-min-emu.c: Likewise.
|
|
gcc/testsuite/ChangeLog:
* cobol.dg/group2/Intrinsics_without_FUNCTION_keyword__2_.cob:
Append INTRINSIC keyword.
|
|
The following testcase is miscompiled since the introduction of UBSan,
cp_build_array_ref COND_EXPR handling replaces
(cond ? a : b)[idx] with cond ? a[idx] : b[idx], but if there are
SAVE_EXPRs inside of idx, they will be evaluated just in one of the
branches and the other uses uninitialized temporaries.
Fixed by keeping doing what it did if idx doesn't have side effects
and is invariant. Otherwise if op1/op2 are ARRAY_TYPE arrays with
invariant addresses or pointers with invariant values, use
SAVE_EXPR <op0>, SAVE_EXPR <idx>, SAVE_EXPR <op0> as a new condition
and SAVE_EXPR <idx> instead of idx for the recursive calls.
Otherwise punt, but if op1/op2 are ARRAY_TYPE, furthermore call
cp_default_conversion on array, so that COND_EXPR with ARRAY_TYPE doesn't
survive in the IL until expansion.
2025-07-01 Jakub Jelinek <jakub@redhat.com>
PR c++/120471
gcc/
* tree.h (address_invariant_p): New function.
* tree.cc (address_invariant_p): New function.
(tree_invariant_p_1): Use it for ADDR_EXPR handling. Formatting
tweak.
gcc/cp/
* typeck.cc (cp_build_array_ref) <case COND_EXPR>: If idx is not
INTEGER_CST, don't optimize the case (but cp_default_conversion on
array early if it has ARRAY_TYPE) or use
SAVE_EXPR <op0>, SAVE_EXPR <idx>, SAVE_EXPR <op0> as new op0 depending
on flag_strong_eval_order and whether op1 and op2 are arrays with
invariant address or tree invariant pointers. Formatting fixes.
gcc/testsuite/
* g++.dg/ubsan/pr120471.C: New test.
* g++.dg/parse/pr120471.C: New test.
|
|
Add an optimization to aarch64 SIMD converting mvn+shrn into mvni+subhn when
possible, which allows for better optimization when the code is inside a loop
by using a constant.
The conversion is based on the fact that for an unsigned integer:
-x = ~x + 1 => ~x = -1 - x
thus '(u8)(~x >> imm)' is equivalent to '(u8)(((u16)-1 - x) >> imm)'.
For the following function:
uint8x8_t neg_narrow_v8hi(uint16x8_t a) {
uint16x8_t b = vmvnq_u16(a);
return vshrn_n_u16(b, 8);
}
Without this patch the assembly look like:
not v0.16b, v0.16b
shrn v0.8b, v0.8h, 8
After the patch it becomes:
mvni v31.4s, 0
subhn v0.8b, v31.8h, v0.8h
Bootstrapped and regtested on aarch64-linux-gnu.
Signed-off-by: Remi Machet <rmachet@nvidia.com>
gcc/ChangeLog:
* config/aarch64/aarch64-simd.md (*shrn_to_subhn_<mode>): Add pattern
converting mvn+shrn into mvni+subhn.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/simd/shrn2subhn.c: New test.
|
|
[PR120847]
PR fortran/120847
gcc/fortran/ChangeLog:
* coarray.cc (check_add_new_comp_handle_array): Make the count
of components static to be able to create more than one. Create
an array component only for array expressions.
gcc/testsuite/ChangeLog:
* gfortran.dg/coarray/coindexed_7.f90: New test.
|
|
The test is not endianess clean, x[0] is supposed to be ((__int128)0x19)<<32
on little endian - 0x19 is in the second vector elt - but ((__int128)0x19)<<64
on big endian. I've added also verification of int and __int128 sizes just
in case we have say 16-bit or 64-bit int target with __int128 type, or
pdp endian gets __int128 support.
2025-07-01 Jakub Jelinek <jakub@redhat.com>
PR ipa/119318
PR testsuite/120082
* gcc.dg/ipa/pr119318.c (main): Expect different result on big endian
from little endian, on unexpected endianness or int/int128 sizes don't
test anything. Formatting fixes.
|
|
The new gcc.target/i386/preserve-none-1.c test currently FAILs on
Solaris/x86:
FAIL: gcc.target/i386/preserve-none-1.c scan-assembler-not movq
It needs -fomit-frame-pointer which this patch adds.
Tested on i386-pc-solaris2.11 and x86_64-pc-linux-gnu.
2025-06-27 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
gcc/testsuite:
* gcc.target/i386/preserve-none-1.c (dg-options): Add
-fomit-frame-pointer.
|
|
Several new tests from
commit d073bb6cfc219d4b6c283a0b527ee88b42e640e0
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Mar 18 18:43:10 2021 -0700
x86: Update memcpy/memset inline strategies for -mtune=generic
FAIL on Solaris/x86:
FAIL: g++.target/i386/memset-pr101366-1.C check-function-bodies _Z4TestPc
FAIL: g++.target/i386/memset-pr101366-2.C check-function-bodies _Z4TestPc
FAIL: g++.target/i386/memset-pr108585-1a.C check-function-bodies _Z6squarei
FAIL: g++.target/i386/memset-pr108585-1b.C check-function-bodies _Z6squarei
FAIL: g++.target/i386/memset-pr118276-1a.C check-function-bodies _Z22makeDefaultConstructedv
FAIL: g++.target/i386/memset-pr118276-1b.C check-function-bodies _Z22makeDefaultConstructedv
FAIL: g++.target/i386/memset-pr118276-1c.C check-function-bodies _Z22makeDefaultConstructedv
FAIL: gcc.target/i386/memset-pr70308-1a.c check-function-bodies foo
FAIL: gcc.target/i386/memset-pr70308-1b.c check-function-bodies foo
FAIL: gcc.target/i386/memset-strategy-25.c check-function-bodies foo
FAIL: gcc.target/i386/memset-strategy-28.c check-function-bodies foo
FAIL: gcc.target/i386/memset-strategy-29.c check-function-bodies foo
FAIL: gcc.target/i386/memset-strategy-30.c check-function-bodies foo
FAIL: gcc.target/i386/pr92080-17.c check-function-bodies foo
The issue is the same as in
https://gcc.gnu.org/pipermail/gcc-patches/2025-March/679330.html
All the tests need -fasynchronous-unwind-tables -fdwarf2-cfi-asm, some
also -fomit-frame-pointer and -mno-stackrealign.
Tested on i386-pc-solaris2.11 and x86_64-pc-linux-gnu.
2025-06-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
gcc/testsuite:
* g++.target/i386/memset-pr101366-1.C (dg-options): Add
-fasynchronous-unwind-tables -fdwarf2-cfi-asm.
* g++.target/i386/memset-pr101366-2.C: Likewise.
* g++.target/i386/memset-pr118276-1a.C: Likewise.
* g++.target/i386/memset-pr118276-1b.C: Likewise.
* g++.target/i386/memset-pr118276-1c.C: Likewise.
* gcc.target/i386/memset-pr70308-1a.c: Likewise.
* gcc.target/i386/memset-strategy-25.c: Likewise.
* gcc.target/i386/memset-strategy-28.c: Likewise.
* gcc.target/i386/memset-strategy-29.c: Likewise.
* gcc.target/i386/memset-strategy-30.c: Likewise.
* gcc.target/i386/pr92080-17.c: Likewise.
* gcc.target/i386/memset-pr70308-1b.c: Likewise. Also add
-fomit-frame-pointer.
* g++.target/i386/memset-pr108585-1a.C: (dg-options): Add
-fasynchronous-unwind-tables -fdwarf2-cfi-asm. Also add
-mno-stackrealign -fomit-frame-pointer.
* g++.target/i386/memset-pr108585-1b.C: Likewise.
|
|
related [PR120608]
The following testcases FAIL at -O0 -fsanitize=address. The problem is
we end up with something like
_26 = foo (x_24(D)); [must tail call]
// predicted unlikely by early return (on trees) predictor.
finally_tmp.3_27 = 0;
goto <bb 5>; [INV]
...
<bb 5> :
# _6 = PHI <_26(3), _23(D)(4)>
# finally_tmp.3_8 = PHI <finally_tmp.3_27(3), finally_tmp.3_22(4)>
.ASAN_MARK (POISON, &c, 4);
if (finally_tmp.3_8 == 1)
goto <bb 7>; [INV]
else
goto <bb 6>; [INV]
<bb 6> :
<L4>:
finally_tmp.4_31 = 0;
goto <bb 8>; [INV]
...
<bb 8> :
# finally_tmp.4_9 = PHI <finally_tmp.4_31(6), finally_tmp.4_30(7)>
.ASAN_MARK (POISON, &b, 4);
if (finally_tmp.4_9 == 1)
goto <bb 9>; [INV]
else
goto <bb 10>; [INV]
...
<bb 10> :
# _7 = PHI <_6(8), _34(9)>
.ASAN_MARK (POISON, &a, 4);
<bb 11> :
<L11>:
return _7;
before the sanopt pass. This is -O0, we don't try to do forward
propagation, jump threading etc. And what is worse, the sanopt
pass lowers the .ASAN_MARK calls that the tailc/musttail passes
already handle into somewthing that they can't easily pattern match.
The following patch fixes that by
1) moving the musttail pass 2 passes earlier (this is mostly just
for -O0/-Og, for normal optimization levels musttail calls are
handled in the tailc pass), i.e. across the sanopt and cleanup_eh
passes
2) recognizes these finally_tmp SSA_NAME assignments, PHIs using those
and GIMPLE_CONDs deciding based on those both on the backwards
walk (when we start from the edges to EXIT) and forwards walk
(when we find a candidate tail call and process assignments
after those up to the return statement). For backwards walk,
ESUCC argument has been added which is either NULL for the
noreturn musttail case, or the succ edge through which we've
reached bb and if it sees GIMPLE_COND with such comparison,
based on the ESUCC and comparison it will remember which later
edges to ignore later on and which bb must be walked up to the
start during tail call discovery (the one with the PHI).
3) the move of musttail pass across cleanup_eh pass resulted in
g++.dg/opt/pr119613.C regressions but moving cleanup_eh before
sanopt doesn't work too well, so I've extended
empty_eh_cleanup to also handle resx which doesn't throw
externally
I know moving a pass on release branches feels risky, though the
musttail pass is only relevant to functions with musttail calls,
so something quite rare and only at -O0/-Og (unless one e.g.
disables the tailc pass).
2025-07-01 Jakub Jelinek <jakub@redhat.com>
PR middle-end/120608
* passes.def (pass_musttail): Move before pass_sanopt.
* tree-tailcall.cc (empty_eh_cleanup): Handle GIMPLE_RESX
which doesn't throw externally through recursion on single
eh edge (if any and cnt still allows that).
(find_tail_calls): Add ESUCC, IGNORED_EDGES and MUST_SEE_BBS
arguments. Handle GIMPLE_CONDs for non-simplified cleanups with
finally_tmp temporaries both on backward and forward walks, adjust
recursive call.
(tree_optimize_tail_calls_1): Adjust find_tail_calls callers.
* c-c++-common/asan/pr120608-3.c: New test.
* c-c++-common/asan/pr120608-4.c: New test.
* g++.dg/asan/pr120608-3.C: New test.
* g++.dg/asan/pr120608-4.C: New test.
|
|
PR fortran/120843
gcc/fortran/ChangeLog:
* resolve.cc (resolve_operator): Report inconsistent coranks
only when not referencing this_image.
(gfc_op_rank_conformable): Treat coranks as inconformable only
when a coindex other then implicit this_image is used.
gcc/testsuite/ChangeLog:
* gfortran.dg/coarray/coindexed_6.f90: New test.
|
|
This patch updates `aarch64-sys-regs.def', bringing it into sync with
the Binutils source after this change:
https://sourceware.org/pipermail/binutils/2025-March/139894.html
gcc/ChangeLog:
* config/aarch64/aarch64-sys-regs.def: Copy from Binutils.
|
|
This restores the rounding of the first scaled divide operation applied to
the extra digits, which yields more consistent results for smalls that are
reciprocal of integers.
gcc/ada/ChangeLog:
* libgnat/s-valuef.adb (Integer_to_Fixed): Restore rounding of the
first scaled divide operation.
|
|
When GNAT was compiling a ghost unit, the ALI file wrongly suggested that this
unit includes elaboration code, which caused linking errors to non-existing
elaboration counters. This was because elaboration code is only detected in
Gigi, which is skipped for ignored ghost units, because we don't generate
object code for them
gcc/ada/ChangeLog:
* gnat1drv.adb (Gnat1drv): Do minimal decoration of the spec and body
of an ignored ghost compilation unit.
|
|
Remove leftovers from zero cost exception handling; semantics is unaffected.
gcc/ada/ChangeLog:
* ali.ads (Unit_Record): Fix grammar in comment.
* bindgen.adb (Num_Elab_Calls, Num_Primary_Stacks): Remove counters
that were only incremented and never actually used.
|
|
Underscore is allowed only between digits. The current implementattion
was considering 'E' as a digit even if it was not in the range of
Base and could denote exponent only.
gcc/ada/ChangeLog:
* libgnat/s-valuer.adb (Scan_Decimal_Digits,
Scan_Integral_Digits): fix condition for rejecting
underscore.
|
|
The first issue is that the function would wrongly raise Constraint_Error
on the edge case where Val = 2**(Int'Size - 1) and Minus is not set.
The second issue is that the function takes a long time to deal with huge
negative exponents.
The change also contains minor consistency fixes for its counterpart that
is present in System.Value_F, namely Integer_To_Fixed.
gcc/ada/ChangeLog:
* libgnat/s-valued.adb (Integer_To_Decimal): Deal specifically with
Val = 2**(Int'Size - 1) if Minus is not set. Exit the loops when V
saturates to 0 in the case of (huge) negative exponents. Use Base
instead of B consistently in unsigned computations.
* libgnat/s-valuef.adb (Integer_To_Fixed): Use Base instead of B
consistently in unsigned computations.
|
|
A minimal expansion of fixedpoint operations is needed for GNATprove, because
the subsequent resolution of type conversion relies on this expansion being
done.
gcc/ada/ChangeLog:
* exp_ch4.adb (Fixup_Universal_Fixed_Operation): Move to spec.
* exp_ch4.ads (Fixup_Universal_Fixed_Operation): Move from body.
* exp_spark.adb (Expand_SPARK): Call a fixup expansion routine.
|
|
The compiler crashes on compiling a return statement of a function whose result
type has a component whose type is specified with Relaxed_Finalization. The
compiler was attempting to retrieve a nonexistent BIP_Collection extra formal
from the enclosing function, which may not exist in the case of result types
with Relaxed_Finalization.
gcc/ada/ChangeLog:
* exp_ch3.adb (Build_Heap_Or_Pool_Allocator): Test not Has_Relaxed_Finalization
as a guard against retrieving BIP_Collection formal (and related code).
|
|
The frontend reports a warning when no component of an untagged
record type U is a record type, and the type C of some of its
components has defined its user-defined equality operator "=".
The warning is reported because it may be surprising that, following
RM 4.5.2 (24/3), the predefined "=" of the component type C takes
precedence over its user-defined "=" when objects of the record
type R are compared.
gcc/ada/ChangeLog:
* exp_ch3.adb (Build_Untagged_Record_Equality): Report the
warning when no component of an untagged record type U is a
record type, and the type C of some of its components has
defined its user-defined equality operator "=".
* exp_ch4.adb (Expand_Composite_Equality): Report the warning
calling Warn_On_Ignored_Equality_Operator.
* sem_warn.ads (Warn_On_Ignored_Equality_Operator): New subprogram.
* sem_warn.adb (Warn_On_Ignored_Equality_Operator): Factorize code
reporting the warning.
|
|
gcc/ada/ChangeLog:
* libgnat/a-ngelfu.adb: conditional computation of X^2
|
|
The package System.Case_Utilities provides some subprograms that do not make
use of the secondary stack and some that do. When compiling in a context
where no secondary stack support is provided, this makes the entire package
unusable (and similarly for any other package that withs this package).
Split the package into two packages named Case_Utilities_NSS and Case_Utilities
(NSS is for "no secondary stack"). The first package declares the
subprograms that do not need secondary stack support. The second package
declares the remaining subprograms, as well as renamings of everything declared
in the first part. A client that continues to reference Case_Utilities is
largely unaffected by this change. But if we change a client to reference
Case_Utilities_NSS instead, that removes an obstacle that would otherwise
prevent using that client unit in a no-secondary-stack-support environment.
We then make that change to the body of package System.Val_Util.
gcc/ada/ChangeLog:
* Makefile.rtl: Add entry for new unit's object file.
* libgnat/s-casuti.adb: Remove bodies of subprograms that were moved
to the new unit.
* libgnat/s-casuti.ads: Replace (with renamings) declarations for
subprograms that moved to the new unit.
* libgnat/s-cautns.adb: Body for new unit (a new source file).
* libgnat/s-cautns.ads: Spec for new unit (a new source file).
* libgnat/s-valuti.adb: Use the new unit instead of the old one.
* gcc-interface/Make-lang.in: Add entries for new unit's object file.
* gcc-interface/Makefile.in: Likewise.
|
|
The compiler fails with an error or Assert_Failure when calling
an instantiation of Unchecked_Deallocation that has been instantiated
with a constrained subtype of a discriminated protected type.
gcc/ada/ChangeLog:
* sem_ch3.adb (Constrain_Corresponding_Record): Inherit Class_Wide_Type on the
created constrained subtype.
|
|
gcc/ada/ChangeLog:
* doc/gnat_ugn/building_executable_programs_with_gnat.rst: add
GNAT LLVM explicit selection in GPR file
* gnat_ugn.texi: Regenerate.
|
|
Unlike RTE, RTU_Entity alone does not cause the unit to be loaded.
gcc/ada/ChangeLog:
* exp_ch7.adb (Shift_Address_For_Descriptor): Add dummy variable
to make sure that System_Storage_Elements is loaded.
|
|
This extension adds "continue" as a nonreserved keyword, and this is the
first occurrence of a nonreserved keyword in GNAT, which causes this
patch to add unusual overload resolution code.
New node kinds are introduced, but since they are entirely transformed
into existing constructs during expansion, back ends that don't turn off
expansion do not need to be updated.
gcc/ada/ChangeLog:
* doc/gnat_rm/gnat_language_extensions.rst: Document new extension.
* gen_il-fields.ads (Opt_Field_Enum): Add new fields.
* gen_il-types.ads (N_Loop_Flow_Statement, N_Continue_Statement): New
node kinds.
* gen_il-gen-gen_nodes.adb (N_Loop_Flow_Statement): New abstract node
kind.
(N_Continue_Statement): New node kind.
(N_Exit_Statement): Reparent below N_Loop_Flow_Statement.
* sinfo.ads (N_Continue_Statement): Add description.
* sinfo-utils.ads (Loop_Flow_Keyword): New function.
* sinfo-utils.adb (Loop_Flow_Keyword): New function.
* gen_il-gen-gen_entities.adb (E_Loop): Add new field.
* einfo.ads (Continue_Mark): Document new field.
* sprint.adb (Sprint_Node_Actual): Update for new node kind.
* snames.ads-tmpl: Add new keyword.
* par-ch5.adb (P_Continue_Statement, Parse_Loop_Flow_Statement): New
functions.
(P_Sequence_Of_Statements): Handle continue statements.
(P_Exit_Statement): Use Parse_Loop_Flow_Statement.
* sem.adb (Analyze): Handle new node kind.
* sem_ch5.adb (Analyze_Loop_Flow_Statement): New function.
(Analyze_Continue_Statement): New procedure.
(Analyze_Exit_Statement): Use new Analyze_Loop_Flow_Statement function.
* sem_ch5.ads (Analyze_Continue_Statement): New procedure.
* expander.adb (Expand): Handle new node kind.
* exp_ch5.ads (Expand_N_Continue_Statement): New procedure.
* exp_ch5.adb (Expand_Loop_Flow_Statement): New procedure.
(Expand_N_Continue_Statement): New procedure.
(Expand_N_Exit_Statement): Use new Expand_Loop_Flow_Statement
procedure.
(Build_Formal_Container_Iteration): Always reuse original loop entity.
* gnat_rm.texi: Regenerate.
|
|
Such output was unnecessary, and in some cases harmful.
In particular, we generate renamings in the expanded
code for protected types, with internally-generated names,
which could be confusing to the user. In addition, in the
JSON output (-gnatR2j), these generated renamings could have
duplicate source locatations, which confused SPARK.
gcc/ada/ChangeLog:
* repinfo.adb (List_Entities):
Disable output in case of object renamings.
|
|
gcc/ada/ChangeLog:
* libgnat/s-valuen.ads: Correct comment.
|