Re: [PATCH] fortran: support .NIL. in conditional arguments

2025-10-25 Thread Yuao Ma
Hi Tobias, On Mon, Oct 20, 2025 at 6:48 PM Tobias Burnus wrote: > > Yuao Ma wrote: > > This patch introduces support for the NIL value within conditional > > arguments, addressing several scenarios for how NIL should be handled. > > Let's start with two testcases that fail: > > (A) Passing a stri

[PATCH v2] LoongArch: Make the code generation of the trap pattern configurable

2025-10-25 Thread Xi Ruoyao
In some applications (notably the Linux kernel), "break 0" is used as a trap that a handler may be able to recover. But in GCC the "trap" pattern is meant to make the program rightfully die instead. As [1] describes, sometimes it's vital to distinguish between the two cases. The kernel developer

Re: [PATCH v2 02/13] LoongArch: Add options for LA64v1.1 extended instructions to target attribute.

2025-10-25 Thread Xi Ruoyao
On Sun, 2025-10-19 at 10:31 +0800, Lulu Cheng wrote: > Supported options: >  -mfrecipe -mdiv32 -mlam-bh -mlamcas -mscq -mld-seq-sa. > > gcc/ChangeLog: > > * config/loongarch/loongarch-target-attr.cc > (struct loongarch_attribute_info): Add options, and generate > the structure t

[PATCH v5] c/c++: Make stack protection guard an internal symbol

2025-10-25 Thread H.J. Lu
On Sat, Oct 25, 2025 at 4:42 PM H.J. Lu wrote: ... > Here is the v4 patch. > > Add a new target hook, stack_protect_guard_symbol, to support the user > provided stack protection guard as an internal symbol. If the hook is > true, > > 1. Make __stack_chk_guard an internal C/C++ symbol. > 2. Declar

[PATCH 7/7] c++: Add detailed diagnostics for (and fix) relocation builtins

2025-10-25 Thread Nathaniel Shead
OK for trunk? -- >8 -- This adds detailed explanatory diagnostics for the three builtins used for trivial relocatable, nothrow relocatable, and replaceable. It also fixes the checks for move construction (and assignment) to do overload resolution rather than just checking the first viable move c

[PATCH 6/7] c++: Add detailed diagnostics for __is_pointer_interconvertible_base_of

2025-10-25 Thread Nathaniel Shead
OK for trunk? I didn't realise before implementing that this basically just ends up being a 'std_layout_type_p' + 'is_base_of' check, so it hardly seems worth it given that I haven't worked out a good way to explain the former yet, but it at least gives slightly more detail. -- >8 -- gcc/cp/Chan

[PATCH 4/7] c++: Add detailed diagnostics for __builtin_has_unique_object_representations

