Darwin has kernel support for this facility from 10.12 (macOS Sierra).
From 10.15 (macOS Catalina) 64bit qualitities are supported.
When the library is built for 10.12+ both 32b and 64b quantities will be
supported by the DSO which means it can be installed on 10.12+ with support
for 64bit available when the instalation is >= 10.15.
The header will only recognise 64b quantities when the deployment version
is >= 10.15.
If the library is built for <= 10.11, the support will be missing and attempts
to use it wlll result in link errors.
The platform wait type is unconditionally set to 32bits, since this is compatible
across supported OS editions.
PR libstdc++/120527
libstdc++-v3/ChangeLog:
* include/bits/atomic_wait.h:
* src/c++20/atomic.cc (__ulock_wait): Enable supported Darwin versions.
(__ulock_wake): Likewise.
(UL_COMPARE_AND_WAIT): New.
(UL_COMPARE_AND_WAIT64): New.
(ULF_WAKE_ALL): New.
(_GLIBCXX_HAVE_PLATFORM_WAIT): Enable for suppported Darwin versions.
Co-authored-by: Iain Sandoe <iain@sandoe.co.uk>
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
This patch fixes two typos: the reverse_ prefix is missing in the
iconv_close calls.
PR preprocessor/124930
libcpp/ChangeLog:
* charset.cc (_cpp_destroy_iconv): Correct two calls to
iconv_close.
Reviewed-by: Jakub Jelinek <jakub@redhat.com>
P3844R2 added consteval conversion for value-preserving conversion from
constants. It had been approved by LEWG in Kona. Therefore, the current
implementation has the consteval broadcast constructor. In Croydon, LEWG
reversed the decision but changed the overload set to keep the design
space open for C++29.
This patch implements the removal of the consteval constructor and
changes the broadcast constructor according to P4012R1, to keep the
design space open.
libstdc++-v3/ChangeLog:
* include/bits/simd_details.h (__value_preserving_cast): Remove.
* include/bits/simd_mask.h (basic_mask): Replace plain 0 and 1
literals with cw<0> and cw<1>. Replace explicit basic_vec
construction from 0 and 1 with default init and broadcast from
_Up(1).
(_M_to_uint): Replace 1 with cw<1>.
* include/bits/simd_vec.h (basic_vec): Remove consteval
broadcast overload. Remove explicit broadcast from
non-value-preserving types.
* testsuite/std/simd/arithmetic.cc: Replace ill-formed integer
literals with explicit cast to T or use cw.
* testsuite/std/simd/mask.cc: Likewise.
* testsuite/std/simd/simd_alg.cc: Likewise.
* testsuite/std/simd/traits_common.cc: Adjust for resulting
traits changes.
* testsuite/std/simd/traits_math.cc: Likewise.
Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
It turns out a union without an active member does not violate C++20 core
constant expression rules and r16-8748 was really just a workaround for a
front end bug. The actual underlying problem -- that the constexpr
evaluator treated an explicitly destroyed union member as still active --
has been fixed by r16-8767 which makes this workaround unnecessary for GCC.
Rather than remove the workaround, restrict it to Clang which seems to have
a similar bug making it still needed for e.g. the r16-8748 testcase.
PR c++/124910
libstdc++-v3/ChangeLog:
* include/std/optional (_Optional_payload_base::_M_destroy):
Restrict r16-8748 workaround to Clang, and adjust comment.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
As the following testcase shows, not clearing the padding bits after
signed MULT_EXPR (or signed division) is reasonable when overflow actually is
undefined behavior because then anything can happen. But when it is not
undefined behavior due to -fwrapv, we need to clear the padding bits
on targets which chose that behavior. It isn't only signed MULT_EXPR,
but also division because smallest negative / -1 overflows and in that
case the padding bits aren't correct for bitint_extended targets either.
2026-04-21 Jakub Jelinek <jakub@redhat.com>
PR middle-end/123635
* gimple-lower-bitint.cc (bitint_large_huge::lower_muldiv_stmt):
Extend the padding bits not just for unsigned MULT_EXPR but for any
TYPE_OVERFLOW_WRAPS MULT_EXPR and signed TYPE_OVERFLOW_WRAPS division.
* gcc.dg/torture/bitint-90.c: New test.
Reviewed-by: Richard Biener <rguenth@suse.de>
The following testcase ICEs on riscv.
tree-ssa-sccvn.cc (vn_walk_cb_data::push_partial_def) already uses
build_bitint_type instead of build_nonstandard_integer_type for larger
BITINT_TYPE types:
/* Make sure to interpret in a type that has a range covering the whole
access size. */
if (INTEGRAL_TYPE_P (vr->type) && maxsizei != TYPE_PRECISION (vr->type))
{
if (TREE_CODE (vr->type) == BITINT_TYPE
&& maxsizei > MAX_FIXED_MODE_SIZE)
type = build_bitint_type (maxsizei, TYPE_UNSIGNED (type));
else
type = build_nonstandard_integer_type (maxsizei, TYPE_UNSIGNED (type));
}
and the same change in vn_reference_lookup_3 fixes the ICE.
2026-04-21 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/124941
* tree-ssa-sccvn.cc (vn_reference_lookup_3): Use build_bitint_type
rather than build_nonstandard_integer_type for
maxsizei larger than MAX_FIXED_MODE_SIZE.
* gcc.dg/bitint-129.c: New test.
Reviewed-by: Richard Biener <rguenth@suse.de>
2026-03-19 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran
PR fortran/117077
* trans-expr.cc (gfc_trans_scalar_assign): If the lhs and rhs
TYPE_MAIN_VARIANTs are not the same, convert the rhs to the lhs
type via a VIEW_CONVERT_EXPR.
gcc/testsuite/
PR fortran/117077
* gfortran.dg/pr117077.f90: New test.
commit 14cd2833b2 added xfails, but
2025-12-05's Richard Biener <rguenther@suse.de>'s PR
tree-optimization/120939 patch to skip gcc.dg/torture/pr113026-1.c
when -ftracer had already taken care of them without XPASSes.
for gcc/testsuite/ChangeLog
PR tree-optimization/113524
* gcc.dg/torture/pr113026-1.c: Revert 2026-01-21's
XFAIL of bogus warning on various 32-bit targets.
Changes to arm_v8_3a_complex_neon options and to
vect_complex_add_{float,double} enabled these tests and caused them to
fail with the same failure mode as -half-float.c, namely, reassoc
makes ADD_ROT270 unrecognizable in fms_elemconjsnd after complex
lowering and dce's removal of the original complex assignments.
for gcc/testsuite/ChangeLog
PR tree-optimization/116463
* gcc.dg/vect/complex/fast-math-complex-mls-float.c:
Don't expect COMPLEX_ADD_ROT270.
* gcc.dg/vect/complex/fast-math-complex-mls-double.c:
Likewise.
This patch rewrites the Building a shared library section in the
gm2.texi. The new content addresses the default dynamic module
scaffold and also provides an example of C++ calling the m2 shared
library. Bootstrapped using lto on amd64.
gcc/ChangeLog:
PR modula2/120189
* doc/gm2.texi (Building a shared library): Rewrite.
libgm2/ChangeLog:
PR modula2/120189
* libm2iso/m2rts.h (m2iso_M2RTS_RequestDependant): Correct
parameters.
(m2iso_M2RTS_ConstructModules): Ditto.
(m2iso_M2RTS_DeconstructModules): Ditto.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
An `enum : enum A` type caused the already computed underlying type size
of `enum A` to be overwritten with NULL_TREE. To fix, don't finish the
enum with layout_type unless we're handling the main variant type.
PR d/123411
gcc/d/ChangeLog:
* types.cc (TypeVisitor::visit (TypeEnum *)): Only call layout_type on
the TYPE_MAIN_VARIANT of the enum.
gcc/testsuite/ChangeLog:
* gdc.dg/pr123411.d: New test.
Constant evaluation didn't recognize that destroying _M_value made it no
longer the active member of the anonymous union, so we were treating the
result as containing an out-of-lifetime value. Instead we should treat the
union as no longer having an active member.
PR c++/124910
gcc/cp/ChangeLog:
* constexpr.cc (cxx_eval_store_expression): Ending the
lifetime of the active member means no active member.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/constexpr-union11.C: New test.
The switch to front-end lowering of AA literals regressed on 32bit SPARC
targets, as the runtime function `_d_assocarrayliteralTX()` returns a
`void*`, but the expression should be of type `struct { void* ptr; }`.
PR d/124157
gcc/d/ChangeLog:
* expr.cc (ExprVisitor::visit (AssocArrayLiteralExp *)): Return AA
constructor with memory returned by _d_assocarrayliteralTX().
This PR points out that we don't handle a splice-type-spec that
designates a deducible template, which then serves as a placeholder
for CTAD. This is allowed by [dcl.type.simple]/3. This patch
fixes that problem by calling make_template_placeholder if we
get a deducible template.
PR c++/124706
gcc/cp/ChangeLog:
* parser.cc (cp_parser_splice_type_specifier): For ctad_template_p
call make_template_placeholder.
* pt.cc (tsubst_splice_scope): Likewise.
gcc/testsuite/ChangeLog:
* g++.dg/reflect/error10.C: Adjust dg-error.
* g++.dg/reflect/type9.C: Likewise.
* g++.dg/reflect/ctad1.C: New test.
* g++.dg/reflect/ctad2.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
When we have lambda captures, they appear in the vars slot of a bind
expression at the outer operator() body.
We need these to be visible for any pre or post conditions that might
use them, therefore (when a lambda has captures) nest the application
of contract pre and post conditions within the lambda outer bind
expressino.
PR c++/124648
gcc/cp/ChangeLog:
* contracts.cc (maybe_apply_function_contracts): Nest pre and
post conditions inside the outer bind expression of a lambda
with captures.
gcc/testsuite/ChangeLog:
* g++.dg/contracts/cpp26/expr.prim.lambda.closure.p10.C: Update
to include tests of conditions seen in PR124648.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
Here we emit the "function of consteval-only type must be declared
'consteval'" error for f, even though its type will become
char f(int) after substitution, which is not consteval-only. We
probably shouldn't consider dependent type consteval-only.
PR c++/124855
gcc/cp/ChangeLog:
* reflect.cc (consteval_only_p): Return false if the type is
dependent.
gcc/testsuite/ChangeLog:
* g++.dg/reflect/type11.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
This change to the macro was done intentionally to quickly test that the
changes in r16-8720-g209550a04e143e did not break the code in the #else
branch, but it was not supposed to be committed!
libstdc++-v3/ChangeLog:
* include/bits/print.h: Fix spelling of macro.
I found another test which uses -m32 in gcc.target/i386/ . Similarly
to the previously fixed tests, the test ought to be tested during i686-linux
testing or x86_64-linux test with --target_board=unix\{-m32,-m64\}
There is nothing ia32 specific on the test, so I've just dropped the -m32.
See also r13-143, r13-6846, r15-7748 and r15-7749 for similar changes in the
past.
2026-04-20 Jakub Jelinek <jakub@redhat.com>
PR middle-end/122021
* gcc.target/i386/pr122021-0.c: Remove -m32 from dg-options.
pr121649.c is a test enabled for int128 targets. It assumes that long
is 64-bit, which isn't true for all int128 targets. Replace long with
long long for 64-bit integer.
PR testsuite/124939
* gcc.dg/torture/pr121649.c: Replace long with long long.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
I've debugged the rest of the failures on riscv64-linux (in particular
torture/bitint-{87,89}.c FAILs at -O2).
This is on top of https://gcc.gnu.org/pipermail/gcc-patches/2026-April/713242.html
patch.
One problem was that the lower_shift_stmt RSHIFT_EXPR change to iterate
until p2 rather than p (where p2 is p + 1 if bitint_ext_full and there is
full limb of padding bits), the loop is emitted with a condition before the
header and another condition before the latch edge and I've mistakenly fixed
just the latter and not the former.
ANother problem was that in all the 3 RSHIFT_EXPRs added meant to set
a full limb to 0 or all ones based on most significant bit I've mistakenly used
unsigned type rather than signed, so it was set to 0 or 1 instead (this
was twice in lower_shift_stmt, for the LSHIFT_EXPR case in both cases and
once in lower_float_conv_stmt).
And finally, because unsigned MULT_EXPR doesn't have overflow undefined, we
actually don't need to just clear the full padding bit limb (if any) but
even the padding bits in the partial limb (if any; and this actually doesn't
affect just arm and riscv, but also affects s390x and loongarch).
2026-04-20 Jakub Jelinek <jakub@redhat.com>
PR middle-end/123635
* gimple-lower-bitint.cc (bitint_large_huge::lower_shift_stmt): In the
RSHIFT_EXPR case, use p2 in two LE_EXPR conditions rather than just
one. In LSHIFT_EXPR case, use signed RSHIFT_EXPR instead of unsigned.
(bitint_large_huge::lower_muldiv_stmt): For unsigned MULT_EXPR with
bitint_extended if prec is not multiple of limb_prec, clear padding
bits after libgcc call.
(bitint_large_huge::lower_float_conv_stmt): Use signed RSHIFT_EXPR
instead of unsigned.
Reviewed-by: Jeffrey Law <jeffrey.law@oss.qualcomm.com>
So, I've tried the (extremely slow) cfarm95 RISCV box and found that my
earlier PR123635 patch actually broke stuff.
First thing I found is that __riscv__ macro I was using in bitintext.h
doesn't exist and fixed that.
I wrote two new tests (88/89, one for a problem I'll talk about later and
one to cover shifts) and fixed one nit in 86/87. All the testing
has been done on this modified tests and using
make -j8 -k check-gcc RUNTESTFLAGS="dg.exp='*bitint* pr112673.c builtin-stdc-bit-*.c pr112566-2.c pr112511.c pr116588.c pr116003.c pr113693.c pr113602.c flex-array-counted-by-7.c' dg-torture.exp='*bitint* pr116480-2.c pr114312.c pr114121.c' dfp.exp=*bitint* vect.exp='vect-early-break_99-pr113287.c' tree-ssa.exp=pr113735.c"
On pre-r16-8678 source, the FAILs were
FAIL: gcc.dg/torture/bitint-82.c -O0 execution test
FAIL: gcc.dg/torture/bitint-82.c -O2 execution test
FAIL: gcc.dg/torture/bitint-83.c -O0 execution test
FAIL: gcc.dg/torture/bitint-83.c -O2 execution test
FAIL: gcc.dg/torture/bitint-86.c -O0 execution test
FAIL: gcc.dg/torture/bitint-86.c -O2 execution test
FAIL: gcc.dg/torture/bitint-87.c -O0 execution test
FAIL: gcc.dg/torture/bitint-87.c -O2 execution test
FAIL: gcc.dg/torture/bitint-88.c -O0 execution test
FAIL: gcc.dg/torture/bitint-88.c -O2 execution test
FAIL: gcc.dg/torture/bitint-89.c -O0 execution test
FAIL: gcc.dg/torture/bitint-89.c -O2 execution test
i.e. all the bitintext.h tests for padding bits (except bitint-84.c),
plus gcc.dg/bitint-39.c gcc.dg/torture/bitint-37.c tests timing out
(but those timed out due to extremely slow CPU all the time, and are
really large and not padding related, so let's ignore that).
Now, with r16-8678 (i.e. vanilla trunk), the FAILs are
FAIL: gcc.dg/torture/bitint-42.c -O0 execution test
FAIL: gcc.dg/torture/bitint-42.c -O2 execution test
FAIL: gcc.dg/torture/bitint-62.c -O0 execution test
FAIL: gcc.dg/torture/bitint-62.c -O2 execution test
FAIL: gcc.dg/torture/bitint-66.c -O0 execution test
FAIL: gcc.dg/torture/bitint-68.c -O0 execution test
FAIL: gcc.dg/torture/bitint-68.c -O2 execution test
FAIL: gcc.dg/torture/bitint-79.c -O2 execution test
FAIL: gcc.dg/torture/bitint-80.c -O2 execution test
FAIL: gcc.dg/torture/bitint-81.c -O0 execution test
FAIL: gcc.dg/torture/bitint-81.c -O2 execution test
FAIL: gcc.dg/torture/bitint-83.c -O2 execution test
FAIL: gcc.dg/torture/bitint-87.c -O2 execution test
FAIL: gcc.dg/torture/bitint-88.c -O2 execution test
FAIL: gcc.dg/torture/bitint-89.c -O2 execution test
So, I broke some tests (42, 62, 66, 68, 79, 80, 81) and
fixed a few too (82, 86 and at -O0 only 83, 87, 88, 89).
I've debugged the regressions I've caused and the problem is on large/huge
_BitInt bit-field stores, we can't clear any padding bits in those cases,
bit-fields never have paddings (C FE rejects oversized bit-fields and the
padding is used for further fields or is merely structure padding rather
than padding of the bit-field).
The following patch fixes more than that. There is another problem
(bitint-88.c tries to test that), when we merge some operation (e.g.
addition) of some narrower large/huge _BitInt with sign extension from
it into a wider unsigned _BitInt (e.g. signed _BitInt(513) addition
sign extended into unsigned _BitInt(1025)), the earlier solution for
the extra padding limb doesn't work properly, we do want to sign
extend the bit 512 into bits 513-1024, but the padding bits above
that need to be cleared. For the limb containing bit 1024 we do it
right, it is sign extension but outside of loop, so should cast the
all zeros or all ones value to unsigned long : 1 and back, but
the limb containing bit 1088 needs to be just zeroed.
And the patch also adds the bitint_ext_full handling to RSHIFT_EXPR
and LSHIFT_EXPR code.
With this, the FAILs on riscv64-linux are
FAIL: gcc.dg/torture/bitint-87.c -O2 execution test
FAIL: gcc.dg/torture/bitint-89.c -O2 execution test
which means I need to debug further the multiplication/division/modulo/
casts from float and there is some remaining problem with the shifts.
Plus something not covered yet, the overflow builtins/ubsan (all of +-*).
In any case, because this patch doesn't regress on riscv64-linux any
actual non-padding tests and even these two aren't regressions, I'd
like to commit this patch separately and fix stuff incrementally,
to unbreak the bit-field stores.
2026-04-20 Jakub Jelinek <jakub@redhat.com>
PR middle-end/123635
* gimple-lower-bitint.cc (bitint_precision_kind): Assert the current
assumptions, that bitint_ext_full for abi_limb_prec > limb_prec is
supported only when abi_limb_prec is limb_Prec * 2 and it is not
big endian in that case.
(bitint_large_huge::lower_mergeable_stmt): Don't set separate_ext
fir bitint_ext_full for bit-field stores. Guard the condition
on an extra limb of padding bits to be extended rather than including
earlier extensions in that too. If already sign extending before
and type is unsigned, set zero_ms_limb instead and later handle it.
(bitint_large_huge::lower_shift_stmt): Handle bitint_ext_full.
* gcc.dg/bitintext.h: Use __riscv macro instead of __riscv__.
* gcc.dg/torture/bitint-86.c: Remove bogus sync_char_short
effective target.
* gcc.dg/torture/bitint-87.c: Likewise.
* gcc.dg/torture/bitint-88.c: New test.
* gcc.dg/torture/bitint-89.c: New test.
Reviewed-by: Jeffrey Law <jeffrey.law@oss.qualcomm.com>
This patch addresses the following fixes:
- Remove the redundant checks for SUBREG and TRUNCATE.
- Bail out of recursive narrowing in narrow_dimode_src when an operand remains
DImode.
- Use HOST_WIDE_INT_PRINT_HEX instead of %lx for printing the mask.
Bootstrapped and regtested on aarch64-linux-gnu.
Signed-off-by: Soumya AR <soumyaa@nvidia.com>
gcc/ChangeLog:
* config/aarch64/aarch64-narrow-gp-writes.cc (narrow_dimode_src): Remove
redundant checks. Don't recurse when an operand remains DImode.
(narrow_gp_writes::optimize_compare_arith_insn): Use
HOST_WIDE_INT_PRINT_HEX.
(narrow_gp_writes::optimize_single_set_insn): Likewise.
The PR is about an ICE on sh caused by an "invalid" subreg.
cse replaced a pseudo register with the hard T register within:
(zero_extend:SI (subreg:QI (reg:SI pseudo) 3))
Since this is a register-for-register replacement, cse just relied on
recog to reject anything that wasn't valid.
However, if validate_subreg had been asked, it would have said that:
(subreg:QI (reg:SI T) 3)
is not valid. This means that even simplify_gen_subreg would have
refused to generate it.
In that sense, cse should not even be trying to match this replacement.
It's not recog's job to reject all invalid rtl. recog is just supposed
to say whether the machine supports a given piece of valid rtl.
In this particular case, the sh port does specifically match:
(zero_extend:SI (subreg:QI (reg:SI T) 3))
even though, by forbidding T from having QImode, the port also
effectively forbids the subreg. See the discussion in the PR trail
about that. But I think the point still stands that cse should verify
the subregs that it creates. It should also try to simplify them down
to hard registers where possible.
I suppose a more complete fix would be to rewrite canon_reg to use a
helper that recursively replaces and simplifies, but that seems somewhat
dangerous at this stage. The scope for non-subreg simplification should
also be pretty limited in practice.
gcc/
PR rtl-optimization/124643
* cse.cc (canon_reg): Handle and canonicalize subregs.
gcc/testsuite/
PR rtl-optimization/124643
* gcc.c-torture/compile/pr124643.c: New test.
The Makefile correctly includes the xmake_file fragment, but it overrides
the adjustment made to the LIBS variable.
gcc/ada/
PR ada/124918
* gcc-interface/Makefile.in (TGT_LIB): Move up.
(LIBBACKTRACE): Likewise.
(LIBIBERTY): Likewise.
(LIBGNAT): Likewise.
(LIBS): Likewise.
(TOOLS_LIBS): Use $(LIBS).
(TOOLS1_LIBS): Delete.
(../../gnatmake$(exeext)): Do not link with $(TOOLS1_LIBS).
(../../gnatlink$(exeext)): Likewise.
Added for compatibility with LDC, ignores any values passed to it any
will predominately be LDC-specific.
libphobos/ChangeLog:
* libdruntime/gcc/attributes.d (callingConvention): New UDA.
Adds handler for @gcc.attributes.attribute("no_split_stack") and the
UDA @gcc.attributes.noSplitStack for compatibility with LDC.
gcc/d/ChangeLog:
* d-attribs.cc (d_langhook_gnu_attributes): Add no_split_stack
attribute.
(d_handle_no_split_stack_attribute): New function.
libphobos/ChangeLog:
* libdruntime/gcc/attributes.d (noSplitStack): New UDA.
gcc/testsuite/ChangeLog:
* gdc.dg/attr_no_split_stack.d: New test.
When an optional that contains a value is cleared, _M_destroy invokes the
destructor of the contained value _Storage::_M_value, leaving the union
_Storage without an active member. While this is benign at runtime, a
union suboject with no active member violates core constant expression
requirements and in turn an optional in this state can't be used as a
constant initializer, which Clang and recent GCC (since r16-3022) correctly
diagnose.
To fix this, this patch makes _M_destroy activate the dummy union member
_M_empty after destroying _M_value to ensure that the union always has
an active member throughout its lifetime. We use std::construct_at
instead of simple assignment to work around a front end bug (comment #3
in the PR). Doing so means we don't activate the member in C++17 mode,
which should be fine; I don't think it's possible to disengage an engaged
optional using only the C++17 constexpr optional operations.
PR c++/124910
libstdc++-v3/ChangeLog:
* include/std/optional (_Optional_payload_base::_M_destroy)
[__cpp_lib_optional >= 202106L]: During constant evaluation,
after invoking destructor of _M_value, use construct_at to
activate _M_empty.
* testsuite/20_util/optional/constexpr/124910.cc: New test.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
The result type of the assert() should always be the same as its
inferred expression type, which could either be `void' or `noreturn'.
Also moves the pattern of calling to BUILT_IN_TRAP to its own codegen
function, as it is repeated quite enough throughout the front-end.
PR d/124922
gcc/d/ChangeLog:
* d-codegen.cc (build_trap_call): New function.
(build_array_bounds_call): Use it.
(build_bounds_index_condition): Likewise.
(build_bounds_slice_condition): Likewise.
(d_build_call): Likewise.
* expr.cc (ExprVisitor::visit (HaltExp *)): Likewise.
(ExprVisitor::visit (AssertExp *)): Likewise. Return zero instead of
void_node when assert contracts are disabled.
* d-tree.h (build_trap_call): New prototype.
gcc/testsuite/ChangeLog:
* gdc.dg/pr124922.d: New test.
The bswaphi pattern generates 2 assembly instructions with a length
of 8 bytes. The bswaphi pattern missed the length attribute, as a
result the default of 8 bytes was assumed. This allowed the "8 byte"
bswaphi pattern to be scheduled into the delay slot of a branch
instruction where only a 4 byte instruction can be placed. This
patch addresses the problem.
2026-04-18 Michael Eager <eager@eagercon.com>
gcc/ChangeLog:
PR target/103383
* config/microblaze/microblaze.md: bswaphi2: (set_attr length 8)
gcc/testsuite/ChangeLog:
PR target/103383
* gcc.target/microblaze/isa/pr103383.c: New test.
Signed-off-by: Nagaraju Mekala <nmekala@xilix.com>
Signed-off-by: Gopi Kumar Bulusu <gopi@sankhya.com>
Signed-off-by: Michael J. Eager <eager@eagercon.com>
This is a serious contender for the smallest chunk of code still hanging the
compiler after three decades.
gcc/ada/
PR ada/107392
* sem_res.adb: Add clauses for Ttypes.
(Resolve.Patch_Up_Value): Do not try to convert real literals that
do not fit in Universal_Integer.
gcc/testsuite/
* gnat.dg/specs/float_literal2.ads: New test.
This is a serious contender for the smallest chunk of code still crashing
the compiler after three decades.
gcc/ada/
PR ada/107391
* urealp.adb (Decimal_Exponent_Hi): Check that the denominator is
in range before invoking UI_To_Int on it, and cope with failure.
(Decimal_Exponent_Lo): Likewise.
gcc/testsuite/
* gnat.dg/specs/float_literal1.ads: New test.
Also fix the index entries for the decimal float suffixes, which are not
integer suffixes.
gcc/ChangeLog:
PR c/84717
* doc/extend.texi (Decimal Float): Document d and D suffixes.
Fix index entries for decimal float suffixes.
Reviewed-by: Jakub Jelinek <jakub@redhat.com>
Like in r16-559 for std::expected, std::indirect's operator== is also
prone to constraint recursion due to CWG 2369, for the Mandates that we
implement as an associated constraint. This patch works around the
recursion in a similar manner as done for std::expected (and
std::basic_const_iterator).
PR libstdc++/124890
PR libstdc++/119714
PR libstdc++/112490
libstdc++-v3/ChangeLog:
* include/bits/indirect.h (indirect::operator==): Replace
non-dependent std::indirect function parameter with a
dependent one of type indirect<_Vp> where _Vp matches _Tp.
* testsuite/std/memory/indirect/124890.cc: New test.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
The testcase now fails because we miss the fact that type can be in construction.
This is because polymorphic_ctor_dtor_p returns false on polymorphic destructor
since it has PURE flag. The problem is that the destructor is optimized in meantime
and the memory store is optimized out. It is however left intact in the inline copy
of the constructor, so we can't really use the flag.
This check was added during early stage of the development of ipa-devirt and it
is not very effective (does not trigger anything useful on testsuite or GCC bootstrap).
So this patch simply drops it.
gcc/ChangeLog:
PR ipa/120098
* ipa-polymorphic-call.cc (polymorphic_ctor_dtor_p): Remove
check for pure/const flags
Solve first problem discussed in PR120098 where modified
devirt-23 testcase leads to wrong code. The testcase triggers situation
whre anonymous type MultiTermDocs is derived by C. When we look for possible
polymorphic call targets, we special case anonymous type and check if they
have been instantiated by looking if their virtual table is used at all.
In this case it is not, however C has construction vtable which refers to
MultiTermDocs's virtual function.
Since we have no easy way to go from a type to all construction vtables
of its derived types, this is fixed by adding a walk of variables
and noting them. Walk is triggered lazilly only when such anonymous types
exists.
gcc/ChangeLog:
PR ipa/120098
* ipa-devirt.cc (odr_type_p): Add no_derived_construction_vtables
(odr_types_ptr): Move ahead in file.
(odr_types): Move ahead in file.
(anonymous_construction_vtable_p): New function.
(mark_derived_construction_vtables): New function.
(construction_vtable_hook): New function.
(type_possibly_instantiated_p): Watch for construction vtables.
gcc/testsuite/ChangeLog:
PR ipa/120098
* g++.dg/torture/pr120098.C: New test.
...to use the narrower DECL_FUNCTION_TEMPLATE_P instead of
really_overloaded_fn. Also make the parameter const_tree.
gcc/cp/ChangeLog:
* cp-tree.h (reflection_function_template_p): Change the
parameter to const_tree.
* reflect.cc (valid_splice_for_member_access_p): Use
reflection_function_template_p.
(reflection_function_template_p): Check DECL_FUNCTION_TEMPLATE_P
instead of really_overloaded_fn. Unwrap BASELINKs and OVERLOADs.
Adjust the parameter type.
Reviewed-by: Jason Merrill <jason@redhat.com>
We have 'gfortran.dg/goacc-gomp/goacc-gomp.exp'; use it for this OpenACC/OpenMP
test case added in commit 3d4039e95d
"fortran: Fix free-form mixed OpenACC/OpenMP continuation state":
'gfortran.dg/goacc/omp-108382.f90' -> 'gfortran.dg/goacc-gomp/pr108382.f90'.
PR fortran/108382
gcc/testsuite/
* gfortran.dg/goacc/omp-108382.f90: Move...
* gfortran.dg/goacc-gomp/pr108382.f90: ... here, and adjust.
We (nowadays) have 'gfortran.dg/goacc-gomp/goacc-gomp.exp'; use it for this
OpenACC/OpenMP test case added in
commit aa1b56967d
"openmp: Handle rest of EXEC_OACC_* in oacc_code_to_statement [PR93463]":
'gfortran.dg/goacc/pr93463.f90' -> 'gfortran.dg/goacc-gomp/pr93463.f90'.
PR fortran/93463
gcc/testsuite/
* gfortran.dg/goacc/pr93463.f90: Move...
* gfortran.dg/goacc-gomp/pr93463.f90: ... here, and adjust.
We (nowadays) have 'gfortran.dg/goacc-gomp/goacc-gomp.exp'; use it for this
OpenACC/OpenMP test case added in
commit a38979d9d7
"openmp: Teach omp_code_to_statement about rest of OpenMP statements":
'gfortran.dg/goacc/pr93329.f90' -> 'gfortran.dg/goacc-gomp/pr93329.f90'.
PR fortran/93329
gcc/testsuite/
* gfortran.dg/goacc/pr93329.f90: Move...
* gfortran.dg/goacc-gomp/pr93329.f90: ... here, and adjust.
We (nowadays) have 'gfortran.dg/goacc-gomp/goacc-gomp.exp'; use it for this
OpenACC/OpenMP test case added in r230872
(commit aa81272c9f)
"[PR fortran/63858] Fix mix of OpenACC and OpenMP sentinels in continuations":
'gfortran.dg/goacc/omp-fixed.f' -> 'gfortran.dg/goacc-gomp/pr63858.f'.
PR fortran/63858
gcc/testsuite/
* gfortran.dg/goacc/omp-fixed.f: Move...
* gfortran.dg/goacc-gomp/pr63858.f: ... here, and adjust.
We (nowadays) have 'gfortran.dg/goacc-gomp/goacc-gomp.exp'; use it for this
OpenACC/OpenMP test case added in r219682
(commit 41dbbb3789)
"Merge current set of OpenACC changes from gomp-4_0-branch":
'gfortran.dg/goacc/omp.f95' -> 'gfortran.dg/goacc-gomp/nesting-fail-1.f95'.
gcc/testsuite/
* gfortran.dg/goacc/omp.f95: Move...
* gfortran.dg/goacc-gomp/nesting-fail-1.f95: ... here, and adjust.