From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id UNQ2FonJ8GpUuTUAWB0awg (envelope-from ) for ; Sun, 08 Nov 2026 14:12:09 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=sociotechnical.xyz header.i=@sociotechnical.xyz header.a=rsa-sha256 header.s=fm1 header.b=n9hGgJHy; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=jcEGd7O3; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 431AE1E023; Sun, 08 Nov 2026 14:12:09 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D5C751E023 for ; Sun, 08 Nov 2026 14:12:06 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 19EE54BA23E0 for ; Sun, 8 Nov 2026 19:12:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19EE54BA23E0 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=sociotechnical.xyz header.i=@sociotechnical.xyz header.a=rsa-sha256 header.s=fm1 header.b=n9hGgJHy; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=jcEGd7O3 Received: from fout-a4-smtp.messagingengine.com (fout-a4-smtp.messagingengine.com [103.168.172.147]) by sourceware.org (Postfix) with ESMTPS id A6C714BA23F1 for ; Sun, 8 Nov 2026 19:11:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A6C714BA23F1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=sociotechnical.xyz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sociotechnical.xyz ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A6C714BA23F1 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=103.168.172.147 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794165082; cv=none; b=dbW2mKY+z8RZa8TOlOs1kkCCxTCwrIgb/mEJrbbxwUYdKH0YxFvXIzIXfHVeHGtn7ieA+u0yqoRPBl/4CrPaXHCsC9fq56j0KMFIYtG+dUWsQLPPtsdjiryYgnLpD1MQYrSSV82mSHmyPBCfCRZs6LQtaX118Wm/nXS5F6BpfF0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794165082; c=relaxed/simple; bh=Uy1OxULoXZtovzNmXcOAqQddVrf2jl4L9XLelAZWpic=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=EKorSZEliTEbMpqkAPFrR4iU1SGd77xLH937GUk0LQOc6eLk7y3K10tNsApXhHNtfkxM2PYy33hM+BRyEe8wPJZFwP15UbloMzzt1/7py8CzkmyLHqeqKvXNifPsOl2gpsAd1sxqYsFlhWK9c9lpyRvsk4oo4ulb+g3g2qnBkCk= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=sociotechnical.xyz header.i=@sociotechnical.xyz header.a=rsa-sha256 header.s=fm1 header.b=n9hGgJHy; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=jcEGd7O3 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A6C714BA23F1 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id 768D3EC0098 for ; Sun, 8 Nov 2026 14:11:22 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Sun, 08 Nov 2026 14:11:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sociotechnical.xyz; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to; s=fm1; t= 1794165082; x=1794251482; bh=ZXk9HuVg5wllhXe74zCBoQ1rsInPJY/hoSb pxLVvddA=; b=n9hGgJHyXxqYFXoTqSxa1v6rpFJELLcr64ptspyEwhEQ0oJmW3J cQdM3CNeKUiKLAESC5M1CkvCxDkBh7Scabj8UY55lPF/Dh6VOiYyOGj8ZZDon1nj ZKTjzd5a0jaa0PGEAGUTrm6MhCzXHw85YL12sgiyeVxevfTk4QJTc95pJj7Qbduu +nBEHn9zGky1+o0P3xbH8n+JaNk+tHFT8OGNhGxtmkKS5FjFeA3cOcVExq3mTXTJ tBKnOOTESEtdoWO4qvdys4UTHlvyGdKHxJXcYHbcfeQzo6gL+jN8L6wJSd5QUHcI e0uK5jN/AV6ANICDvXVg3EWQqCjFET/xxGg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1794165082; x=1794251482; bh=ZXk9HuVg5wllhXe74zCBoQ1rsInPJY/hoSb pxLVvddA=; b=jcEGd7O340ZlAzYgWpX8Euims6aSXvzqRB9zHMmJl5Xd0QVmjwh nu61Rmq87TPfsbhhFOL6VQ6QFJYtQWA3oTAdd7s6UQ8RibFpVei4zkK+46sYjOh6 EUOLTL1PugHZp1e+3WKAVIAgdfYly6noCwTiIWx3GQrtaL+4dQKw9K83ATshAnS5 Jze9zpoLNEol3NBTQhLWnt5F8RJ7zTjePkOCFMEZ8OAa0HrghVQSodoJAWTWpvSt t95UOvrzKLHoxLwpcZKnLbuEU/zAiWgIsjdJcfiesJ4J8muKRFvpeQ7kYKSxothG UXvTqNG7YkOLZ9lBOAeYanTlO3LbaU5Do4Q== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=sociotechnical.xyz a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1794165082; d=sociotechnical.xyz; mf=PHBpZXRyb0Bzb2Npb3RlY2huaWNhbC54eXo+; rt=PGdkYi1wYXRjaGVzQHNvdXJjZXdhcmUub3JnPg==; s=fm1:rsa-sha256:XJ0DHmCg+q4FCOQonP1aFEJwEpNKf7pMkyg14AIk1Z3wfxA 2ylmN1U51PKqRd07XbRQN4suYW9P+g3wWBwIibHZLgNazGBw5E8/77RB7yOF9HAf 0jF3e8YYtnb1BfcLtGkKlQrTddDaO/vv2TDg4BZScGEpxjyL5+cSrKNGGN3RzhSn 9EZHxs/h2n1qDnTgp5mi/Cf8DB5PJQeeI3lCjoA+SnQsNBmq1+FExtFM+V8KRRJL HkLlS8pCbOkMbYkc8ihzpazQq2/ZPx9zxt+x1ayc1D1RMpj9AGR4HnlKgjE74bFO oVmO5z2p7P1j2ggm/A6Iu+eQatXeoimdl2joa8A==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=9; hn=cc,content-transfer-encoding,date,feedback-id,from, message-id,mime-version,subject,to; Message-Instance: m=1; h=sha256:BUt4FYIWt2jbBQQHbYLUzd70Ai6T7w+rytILVPajXFA=:Uy1OxULoXZtovzNmXcOAqQddVrf2jl4L9XLelAZWpic=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGHzdK4n9qNVhIrntYyXHk8uOygr3iIS2eL2/q0ElApjHWNXRf3rOGzYGJzd1rp4s PmEuCCYEwst9UUJ9PAWylNfYnaCJkj4NPPYL7T2yPtAhoWKdUHSAkcRffOTxeqRa2waFPt q5RxBHSgk/REOcSAq1mua2j19rBns7/VpXWRQeWmHFoqAh617WkKrS5MppWVJsNIMOW1+X dGFGu2mvbM+IqmQkmulMeW9XcCzDKkojdbEf+bLCtArH0LV+5Lz5JRm/dxRyb6OwKmbdt7 9UhCZIgCQsMgFqawE3bnYht56w4OhxzTzcv/JEvDsG/fCEsV73KLou1PU9oq3UVCXGkpew 3FjUIDlFEPoxWJn6wA9FQ1BttzsQ+sW7LfKxoniMnELvYBhQZ3GCYw6o3eewOcaubaFN5g zXTHKfwIWZvQ7DK2RnVeOMeCLS1YrAdfDzpPy0FhMJGSepSUK6UfezEbQx1R+SFrdz76Hm x2gm4UwH1n6KJ6tRi3WL5eVC8cSIPlBe98YvEAuTUST8XvoGVfC+dyY3XNZ3Hq1+rvf9Rq 8P59gLN3QE9/QU6FfFuhg+KTAs768sTH4oYHjiKLkOmNa6n4zlbem7L5E3mHhjFLC1D7n4 snrG1TG+rZ8Y4nLzsz19mEVHQR5A0oJyIwPL9mXiCltsDwzbHoplmjfo6Bvw X-ME-Proxy: Feedback-ID: i7f494689:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 8 Nov 2026 14:11:21 -0500 (EST) From: Pietro Monteiro To: binutils@sourceware.org, gdb-patches@sourceware.org Cc: Pietro Monteiro Subject: [PATCH] include: sync with GCC Date: Sun, 8 Nov 2026 14:11:14 -0500 Message-ID: <20261108191114.593870-1-pietro@sociotechnical.xyz> X-Mailer: git-send-email 2.56.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org copied from include in the gcc tree all common files, except for btf.h. I did some git archeology to get the list of commits the changes came from. I'm sending the patch rather than just committing to give folks time to test. pietro -- >8 -- Sync the GCC files in the include/ directory with gcc commit aa0906b0ae8b02e2f9ad721d6b52cd97b8bce427 Pull changes from the following commits: aa0906b0ae8 libiberty: Declare strto{u,}ll if at least C++11. [PR128228] 389b68a1b98 [PATCH 2/2] include: Parenthesize sdiv_qrnnd macro parameters in longlong.h 3b6dbfc2adb include: Fix typos in various files 5c821cbae4a LoongArch: C and .h files for LA32 9c862a593bc ctf: translate annotation DIEs to internal ctf e08ef05e4da [PATCH] RISC-V: Use builtin clz/ctz when count_leading_zeros and count_trailing_zeros is used 45ab93d9afa non-gcc: Remove trailing whitespace 9f7afa99c67 [committed] Adding missing prototype for __clzhi2 to xstormy port Signed-off-by: Pietro Monteiro --- include/ctf.h | 4 ++++ include/demangle.h | 2 +- include/doubly-linked-list.h | 2 +- include/dyn-string.h | 2 +- include/fibheap.h | 6 +++--- include/floatformat.h | 2 +- include/gcc-cp-fe.def | 4 ++-- include/hashtab.h | 4 ++-- include/libcollector.h | 2 +- include/libiberty.h | 15 ++++++++++----- include/longlong.h | 27 +++++++++++++++++++-------- include/partition.h | 2 +- include/plugin-api.h | 12 ++++++------ include/safe-ctype.h | 2 +- include/sort.h | 6 +++--- include/splay-tree.h | 8 ++++---- include/symcat.h | 4 ++-- include/vtv-change-permission.h | 6 +++--- include/xregex.h | 2 +- 19 files changed, 66 insertions(+), 46 deletions(-) diff --git a/include/ctf.h b/include/ctf.h index e28a37d4658..02e10d7136a 100644 --- a/include/ctf.h +++ b/include/ctf.h @@ -423,6 +423,10 @@ union #define CTF_K_CONST 12 /* ctt_type is base type. */ #define CTF_K_RESTRICT 13 /* ctt_type is base type. */ #define CTF_K_SLICE 14 /* Variant data is a ctf_slice_t. */ +#define CTF_K_DECL_TAG 15 /* Declaration tag. Internal use only. + Not valid externally until CTF V4. */ +#define CTF_K_TYPE_TAG 16 /* Type tag. Internal use only. + Not valid externally until CTF V4. */ #define CTF_K_MAX 63 /* Maximum possible (V2) CTF_K_* value. */ diff --git a/include/demangle.h b/include/demangle.h index e9165d6b083..db2d2f48530 100644 --- a/include/demangle.h +++ b/include/demangle.h @@ -314,7 +314,7 @@ enum demangle_component_type /* C++11: An rvalue reference modifying a member function. The one subtree is the type which is being referenced. */ DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS, - /* C++23: A member function with explict object parameter. */ + /* C++23: A member function with explicit object parameter. */ DEMANGLE_COMPONENT_XOBJ_MEMBER_FUNCTION, /* A vendor qualifier. The left subtree is the type which is being qualified, and the right subtree is the name of the diff --git a/include/doubly-linked-list.h b/include/doubly-linked-list.h index d46d773800b..88a6ea6530a 100644 --- a/include/doubly-linked-list.h +++ b/include/doubly-linked-list.h @@ -64,7 +64,7 @@ or as a whole via LINKED_LIST_MUTATIVE_OPS_PROTOTYPE for the prototypes, and LINKED_LIST_MUTATIVE_OPS_DECL for the implementations. */ -/* Append the given node new_ to the exising list. +/* Append the given node new_ to the existing list. Precondition: prev and next of new_ must be NULL. */ #define LINKED_LIST_APPEND(LTYPE) LTYPE##_append diff --git a/include/dyn-string.h b/include/dyn-string.h index f8a55a43db8..b50395e43f0 100644 --- a/include/dyn-string.h +++ b/include/dyn-string.h @@ -3,7 +3,7 @@ Contributed by Mark Mitchell (mark@markmitchell.com). This file is part of GCC. - + GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) diff --git a/include/fibheap.h b/include/fibheap.h index f6b92d94306..62492ca4b15 100644 --- a/include/fibheap.h +++ b/include/fibheap.h @@ -3,7 +3,7 @@ Contributed by Daniel Berlin (dan@cgsoftware.com). This file is part of GCC. - + GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) @@ -33,8 +33,8 @@ Boston, MA 02110-1301, USA. */ Amortized and real worst case time for operations: ExtractMin: O(lg n) amortized. O(n) worst case. - DecreaseKey: O(1) amortized. O(lg n) worst case. - Insert: O(2) amortized. O(1) actual. + DecreaseKey: O(1) amortized. O(lg n) worst case. + Insert: O(2) amortized. O(1) actual. Union: O(1) amortized. O(1) actual. */ #ifndef _FIBHEAP_H_ diff --git a/include/floatformat.h b/include/floatformat.h index bf3190e805f..954033d625f 100644 --- a/include/floatformat.h +++ b/include/floatformat.h @@ -67,7 +67,7 @@ struct floatformat unsigned int exp_start; unsigned int exp_len; /* Bias added to a "true" exponent to form the biased exponent. It - is intentionally signed as, otherwize, -exp_bias can turn into a + is intentionally signed as, otherwise, -exp_bias can turn into a very large number (e.g., given the exp_bias of 0x3fff and a 64 bit long, the equation (long)(1 - exp_bias) evaluates to 4294950914) instead of -16382). */ diff --git a/include/gcc-cp-fe.def b/include/gcc-cp-fe.def index b3c3c7928ca..2561b75fe1b 100644 --- a/include/gcc-cp-fe.def +++ b/include/gcc-cp-fe.def @@ -138,7 +138,7 @@ GCC_METHOD1 (int /* bool */, push_function, Then, as we set up the binding context to compile a code snippet at point 3, we may choose to activate c_1, o_0 and p upfront, declaring and discarding c, c_0 and o, and then reentering the - funciton scope to declare c_1, o_0 and p; or we can wait for oracle + function scope to declare c_1, o_0 and p; or we can wait for oracle lookups of c, o or p. If c is looked up, and the debugger resolves c in the scope to c_1, it is expected to enter the function scope from the top level, declare c, leave it, reenter it, declare c_0, @@ -258,7 +258,7 @@ GCC_METHOD2 (int /* bool */, add_using_decl, SYM_KIND, in addition to any other applicable flags, and pass as NAME a string starting with the two-character mangling for operator name: "ps" for unary plus, "mL" for multiply and assign, *=; etc. - Use "cv" for type converstion operators (the target type portion + Use "cv" for type conversion operators (the target type portion may be omitted, as it is taken from the return type in SYM_TYPE). For operator"", use "li" followed by the identifier (the mangled name mandates digits specifying the length of the identifier; if diff --git a/include/hashtab.h b/include/hashtab.h index 6ff9c0c2101..4ee2858b2e4 100644 --- a/include/hashtab.h +++ b/include/hashtab.h @@ -1,4 +1,4 @@ -/* An expandable hash tables datatype. +/* An expandable hash tables datatype. Copyright (C) 1999-2026 Free Software Foundation, Inc. Contributed by Vladimir Makarov (vmakarov@cygnus.com). @@ -56,7 +56,7 @@ typedef int (*htab_eq) (const void *, const void *); /* Cleanup function called whenever a live element is removed from the hash table. */ typedef void (*htab_del) (void *); - + /* Function called by htab_traverse for each live element. The first arg is the slot of the element (which can be passed to htab_clear_slot if desired), the second arg is the auxiliary pointer handed to diff --git a/include/libcollector.h b/include/libcollector.h index 7bf3269095d..59db52657b2 100644 --- a/include/libcollector.h +++ b/include/libcollector.h @@ -75,7 +75,7 @@ extern "C" /* Define the macros that actually get inserted in the caller's code. */ #define collector_sample(x) (collector_sample ? collector_sample(x), 0 : 0) #define collector_pause() (collector_pause ? collector_pause(), 0 : 0) -#define collector_resume() (collector_resume ? collector_resume(),0 : 0 +#define collector_resume() (collector_resume ? collector_resume(),0 : 0 #define collector_thread_pause(tid) \ (collector_thread_pause ? collector_thread_pause(tid), 0 : 0) #define collector_thread_resume(tid) \ diff --git a/include/libiberty.h b/include/libiberty.h index bdb491b9b37..4ed783e6ef9 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -3,7 +3,7 @@ Copyright (C) 1997-2026 Free Software Foundation, Inc. Note - certain prototypes declared in this header file are for - functions whoes implementation copyright does not belong to the + functions whose implementation copyright does not belong to the FSF. Those prototypes are present in this file for reference purposes only and their presence in this file should not construed as an indication of ownership by the FSF of the implementation of @@ -499,7 +499,7 @@ extern struct pex_obj *pex_init (int flags, const char *pname, /* Append stdout to existing file instead of truncating it. */ #define PEX_STDOUT_APPEND 0x100 -/* Thes same as PEX_STDOUT_APPEND, but for STDERR. */ +/* The same as PEX_STDOUT_APPEND, but for STDERR. */ #define PEX_STDERR_APPEND 0x200 /* Execute one program. Returns NULL on success. On error returns an @@ -728,16 +728,21 @@ extern unsigned long int strtoul (const char *nptr, char **endptr, int base); #endif -#if defined(HAVE_LONG_LONG) && defined(HAVE_DECL_STRTOLL) && !HAVE_DECL_STRTOLL +/* hppa64-hp-hpux11.11 GCC bootstrap pass with this and + declare strto{u,}ll if at least C++11. */ +#if (defined(HAVE_LONG_LONG) \ + || (defined(__cplusplus) && __cplusplus >= 201103L)) +# if defined(HAVE_DECL_STRTOLL) && !HAVE_DECL_STRTOLL __extension__ extern long long int strtoll (const char *nptr, char **endptr, int base); -#endif +# endif -#if defined(HAVE_LONG_LONG) && defined(HAVE_DECL_STRTOULL) && !HAVE_DECL_STRTOULL +# if defined(HAVE_DECL_STRTOULL) && !HAVE_DECL_STRTOULL __extension__ extern unsigned long long int strtoull (const char *nptr, char **endptr, int base); +# endif #endif /* Set the title of a process */ diff --git a/include/longlong.h b/include/longlong.h index 2e50270d46b..5f44c1c6a01 100644 --- a/include/longlong.h +++ b/include/longlong.h @@ -422,7 +422,7 @@ extern UDItype __umulsidi3 (USItype, USItype); union {DItype __ll; \ struct {USItype __h, __l;} __i; \ } __x; \ - __x.__i.__h = n1; __x.__i.__l = n0; \ + __x.__i.__h = (n1); __x.__i.__l = (n0); \ __asm__ ("dr %0,%2" \ : "=r" (__x.__ll) \ : "0" (__x.__ll), "r" (d)); \ @@ -594,11 +594,7 @@ extern UDItype __umulsidi3 (USItype, USItype); #endif #ifdef __loongarch__ -# if W_TYPE_SIZE == 32 -# define count_leading_zeros(count, x) ((count) = __builtin_clz (x)) -# define count_trailing_zeros(count, x) ((count) = __builtin_ctz (x)) -# define COUNT_LEADING_ZEROS_0 32 -# elif W_TYPE_SIZE == 64 +# if W_TYPE_SIZE == 64 # define count_leading_zeros(count, x) ((count) = __builtin_clzll (x)) # define count_trailing_zeros(count, x) ((count) = __builtin_ctzll (x)) # define COUNT_LEADING_ZEROS_0 64 @@ -1065,6 +1061,20 @@ extern UDItype __umulsidi3 (USItype, USItype); #endif #if defined(__riscv) + +#ifdef __riscv_zbb +#if W_TYPE_SIZE == 32 +#define count_leading_zeros(COUNT, X) ((COUNT) = __builtin_clz (X)) +#define count_trailing_zeros(COUNT, X) ((COUNT) = __builtin_ctz (X)) +#define COUNT_LEADING_ZEROS_0 32 +#endif /* W_TYPE_SIZE == 32 */ +#if W_TYPE_SIZE == 64 +#define count_leading_zeros(COUNT, X) ((COUNT) = __builtin_clzll (X)) +#define count_trailing_zeros(COUNT, X) ((COUNT) = __builtin_ctzll (X)) +#define COUNT_LEADING_ZEROS_0 64 +#endif /* W_TYPE_SIZE == 64 */ +#endif /* __riscv_zbb */ + #ifdef __riscv_mul #define __umulsidi3(u,v) ((UDWtype)(UWtype)(u) * (UWtype)(v)) #define __muluw3(a, b) ((UWtype)(a) * (UWtype)(b)) @@ -1074,7 +1084,7 @@ extern UDItype __umulsidi3 (USItype, USItype); #elif __riscv_xlen == 64 #define MULUW3 "call __muldi3" #else -#error unsupport xlen +#error unsupported xlen #endif /* __riscv_xlen */ /* We rely on the fact that MULUW3 doesn't clobber the t-registers. It can get better register allocation result. */ @@ -1508,7 +1518,7 @@ extern UDItype __umulsidi3 (USItype, USItype); union {DItype __ll; \ struct {SItype __l, __h;} __i; \ } __xx; \ - __xx.__i.__h = n1; __xx.__i.__l = n0; \ + __xx.__i.__h = (n1); __xx.__i.__l = (n0); \ __asm__ ("ediv %3,%2,%0,%1" \ : "=g" (q), "=g" (r) \ : "g" (__xx.__ll), "g" (d)); \ @@ -1573,6 +1583,7 @@ extern UHItype __stormy16_count_leading_zeros (UHItype); for ((count) = 0, size = W_TYPE_SIZE; size; size -= 16) \ { \ UHItype c; \ + extern UHItype __clzhi2 (UHItype); \ \ c = __clzhi2 ((x) >> (size - 16)); \ (count) += c; \ diff --git a/include/partition.h b/include/partition.h index 45849cb604d..64cc55f39ed 100644 --- a/include/partition.h +++ b/include/partition.h @@ -56,7 +56,7 @@ struct partition_elem unsigned class_count; }; -typedef struct partition_def +typedef struct partition_def { /* The number of elements in this partition. */ int num_elements; diff --git a/include/plugin-api.h b/include/plugin-api.h index fec2e7f126f..60936228acd 100644 --- a/include/plugin-api.h +++ b/include/plugin-api.h @@ -37,7 +37,7 @@ #error cannot find uint64_t type #endif -/* Detect endianess based on gcc's (>=4.6.0) __BYTE_ORDER__ macro. */ +/* Detect endianness based on gcc's (>=4.6.0) __BYTE_ORDER__ macro. */ #if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \ defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_PDP_ENDIAN__) #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ @@ -64,7 +64,7 @@ #include #endif -/* Detect endianess based on __BYTE_ORDER. */ +/* Detect endianness based on __BYTE_ORDER. */ #ifdef __BYTE_ORDER #if __BYTE_ORDER == __LITTLE_ENDIAN #define PLUGIN_LITTLE_ENDIAN 1 @@ -72,7 +72,7 @@ #define PLUGIN_BIG_ENDIAN 1 #endif -/* Detect endianess based on _BYTE_ORDER. */ +/* Detect endianness based on _BYTE_ORDER. */ #elif defined _BYTE_ORDER #if _BYTE_ORDER == _LITTLE_ENDIAN #define PLUGIN_LITTLE_ENDIAN 1 @@ -160,7 +160,7 @@ struct ld_plugin_symbol char unused; char section_kind; #else -#error "Could not detect architecture endianess" +#error "Could not detect architecture endianness" #endif int visibility; uint64_t size; @@ -403,7 +403,7 @@ enum ld_plugin_status size_t* len); /* The linker's interface for specifying the desired order of sections. - The sections should be specifed using the array SECTION_LIST in the + The sections should be specified using the array SECTION_LIST in the order in which they should appear in the final layout. NUM_SECTIONS specifies the number of entries in each array. This should be invoked in the all_symbols_read handler. */ @@ -599,7 +599,7 @@ struct ld_plugin_tv ld_plugin_get_input_section_contents tv_get_input_section_contents; ld_plugin_update_section_order tv_update_section_order; ld_plugin_allow_section_ordering tv_allow_section_ordering; - ld_plugin_allow_unique_segment_for_sections tv_allow_unique_segment_for_sections; + ld_plugin_allow_unique_segment_for_sections tv_allow_unique_segment_for_sections; ld_plugin_unique_segment_for_sections tv_unique_segment_for_sections; ld_plugin_get_input_section_alignment tv_get_input_section_alignment; ld_plugin_get_input_section_size tv_get_input_section_size; diff --git a/include/safe-ctype.h b/include/safe-ctype.h index d5abf5128db..66de4329b21 100644 --- a/include/safe-ctype.h +++ b/include/safe-ctype.h @@ -112,7 +112,7 @@ extern const unsigned char _sch_tolower[256]; #define TOUPPER(c) _sch_toupper[(c) & 0xff] #define TOLOWER(c) _sch_tolower[(c) & 0xff] -/* Prevent the users of safe-ctype.h from accidently using the routines +/* Prevent the users of safe-ctype.h from accidentally using the routines from ctype.h. Initially, the approach was to produce an error when detecting that ctype.h has been included. But this was causing trouble as ctype.h might get indirectly included as a result of diff --git a/include/sort.h b/include/sort.h index 1062b889437..fca32b1a274 100644 --- a/include/sort.h +++ b/include/sort.h @@ -3,7 +3,7 @@ Contributed by Mark Mitchell . This file is part of GCC. - + GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) @@ -44,5 +44,5 @@ extern void sort_pointers (size_t, void **, void **); #endif /* SORT_H */ - - + + diff --git a/include/splay-tree.h b/include/splay-tree.h index 81e46525ed9..19890ade9eb 100644 --- a/include/splay-tree.h +++ b/include/splay-tree.h @@ -1,9 +1,9 @@ -/* A splay-tree datatype. +/* A splay-tree datatype. Copyright (C) 1998-2026 Free Software Foundation, Inc. Contributed by Mark Mitchell (mark@markmitchell.com). This file is part of GCC. - + GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) @@ -22,7 +22,7 @@ /* For an easily readable description of splay-trees, see: Lewis, Harry R. and Denenberg, Larry. Data Structures and Their - Algorithms. Harper-Collins, Inc. 1991. + Algorithms. Harper-Collins, Inc. 1991. The major feature of splay trees is that all basic tree operations are amortized O(log n) time for a tree with n nodes. */ @@ -105,7 +105,7 @@ struct splay_tree_s { /* The root of the tree. */ splay_tree_node root; - /* The comparision function. */ + /* The comparison function. */ splay_tree_compare_fn comp; /* The deallocate-key function. NULL if no cleanup is necessary. */ diff --git a/include/symcat.h b/include/symcat.h index c75fab29a07..203b341404d 100644 --- a/include/symcat.h +++ b/include/symcat.h @@ -11,7 +11,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ @@ -50,6 +50,6 @@ bar", "XSTRING(foo)", to yield "bar". Be aware that this only works for __STDC__, not for traditional C which will still resolve to "foo". */ -#define XSTRING(s) STRINGX(s) +#define XSTRING(s) STRINGX(s) #endif /* SYM_CAT_H */ diff --git a/include/vtv-change-permission.h b/include/vtv-change-permission.h index a267bd07276..1a971124f58 100644 --- a/include/vtv-change-permission.h +++ b/include/vtv-change-permission.h @@ -1,7 +1,7 @@ /* Copyright (C) 2013-2026 Free Software Foundation, Inc. - + This file is part of GCC. - + modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. @@ -45,7 +45,7 @@ extern void __VLTChangePermission (int); #ifdef BIG_PAGE_SIZE /* TODO - Replace '4096' below with correct big page size. */ #define VTV_PAGE_SIZE 4096 -#else +#else #if defined(__sun__) && defined(__svr4__) && defined(__sparc__) #define VTV_PAGE_SIZE 8192 #elif defined(__loongarch_lp64) diff --git a/include/xregex.h b/include/xregex.h index 4c5ef934556..b5de00af4bb 100644 --- a/include/xregex.h +++ b/include/xregex.h @@ -4,7 +4,7 @@ #ifndef _XREGEX_H #define _XREGEX_H 1 -# define regfree xregfree +# define regfree xregfree # define regexec xregexec # define regcomp xregcomp # define regerror xregerror -- 2.56.0