mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-09 23:00:07 +00:00
More aggressively prevent a buffer from being optimized out
The volatile global variable was first introduced in e86f9654c. I have noticed the compiler still optimizing the buffer out on AArch64 presumably because the assignment is after all other observable behaviors so it's still valid to eliminate it.
This commit is contained in:
parent
a21d58a0dc
commit
df64d52310
@ -119,17 +119,17 @@ static void
|
|||||||
setup_no_clear (void)
|
setup_no_clear (void)
|
||||||
{
|
{
|
||||||
unsigned char buf[TEST_BUFFER_SIZE];
|
unsigned char buf[TEST_BUFFER_SIZE];
|
||||||
prepare_test_buffer (buf);
|
|
||||||
vol_glob = buf;
|
vol_glob = buf;
|
||||||
|
prepare_test_buffer (buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setup_ordinary_clear (void)
|
setup_ordinary_clear (void)
|
||||||
{
|
{
|
||||||
unsigned char buf[TEST_BUFFER_SIZE];
|
unsigned char buf[TEST_BUFFER_SIZE];
|
||||||
|
vol_glob = buf;
|
||||||
prepare_test_buffer (buf);
|
prepare_test_buffer (buf);
|
||||||
memset (buf, 0, TEST_BUFFER_SIZE);
|
memset (buf, 0, TEST_BUFFER_SIZE);
|
||||||
vol_glob = buf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user