From 54aafa800a0346268801dfd5fef65fa42962cd6e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 20 Sep 2024 19:24:39 -0700 Subject: [PATCH] sigsegv-tests: port to GCC 14 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit GCC 14 on x86-64 with -O2 apparently outsmarts our test for null pointer dereference, and this is something the C standard allows. Fix the test by putting ‘volatile’ at the right place. * tests/test-sigsegv-catch-stackoverflow2.c (null_pointer): Make it a volatile pointer, not a pointer to volatile. Also, rename from null_pointer_to_volatile_int; use changed. --- ChangeLog | 10 ++++++++++ tests/test-sigsegv-catch-stackoverflow2.c | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ea766c654..fbc0c4f1da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2024-09-20 Paul Eggert + + sigsegv-tests: port to GCC 14 + GCC 14 on x86-64 with -O2 apparently outsmarts our test for null + pointer dereference, and this is something the C standard allows. + Fix the test by putting ‘volatile’ at the right place. + * tests/test-sigsegv-catch-stackoverflow2.c (null_pointer): + Make it a volatile pointer, not a pointer to volatile. + Also, rename from null_pointer_to_volatile_int; use changed. + 2024-09-20 Bruno Haible jit/cache tests: Fix crash with clang's UBSAN + ASAN. diff --git a/tests/test-sigsegv-catch-stackoverflow2.c b/tests/test-sigsegv-catch-stackoverflow2.c index 60f7eb0cfb..133b616af2 100644 --- a/tests/test-sigsegv-catch-stackoverflow2.c +++ b/tests/test-sigsegv-catch-stackoverflow2.c @@ -59,7 +59,7 @@ static sigset_t mainsigset; static volatile int pass = 0; static uintptr_t page; -static volatile int *null_pointer_to_volatile_int /* = NULL */; +static int *volatile null_pointer /* = NULL */; static void stackoverflow_handler_continuation (void *arg1, void *arg2, void *arg3) @@ -193,7 +193,7 @@ main () *(volatile int *) (page + 0x678) = 42; break; case 3: - *null_pointer_to_volatile_int = 42; + *null_pointer = 42; break; case 4: break; -- 2.39.5