Re: [PATCH] x86: Don't hoist non all 0s/1s vector set outside of loop

2025-08-02 Thread Andi Kleen
"H.J. Lu" writes: > Don't hoist non all 0s/1s vector set outside of the loop to avoid extra > spills. It seems this could be a loss if there are actually enough registers. So you need to make it depend on the register pressure? -Andi

Re: [PATCH v9 0/4] extend "counted_by" attribute to pointer fields of structures + fix PR120929

2025-08-02 Thread Kees Cook
On Fri, Aug 01, 2025 at 06:11:04PM +, Qing Zhao wrote: > This is the 9th version of the patch set to extend "counted_by" attribute > to pointer fields of structures, which fixes PR120929: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120929 Thanks! I've validated this works with my patche

Re: [PATCH] Use regular libdir/includedir in libgcc Makefiles

2025-08-02 Thread John Ericson
> and "get those settings passed down from top level" is one plausible end > state - sharing logic implicitly that way rather than expanding it all > locally in each target library configure script, even if expanding it > locally for each library is useful as an intermediate stage.) Correct m

[pushed] wwwdocs: gcc-16: Fix markup and activate IA-32/x86-64 section

2025-08-02 Thread Gerald Pfeifer
H.J., I assume you also wanted to activate the respective section? Pushed. Gerald --- htdocs/gcc-16/changes.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/gcc-16/changes.html b/htdocs/gcc-16/changes.html index 37fcb605..a75d3b5a 100644 --- a/htdocs/gcc-16/chan

Re: [committed] libstdc++: Fix recent changes to __glibcxx_assert [PR112882]

2025-08-02 Thread Andrew Pinski
On Thu, Dec 7, 2023 at 2:07 PM Jonathan Wakely wrote: > > Tested x86_64-linux. Pushed to trunk. > > -- >8 -- > > The changes in r14-6198-g5e8a30d8b8f4d7 were broken, as I used > _GLIBCXX17_CONSTEXPR for the 'if _GLIBCXX17_CONSTEXPR (true)' condition, > forgetting that it would also be used for the

[pushed] doc: Drop note on 16-bit Windows support

2025-08-02 Thread Gerald Pfeifer
gcc: PR target/69374 * doc/install.texi (Specific) : Drop note on 16-bit Windows support. Streamline note on 32-bit support. --- gcc/doc/install.texi | 7 --- 1 file changed, 7 deletions(-) diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index f4cba098932..f3f

[PATCH 4/4] c: implement the defer keyword

2025-08-02 Thread Anna (navi) Figueiredo Gomes
based on the technical specification n3589[1] deferred statements execute at the end of the scope they're added on, similar to the cleanup attribute, and they have much of the same constraints as statement expressions, with added limitation that no local jump shall jump over a defer statement, nor

[PATCH 3/4] c: introduce jump barriers for statement expressions

