* Development open for glibc 2.33
@ 2020-08-05 3:46 Carlos O'Donell via Libc-alpha
2020-08-05 7:06 ` Merged Gnulib changes into glibc Paul Eggert
0 siblings, 1 reply; 2+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2020-08-05 3:46 UTC (permalink / raw)
To: libc-alpha
The release branch for glibc 2.32 has been created.
The development branch is open for glibc 2.33.
Please feel free to start development again!
Happy hacking :-)
--
Cheers,
Carlos.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Merged Gnulib changes into glibc
2020-08-05 3:46 Development open for glibc 2.33 Carlos O'Donell via Libc-alpha
@ 2020-08-05 7:06 ` Paul Eggert
0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggert @ 2020-08-05 7:06 UTC (permalink / raw)
To: libc-alpha
[-- Attachment #1: Type: text/plain, Size: 535 bytes --]
On 8/4/20 8:46 PM, Carlos O'Donell via Libc-alpha wrote:
> The development branch is open for glibc 2.33.
Thanks for doing the release management, Carlos.
To help things get started on 2.33, I merged the attached minor patches from
Gnulib, so that the affected files are now identical again between the two
packages. I think the last patch is the only one that might affect glibc in
current practice, as it fixes a bug involving more than 16 epsilon-reachable
subexpressions (I don't have a test case but one would be welcome).
[-- Attachment #2: 0001-Sync-intprops.h-from-Gnulib.patch --]
[-- Type: text/x-patch, Size: 1689 bytes --]
From 7279f0a282283db04352e247c3bdb39ee03d10f6 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 4 Aug 2020 22:58:58 -0700
Subject: [PATCH 1/5] Sync intprops.h from Gnulib
* include/intprops.h: Sync from Gnulib. This improves
performance of INT_MULTIPLY_WRAPV on recent GCC, which affects
glibc only in the support library.
---
include/intprops.h | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/include/intprops.h b/include/intprops.h
index 0c379a8c5b..6de65b067d 100644
--- a/include/intprops.h
+++ b/include/intprops.h
@@ -373,12 +373,17 @@
_GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW)
#endif
#if _GL_HAS_BUILTIN_MUL_OVERFLOW
-/* Work around GCC bug 91450. */
-# define INT_MULTIPLY_WRAPV(a, b, r) \
- ((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && EXPR_SIGNED (a) && EXPR_SIGNED (b) \
- && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1)) \
- ? ((void) __builtin_mul_overflow (a, b, r), 1) \
- : __builtin_mul_overflow (a, b, r))
+# if (9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
+ || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__))
+# define INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r)
+# else
+ /* Work around GCC bug 91450. */
+# define INT_MULTIPLY_WRAPV(a, b, r) \
+ ((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && EXPR_SIGNED (a) && EXPR_SIGNED (b) \
+ && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1)) \
+ ? ((void) __builtin_mul_overflow (a, b, r), 1) \
+ : __builtin_mul_overflow (a, b, r))
+# endif
#else
# define INT_MULTIPLY_WRAPV(a, b, r) \
_GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW)
--
2.25.4
[-- Attachment #3: 0002-Sync-mktime.c-from-Gnulib.patch --]
[-- Type: text/x-patch, Size: 1351 bytes --]
From db10cd9e62a29d6dccf55bbce367dab5a72220bb Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 4 Aug 2020 23:15:31 -0700
Subject: [PATCH 2/5] Sync mktime.c from Gnulib
* time/mktime.c: Sync from Gnulib.
This micro-optimizes three division-related computations.
---
time/mktime.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/time/mktime.c b/time/mktime.c
index 63c82fc6a9..c8735164f6 100644
--- a/time/mktime.c
+++ b/time/mktime.c
@@ -141,7 +141,7 @@ shr (long_int a, int b)
long_int one = 1;
return (-one >> 1 == -1
? a >> b
- : a / (one << b) - (a % (one << b) < 0));
+ : (a + (a < 0)) / (one << b) - (a < 0));
}
/* Bounds for the intersection of __time64_t and long_int. */
@@ -211,8 +211,8 @@ ydhms_diff (long_int year1, long_int yday1, int hour1, int min1, int sec1,
Take care to avoid integer overflow here. */
int a4 = shr (year1, 2) + shr (TM_YEAR_BASE, 2) - ! (year1 & 3);
int b4 = shr (year0, 2) + shr (TM_YEAR_BASE, 2) - ! (year0 & 3);
- int a100 = a4 / 25 - (a4 % 25 < 0);
- int b100 = b4 / 25 - (b4 % 25 < 0);
+ int a100 = (a4 + (a4 < 0)) / 25 - (a4 < 0);
+ int b100 = (b4 + (b4 < 0)) / 25 - (b4 < 0);
int a400 = shr (a100, 2);
int b400 = shr (b100, 2);
int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400);
--
2.25.4
[-- Attachment #4: 0003-Sync-regex.h-from-Gnulib.patch --]
[-- Type: text/x-patch, Size: 1022 bytes --]
From 6aa1160d16b0886af125a7e7883aab2203ed156d Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 4 Aug 2020 23:24:03 -0700
Subject: [PATCH 3/5] Sync regex.h from Gnulib
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* posix/regex.h: Remove an ‘#ifndef _CRAY’ that hasn’t been needed
for years in Gnulib (and was needed only because of Gnulib).
---
posix/regex.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/posix/regex.h b/posix/regex.h
index 87cce7f5cb..5fe41c8685 100644
--- a/posix/regex.h
+++ b/posix/regex.h
@@ -600,11 +600,9 @@ extern void re_set_registers (struct re_pattern_buffer *__buffer,
#endif /* Use GNU */
#if defined _REGEX_RE_COMP || (defined _LIBC && defined __USE_MISC)
-# ifndef _CRAY
/* 4.2 bsd compatibility. */
extern char *re_comp (const char *);
extern int re_exec (const char *);
-# endif
#endif
/* For plain 'restrict', use glibc's __restrict if defined.
--
2.25.4
[-- Attachment #5: 0004-Copy-regex-BITSET_WORD_BITS-porting-from-Gnulib.patch --]
[-- Type: text/x-patch, Size: 3994 bytes --]
From 70c609f30311a4bcd6289b616adaaad4b42ed4a8 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 4 Aug 2020 23:39:20 -0700
Subject: [PATCH 4/5] Copy regex BITSET_WORD_BITS porting from Gnulib
* posix/regex.c (__STDC_WANT_IEC_60559_BFP_EXT__):
Define, for ULONG_WIDTH. This syncs regex.c from Gnujlib.
* posix/regex_internal.h (ULONG_WIDTH):
Use a more-portable fallback, from Gnulib.
(BITSET_WORD_BITS): Now defined in terms of ULONG_WIDTH.
---
posix/regex.c | 2 ++
posix/regex_internal.h | 50 +++++++++++++++++-------------------------
2 files changed, 22 insertions(+), 30 deletions(-)
diff --git a/posix/regex.c b/posix/regex.c
index 815e2ec769..991eedc826 100644
--- a/posix/regex.c
+++ b/posix/regex.c
@@ -17,6 +17,8 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#define __STDC_WANT_IEC_60559_BFP_EXT__
+
#ifndef _LIBC
# include <libc-config.h>
diff --git a/posix/regex_internal.h b/posix/regex_internal.h
index 6f761c6ed6..e9aa74bf33 100644
--- a/posix/regex_internal.h
+++ b/posix/regex_internal.h
@@ -141,6 +141,24 @@
#ifndef SSIZE_MAX
# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
#endif
+#ifndef ULONG_WIDTH
+# define ULONG_WIDTH REGEX_UINTEGER_WIDTH (ULONG_MAX)
+/* The number of usable bits in an unsigned integer type with maximum
+ value MAX, as an int expression suitable in #if. Cover all known
+ practical hosts. This implementation exploits the fact that MAX is
+ 1 less than a power of 2, and merely counts the number of 1 bits in
+ MAX; "COBn" means "count the number of 1 bits in the low-order n bits". */
+# define REGEX_UINTEGER_WIDTH(max) REGEX_COB128 (max)
+# define REGEX_COB128(n) (REGEX_COB64 ((n) >> 31 >> 31 >> 2) + REGEX_COB64 (n))
+# define REGEX_COB64(n) (REGEX_COB32 ((n) >> 31 >> 1) + REGEX_COB32 (n))
+# define REGEX_COB32(n) (REGEX_COB16 ((n) >> 16) + REGEX_COB16 (n))
+# define REGEX_COB16(n) (REGEX_COB8 ((n) >> 8) + REGEX_COB8 (n))
+# define REGEX_COB8(n) (REGEX_COB4 ((n) >> 4) + REGEX_COB4 (n))
+# define REGEX_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + ((n) & 1))
+# if ULONG_MAX / 2 + 1 != 1ul << (ULONG_WIDTH - 1)
+# error "ULONG_MAX out of range"
+# endif
+#endif
/* The type of indexes into strings. This is signed, not size_t,
since the API requires indexes to fit in regoff_t anyway, and using
@@ -164,36 +182,8 @@ typedef __re_size_t re_hashval_t;
typedef unsigned long int bitset_word_t;
/* All bits set in a bitset_word_t. */
#define BITSET_WORD_MAX ULONG_MAX
-
-/* Number of bits in a bitset_word_t. For portability to hosts with
- padding bits, do not use '(sizeof (bitset_word_t) * CHAR_BIT)';
- instead, deduce it directly from BITSET_WORD_MAX. Avoid
- greater-than-32-bit integers and unconditional shifts by more than
- 31 bits, as they're not portable. */
-#if BITSET_WORD_MAX == 0xffffffffUL
-# define BITSET_WORD_BITS 32
-#elif BITSET_WORD_MAX >> 31 >> 4 == 1
-# define BITSET_WORD_BITS 36
-#elif BITSET_WORD_MAX >> 31 >> 16 == 1
-# define BITSET_WORD_BITS 48
-#elif BITSET_WORD_MAX >> 31 >> 28 == 1
-# define BITSET_WORD_BITS 60
-#elif BITSET_WORD_MAX >> 31 >> 31 >> 1 == 1
-# define BITSET_WORD_BITS 64
-#elif BITSET_WORD_MAX >> 31 >> 31 >> 9 == 1
-# define BITSET_WORD_BITS 72
-#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 3 == 1
-# define BITSET_WORD_BITS 128
-#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 7 == 1
-# define BITSET_WORD_BITS 256
-#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 7 > 1
-# define BITSET_WORD_BITS 257 /* any value > SBC_MAX will do here */
-# if BITSET_WORD_BITS <= SBC_MAX
-# error "Invalid SBC_MAX"
-# endif
-#else
-# error "Add case for new bitset_word_t size"
-#endif
+/* Number of bits in a bitset_word_t. */
+#define BITSET_WORD_BITS ULONG_WIDTH
/* Number of bitset_word_t values in a bitset_t. */
#define BITSET_WORDS ((SBC_MAX + BITSET_WORD_BITS - 1) / BITSET_WORD_BITS)
--
2.25.4
[-- Attachment #6: 0005-Copy-regex_internal.h-from-Gnulib.patch --]
[-- Type: text/x-patch, Size: 1154 bytes --]
From 2cc478ed1be82711a6cac15aae683530b2e6732b Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 4 Aug 2020 23:45:27 -0700
Subject: [PATCH 5/5] Copy regex_internal.h from Gnulib
Sync this file from Gnulib, thus incorporating the following
fix for a bug with regexps with 16 or more subexpressions:
* posix/regex_internal.h (struct re_backref_cache_entry):
Use bitset_word_t as the type of eps_reachable_subexps_map,
instead of unsigned short int. This fixes a bug I introduced
to glibc in 2005-09-28T17:33:18Z!drepper@redhat.com (glibc commit
2c05d33f90861d074dc12808dafbde30f487b1a0, BZ #1302).
Remove unused member 'unused'.
---
posix/regex_internal.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/posix/regex_internal.h b/posix/regex_internal.h
index e9aa74bf33..8c42586c42 100644
--- a/posix/regex_internal.h
+++ b/posix/regex_internal.h
@@ -591,9 +591,8 @@ struct re_backref_cache_entry
Idx str_idx;
Idx subexp_from;
Idx subexp_to;
+ bitset_word_t eps_reachable_subexps_map;
char more;
- char unused;
- unsigned short int eps_reachable_subexps_map;
};
typedef struct
--
2.25.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-05 7:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-05 3:46 Development open for glibc 2.33 Carlos O'Donell via Libc-alpha
2020-08-05 7:06 ` Merged Gnulib changes into glibc Paul Eggert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).