2025-10-25 Thread Nathaniel Shead
I experimented with doing the explanations recursively (so e.g. when explaining that a field doesn't have unique object representations, go on to explain why that field's type doesn't have unique object representations, and so forth until we stop) but that seemed liable to generate a lot of unhelpf

[PATCH 2/7] c++: Adjust location of is_*_base_of diagnostics

2025-10-25 Thread Nathaniel Shead
OK for trunk? -- >8 -- It makes more sense to point at the derived type (that didn't specify the base class). gcc/cp/ChangeLog: * constraint.cc (diagnose_trait_expr): Use t2's location for is_base_of, is_pointer_interconvertible_base_of, and is_virtual_base_of. gcc/test

[PATCH 5/7] c++: Add detailed diagnostics for __is_layout_compatible

2025-10-25 Thread Nathaniel Shead
OK for trunk? -- >8 -- This reorders some checks in layout_compatible_type_p to promote more useful diagnostics as well and try to avoid duplicate code. gcc/cp/ChangeLog: * constraint.cc (diagnose_trait_expr) : Explain why not. * cp-tree.h (layout_compatible_type_p): Add

[PATCH 3/7] c++: Fix diagnostics for __is_destructable

2025-10-25 Thread Nathaniel Shead
OK for trunk? -- >8 -- We'd missed providing a diagnostic when checking a non-scalar non-class type, such as a function type. gcc/cp/ChangeLog: * method.cc (destructible_expr): Add explanation when type is neither class nor scalar. gcc/testsuite/ChangeLog: * g++.dg/ext

[PATCH 1/7] c++: Check for error_mark_node in diagnose_trait_expr

2025-10-25 Thread Nathaniel Shead
I haven't found any particular testcases affected by this but I couldn't guarantee it wouldn't cause issues either, so seems worth doing IMO. OK for trunk? -- >8 -- gcc/cp/ChangeLog: * constraint.cc (diagnose_trait_expr): Check for error_mark_node, reset input_location. Signed-o

[PATCH 0/7] c++: More trait diagnostics

2025-10-25 Thread Nathaniel Shead
This patch series adds some more explanatory diagnostics for traits, and fixes some issues I found on the way. The only remaining traits without explanatory diagnostics are either those where there's no useful explanation to give (e.g. is_const), or for traits where they are based around flags set

[PATCH v3] Add built-in memalignment [PR122117]

2025-10-25 Thread Peter Damianov
C23 adds a memalignment function to determine the alignment of a pointer. Given how simple it is (convert pointer to an integer then return (p & -p)), GCC should support expanding it inline. This patch implements __builtin_memalignment which expands to p & -p gcc/ChangeLog: PR middle-end

[PATCH] Introduce x86_64-linux-gnum32

2025-10-25 Thread Alexandre Oliva
Enable a 32-bit "native" toolchain to be built on x86_64-linux-gnu, i.e., one that targets -m32 despite running in 64-bit mode. Neither multilibs nor -m64 support are desired for this configuration (a multilibbed x86_64-linux-gnu native, defaulting to -m32 through self specs would accomplish tho

Re: [PATCH] [aarch64] [testsuite] tolerate alternate insn selection [PR121599]

2025-10-25 Thread Andrew Pinski
On Sat, Oct 25, 2025 at 6:17 PM Alexandre Oliva wrote: > > > On gcc-14, instead of 'movi\td[0-9]*,#0', we select > 'mov\tz[0-9]*\.b,#0', and the testcase fails. > As in pfalse* tests, tolerate the difference. > > The test works as is on gcc-15 and trunk, but the patch has been tested > with aarch6

[PATCH] [aarch64] [testsuite] tolerate alternate insn selection [PR121599]

2025-10-25 Thread Alexandre Oliva
On gcc-14, instead of 'movi\td[0-9]*,#0', we select 'mov\tz[0-9]*\.b,#0', and the testcase fails. As in pfalse* tests, tolerate the difference. The test works as is on gcc-15 and trunk, but the patch has been tested with aarch64-elf on both gcc-14 and trunk. Ok for gcc-14, where the test backpo

[PATCH] [riscv] avoid auipc overflow with large offsets [PR91420]

2025-10-25 Thread Alexandre Oliva
When computing an address plus a large offset on riscv64 with a PC-relative sequence, we may hit the range limit for auipc and get a relocation overflow, where on riscv32 the computation wraps around. Since -mcmodel=medany requires the entire program to fit in a 2GiB address range, a +/-1GiB+ of

Re: [PATCH] doc: mention -Wmaybe-uninitialized vs CCP

2025-10-25 Thread Sam James
Richard Biener writes: > On Fri, Oct 10, 2025 at 4:27 AM Sam James wrote: >> >> Sandra Loosemore writes: >> >> > On 10/9/25 15:00, Sam James wrote: >> >> Sandra Loosemore writes: >> >> >> >>> On 10/8/25 21:15, Sam James wrote: >> CCP interacts poorly with -Wmaybe-uninitialized in some cas

Re: [PATCH] doc: type-punning through a union is a GNU extension for C++

2025-10-25 Thread Sam James
Jason Merrill writes: > On 10/9/25 3:43 AM, Sam James wrote: >> We didn't explicitly say that type-punning through a union is undefined >> behavior in C++. Mention that, and that we support it as a GNU extension. >> This was reported on LLVM's Discourse (forums) [0]. >> [0] >> https://discourse.l

[COMMITTED] doc: fix __attribute__((nocf_check)) documentation

2025-10-25 Thread Sam James
Fix two syntax errors (missing '(' and ')' and misplaced '{'). gcc/ChangeLog: * doc/extend.texi (nocf_check): Fix syntax errors in example. --- Committed as obvious. gcc/doc/extend.texi | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gcc/doc/extend.texi b/gcc/

[COMMITTED] libgcobol: fix compat w/ >=libxml2-2.12

2025-10-25 Thread Sam James
libgcobol/ChangeLog: PR cobol/122398 * xmlparse.cc (__gg__xml_parse): Make 'msg' const. --- Committed as obvious. libgcobol/xmlparse.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgcobol/xmlparse.cc b/libgcobol/xmlparse.cc index 69849e3311c6..57d370a390

Re: [PATCH] Fortran: IS_CONTIGUOUS and pointers to non-contiguous targets [PR114023]

2025-10-25 Thread Harald Anlauf
Am 25.10.25 um 19:13 schrieb Jerry D: On 10/24/25 12:52 PM, Harald Anlauf wrote: Dear All, this patch does two things: it extends the inline generated code for IS_CONTIGUOUS to check the dtype of a passed pointer for span equal to elem_len.  It also fixes the assignment of pointers to ensure th

Re: [PATCH] match.pd: simplify (view_convert (BIT_FIELD_REF))

2025-10-25 Thread Jeff Law
On 10/23/25 5:50 AM, Richard Biener wrote: On Thu, 23 Oct 2025, Artemiy Volkov wrote: This patch adds a match.pd transformation to strip unnecessary view_converts of BIT_FIELD_REFs. This should work for all combinations of types except where loss of precision is involved, i.e. in narrowing

Re: [PATCH] forwprop: Fix copy prop for alignment after the final folding [PR122086]

2025-10-25 Thread Jeff Law
On 10/24/25 10:51 PM, Andrew Pinski wrote: After r16-4081-g966cdec2b2 which added folding of __builtin_assume_aligned, forwprop would propagate pointers that lower alignment replacing ones with greater alignment. This causes us to lose alignment information that __builtin_assume_aligned provid

[PATCH v2] libstdc++: Add constructors and assignments for tuple<> with tuple-like types [PR119721]

2025-10-25 Thread Osama Abdelkader
This patch adds support for constructing and assigning tuple<> from other empty tuple-like types (e.g., array), completing the C++23 tuple-like interface for the zero-element tuple specialization. The implementation includes: - Constructor from forwarding reference to tuple-like types - Allocator-

Re: [PATCH] Fortran: IS_CONTIGUOUS and pointers to non-contiguous targets [PR114023]

2025-10-25 Thread Jerry D
On 10/24/25 12:52 PM, Harald Anlauf wrote: Dear All, this patch does two things: it extends the inline generated code for IS_CONTIGUOUS to check the dtype of a passed pointer for span equal to elem_len.  It also fixes the assignment of pointers to ensure that the dtype is the same whether bounds

Re: [PATCH] x86-64: Use `movsxd` to perform SI-to-DI extension in Intel syntax

2025-10-25 Thread LIU Hao
在 2025-10-25 23:31, Uros Bizjak 写道: OK. I don't have write access to Git, so would you please commit it for me? Thank you. -- Best regards, LIU Hao OpenPGP_signature.asc Description: OpenPGP digital signature

Re: [PATCH] x86-64: Use `movsxd` to perform SI-to-DI extension in Intel syntax

2025-10-25 Thread Uros Bizjak
On Sat, Oct 25, 2025 at 1:08 PM LIU Hao wrote: > > Although there's no possibility of ambiguity, Intel manual says the mnemonic > for DWORD-to-QWORD sign-extension operation should be MOVSXD. Some assemblers > (GNU AS, NASM) also overload MOVSX, but some others don't accept MOVSX (LLVM, > MASM, YA

Re: bootstrap fail on Darwin after r16-4527-gc11d9eaa8ac9ee

2025-10-25 Thread Iain Sandoe
> On 25 Oct 2025, at 15:25, Antoni Boucher wrote: > > Hi. > This patch looks good to me, thanks. > > Le 2025-10-25 à 07 h 46, Rainer Orth a écrit : >> Hi Iain, >>> Darwin is host-shared by default, and therefore builds jit for >>> —enable-languages=all. >>> >>> The changes in r16-4527-gc11d

Re: bootstrap fail on Darwin after r16-4527-gc11d9eaa8ac9ee

2025-10-25 Thread Antoni Boucher
Hi. This patch looks good to me, thanks. Le 2025-10-25 à 07 h 46, Rainer Orth a écrit : Hi Iain, Darwin is host-shared by default, and therefore builds jit for —enable-languages=all. The changes in r16-4527-gc11d9eaa8ac9ee are causing format mismatches on lines 3433 and 3449 of jit-recordin

Re: [PATCH][vect]: Fix LCSSA wiring during peeling of multiple-exit loops

2025-10-25 Thread Tamar Christina
Arg.. Just noticed a typo.. BB 3: i_2 = PHI Should be BB 3: i_2 = PHI Rest is OK. Sorry about that From: Tamar Christina Sent: Saturday, October 25, 2025 10:52 AM To: [email protected] Cc: nd ; [email protected] ; [email protected] Subject: [

[patch] Replace VSB_DIR by sysroot refs in VxWorks LIBGCC2_INCLUDES

2025-10-25 Thread Olivier Hainque
Hello, This change mimics for LIBGCC2_INCLUDES what VXWORKS_ADDITIONAL_CPP_SPEC does for VxWorks, allowing libgcc to build without VSB_DIR defined in the environment as soon as the configure switches featured a proper --with-build-sysroot was provided. Tested with a successful build for --target=

Re: bootstrap fail on Darwin after r16-4527-gc11d9eaa8ac9ee

2025-10-25 Thread Rainer Orth
Hi Iain, > Darwin is host-shared by default, and therefore builds jit for > —enable-languages=all. > > The changes in r16-4527-gc11d9eaa8ac9ee are causing format mismatches on > lines 3433 and 3449 of jit-recording.cc because > Darwin’s uint64_t == long long unsigned

bootstrap fail on Darwin after r16-4527-gc11d9eaa8ac9ee

2025-10-25 Thread Iain Sandoe
Hi Darwin is host-shared by default, and therefore builds jit for —enable-languages=all. The changes in r16-4527-gc11d9eaa8ac9ee are causing format mismatches on lines 3433 and 3449 of jit-recording.cc because Darwin’s uint64_t == long long unsigned int (and the form

[PATCH] x86-64: Use `movsxd` to perform SI-to-DI extension in Intel syntax

2025-10-25 Thread LIU Hao
Although there's no possibility of ambiguity, Intel manual says the mnemonic for DWORD-to-QWORD sign-extension operation should be MOVSXD. Some assemblers (GNU AS, NASM) also overload MOVSX, but some others don't accept MOVSX (LLVM, MASM, YASM in NASM mode) and require MOVSXD. This mnemonic was i

[PATCH][vect]: support vectorization of early break forced live IVs as scalar

2025-10-25 Thread Tamar Christina
Consider this simple loop long long arr[1024]; long long *f() { int i; for (i = 0; i < 1024; i++) if (arr[i] == 42) break; return arr + i; } where today we generate this at -O3: .L2: add v29.4s, v29.4s, v25.4s add v28.4s, v28.4s, v26.4s c

[PATCH][vect]: Fix LCSSA wiring during peeling of multiple-exit loops

2025-10-25 Thread Tamar Christina
Consider this Fortran testcase: integer (8) b, c integer d c = 10 d = 2 call e ((/ (b, b = j, c, d) /), 0_8, c, d + 0_8) contains subroutine e (a, f, g, h) integer (8), dimension (:) :: a integer (8) f, g, h i = 1 do b = f, g, h if (a (i) .ne. b) STOP i = i

[PATCH]middle-end: Don't ICE during gimple_build of an incomplete PHI node

2025-10-25 Thread Tamar Christina
The new building APIs e.g. gimple_build APIs at the moment ICE if you try to build a PHI node without all the arguments set yet. However this workflow is quite common, especially in the vectorizer. This change allows this case by just not folding the PHI is any argument is missing as we don't kno

Re: [PATCH] xtensa: Remove one_cmplsi2 insn pattern

2025-10-25 Thread Max Filippov
Hi Suwa-san, On Fri, Oct 24, 2025 at 12:55 PM Takayuki 'January June' Suwa wrote: > > The definition of one_cmplsi2 insn pattern is not mandatory; the insn > generator recognize the absence of the pattern and instead generates an XOR > with a pseudo whose value is -1 if "XOR reg, reg, imm" is not

[PATCH v4] c/c++: Make stack protection guard an internal symbol

2025-10-25 Thread H.J. Lu
On Wed, Oct 8, 2025 at 10:13 PM Jason Merrill wrote: > > On 10/6/25 12:21 AM, H.J. Lu wrote: > > On Sun, Oct 5, 2025 at 10:59 PM Jason Merrill wrote: > >> > >> On 9/23/25 8:02 AM, H.J. Lu wrote: > >>> On Tue, Sep 23, 2025 at 2:22 PM Florian Weimer wrote: > > * H. J. Lu: > > >>

Re: [pushed][PATCH v2] LoongArch: Implement vector reduction from 256-bit to 128-bit

2025-10-25 Thread Lulu Cheng
Pushed to r16-4619. 在 2025/10/23 下午2:29, Jiahao Xu 写道: gcc/ChangeLog: * config/loongarch/lasx.md (vec_extract): New define_expand. (vec_extract_lo_): New define_insn_and_split. (vec_extract_hi_): New define_insn. * config/loongarch/loongarch-protos.h (loongarch

Re: [PATCH] libstdc++: Add constructors and assignments for tuple<> with tuple-like types [PR119721]

2025-10-25 Thread Tomasz Kaminski
Thanks for the second patch, we need to adjust the implementation a bit, so it does not break existing code. On Fri, Oct 24, 2025 at 11:37 PM Osama Abdelkader < [email protected]> wrote: > This patch adds missing constructors and assignment operators for tuple<> > to support construction

[PATCH] LoongArch: Optimize the non-zero check for both integers

2025-10-25 Thread Guo Jie
Before: sltu$r5,$r0,$r5 sltu$r4,$r0,$r4 and $r4,$r5,$r4 After: sltu$r4,$r0,$r4 maskeqz $r4,$r4,$r5 gcc/ChangeLog: * config/loongarch/loongarch.md (both_non_zero): New combiner. (both_non_zero_subreg): Ditto. gcc/testsuite/Ch