2025-08-02 Thread Anna (navi) Figueiredo Gomes
represent the start and end of scope which a local jump is not allowed to cross as a jump barrier, moving this logic out into a function allows for defer statements to use the same codepath gcc/c/ChangeLog: * c-decl.cc (struct c_jump_barrier): New structure. (struct c_spot_binding

[PATCH 1/4] c: add D_C2Y disable mask

2025-08-02 Thread Anna (navi) Figueiredo Gomes
gcc/c-family/ChangeLog: * c-common.h (D_CXX11): Adjust. (D_EXT): Likewise. (D_EXT89): Likewise. (D_EXT11): Likewise. (D_ASM): Likewise. (D_OBJC): Likewise. (D_CXX_OBJC): Likewise. (D_CXXWARN): Likewise. (D_CXX_CONCEPTS): Likew

[PATCH 2/4] c: handle expression nodes in push_cleanup

2025-08-02 Thread Anna (navi) Figueiredo Gomes
for future use with defer statements, as they do not have a declaration associated, and are bound to the scope with a BIND_EXPR gcc/c/ChangeLog: * c-typeck.cc (push_cleanup): Adjust. Signed-off-by: Anna (navi) Figueiredo Gomes --- gcc/c/c-typeck.cc | 10 -- 1 file changed, 8 in

[PATCH 0/4] implement defer statements as per ts 25755

2025-08-02 Thread Anna (navi) Figueiredo Gomes
based on n3589[1], this feature mostly makes use of already-established logic, namely push_cleanup used by the cleanup attribute, and the constraints put in place for checking local jumps against statement expressions 1: https://open-std.org/JTC1/SC22/WG14/www/docs/n3589.pdf Anna (navi) Figueired

[pushed] wwwdocs: news: Drop Google Summer of Code 2014 link

2025-08-02 Thread Gerald Pfeifer
Google's news site starts 2016 only. Pushed. Gerald --- htdocs/news.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/news.html b/htdocs/news.html index 5bf6e197..e41a5e25 100644 --- a/htdocs/news.html +++ b/htdocs/news.html @@ -401,8 +401,7 @@ GCC Google Summe

[PATCH] libstdc++: Export std::owner_equal and std::owner_hash from std.cc

2025-08-02 Thread Jakub Jelinek
Hi! I've tried compiling #include with -std=c++26 -fdump-lang-all and for i in `grep ^Class.std::[^_] *.C.001l.class | sed 's/^Class //;s/[< ].*$//' | sort -u | grep -v ::.*::`; do grep -q $i /usr/src/gcc/libstdc++-v3/src/c++23/std.cc.in || echo $i; done This printed std::auto_ptr std::binary_f

Re: [PATCH] x86: Add *one_cmplqi_ext_2

2025-08-02 Thread H.J. Lu
On Fri, Aug 1, 2025 at 10:32 PM Uros Bizjak wrote: > > On Sat, Aug 2, 2025 at 3:22 AM H.J. Lu wrote: > > > > After > > > > commit 965564eafb721f813a3112f1bba8d8fae32b > > Author: Richard Sandiford > > Date: Tue Jul 29 15:58:34 2025 +0100 > > > > simplify-rtx: Simplify subregs of logic

Re: [PATCH v6 4/6] btf: generate and output DECL_TAG and TYPE_TAG records

2025-08-02 Thread Indu Bhagat
On 7/21/25 4:00 PM, David Faust wrote: Support the btf_decl_tag and btf_type_tag attributes in BTF by creating and emitting BTF_KIND_DECL_TAG and BTF_KIND_TYPE_TAG records, respectively, for them. Some care is required when -gprune-btf is in effect to avoid emitting decl or type tags for declara

[PATCH] gcc: drop placement new workaround for old bootstrap compilers

2025-08-02 Thread Sam James
Since r15-4719-ga9ec1bc06bd3cc, we require GCC 5.4, so a workaround for < GCC 4.3 is long-obsolete. Before that, we required GCC 4.8.3 too. i.e. it shouldn't be possible to build GCC with such a compiler for quite some time. gcc/ChangeLog: PR libstdc++/29286 * Makefile.in (ALIASIN

Re: [PATCH v6 3/6] ctf: translate annotation DIEs to internal ctf

2025-08-02 Thread Indu Bhagat
On 7/21/25 4:00 PM, David Faust wrote: Translate DW_TAG_GNU_annotation DIEs created for C attributes btf_decl_tag and btf_type_tag into an in-memory representation in the CTF/BTF container. They will be output in BTF as BTF_KIND_DECL_TAG and BTF_KIND_TYPE_TAG records. The new CTF kinds used to

[C PATCH] Evaluate size expression only in the active branch of conditional operator [PR108931]

2025-08-02 Thread Martin Uecker
In preparation N3652, this removes some UB from the conditional operator when forming a composite type. This is an improvement also for earlier language modes (previously I submitted PR108931 for this). Bootstrapped and regression tested on x86_64. c: Evaluate size expression only in the

[PATCH v5 6/9] bitint: Zero-extend the result of a signed->unsigned widening cast

2025-08-02 Thread Yang Yujie
A widening cast from a signed _BitInt operand to an unsigned _BitInt type involves filling the extra limb(s) with sign extension. On a target that wants _BitInts extended in memory, if this unsigned type has a partial limb, the unused part of it should be zeroed. e.g. Assuming limb_mode == E_DImod

[PATCH v5 4/9] bitint: Make sure BEXTC checks extension when optimized

2025-08-02 Thread Yang Yujie
In BEXTC, whether a _BitInt object is properly extended is examined by a value comparison against a copied object in a wider _BitInt type that utilizes all of the partial limb. Since the (implicit) conversion to the wider type may be optimized away and cause the result of the comparison to always

[PATCH v5 9/9] LoongArch: Add support for _BitInt [PR117599]

2025-08-02 Thread Yang Yujie
This patch adds support for C23's _BitInt for LoongArch. >From the LoongArch psABI[1]: > _BitInt(N) objects are stored in little-endian order in memory > and are signed by default. > > For N ≤ 64, a _BitInt(N) object have the same size and alignment > of the smallest fundamental integral type tha

[PATCH v5 3/9] bitint: Allow unused bits when testing extended _BitInt ABIs

2025-08-02 Thread Yang Yujie
In LoongArch psABI, large _BitInt(N) (N > 64) objects are only extended to fill the highest 8-byte chunk that contains any used bit, but the size of such a large _BitInt type is a multiple of their 16-byte alignment. So there may be an entire unused 8-byte chunk that is not filled by extension, an

[PATCH v5 5/9] bitint: Avoid extending ABI-extended large/huge _BitInts on load

2025-08-02 Thread Yang Yujie
This patch also make casts of ABI-extended large/huge _BitInts behave the same as the small/middle case, i.e. no-op for casts to a higher precision _BitInt with the same number of limbs / extension for casts that turns a full top limb into a partial limb. This conveniently helps keep some code with

[PATCH v5 8/9] LoongArch: Prioritize target-specific makefile fragments

2025-08-02 Thread Yang Yujie
libgcc/ChangeLog: * config.host: Remove unused code. Include LoongArch-specific tmake_files after the OS-specific ones. --- libgcc/config.host | 31 --- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/libgcc/config.host b/libgcc/config.h

[PATCH v5 7/9] bitint: Do not optimize away conversion to _BitInt before a VCE

2025-08-02 Thread Yang Yujie
A _BitInt value may rely on a conversion to become properly extended. So a conversion to _BitInt is not trivially removable even if the types of the result and the operand have the same precision and size. This patches fixes gcc.dg/torture/bitint-64.c at -O2 on LoongArch, which fails because exten

[PATCH v5 2/9] expand: Reduce unneeded _BitInt extensions

2025-08-02 Thread Yang Yujie
For targets that set the "extended" flag in TARGET_C_BITINT_TYPE_INFO, we assume small _BitInts to be internally extended after arithmetic operations. In this case, an extra extension during RTL expansion can be avoided. gcc/ChangeLog: * expr.cc (expand_expr_real_1): Do not call r

[PATCH v5 1/9] bitint: Allow mode promotion of _BitInt types

2025-08-02 Thread Yang Yujie
For targets that treat small _BitInts like the fundamental integral types, we should allow their machine modes to be promoted in the same way. gcc/ChangeLog: * explow.cc (promote_function_mode): Add a case for small/medium _BitInts. (promote_mode): Same. --- gcc/explow.cc

[PATCH v5 0/9] LoongArch: Add support for _BitInt [PR117599]

2025-08-02 Thread Yang Yujie
Changes from v4: 1. Remove option "-fwrapv" from gcc.dg/torture/bitint-84.c, which came from its origin gcc.dg/torture/bitint-64.c, but interferes with the result. 2. Other fixes from Jakub's review on v4. In particular, BEXTC was modified to not rely on full limb comparision of the par

[C PATCH, v2] Fix ICE on invalid code involving bit fields [PR121217]

2025-08-02 Thread Martin Uecker
Sorry, Joseph. I am resending this because I forgot to include some fixes in the test directives in the patch before sending (I had tested it with these changes). As the only change is the dejagnu part and the rest was ok, I will wait a bit and then submit it if I do not hear any objections. B

[PATCH] libcpp: Use pedwarn instead of warning for CWG2578 diagnostics [PR120778]

2025-08-02 Thread Jakub Jelinek
Hi! This is another case which changed from compile time undefined behavior to ill-formed, diagnostic required. Now, we warn on this, so pedantically that is good enough, maybe all we need is a testcase, but the following patch changes it to a pedwarn for C++26. Bootstrapped/regtested on x86_64-

[PATCH] c++: Warn on #undef/#define of remaining cpp.predefined macros [PR120778]

2025-08-02 Thread Jakub Jelinek
Hi! We already warn on #undef or pedwarn on #define (but not on #define after #undef) of some builtin macros mentioned in cpp.predefined. The C++26 P2843R3 paper changes it from (compile time) undefined behavior to ill-formed. The following patch arranges for warning (for #undef) and pedwarn (on