public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/google/grte/v5-2.27/master] More aggressively prevent a buffer from being optimized out
@ 2021-07-15 19:42 Shu-Chun Weng
  0 siblings, 0 replies; 2+ messages in thread
From: Shu-Chun Weng @ 2021-07-15 19:42 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7903140dcc2b36c4eadae7132fb51a4463fd134e

commit 7903140dcc2b36c4eadae7132fb51a4463fd134e
Author: Shu-Chun Weng <scw@google.com>
Date:   Mon May 3 16:12:44 2021 -0700

    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.

Diff:
---
 string/tst-xbzero-opt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/string/tst-xbzero-opt.c b/string/tst-xbzero-opt.c
index e9c411b2ef..4f16c4d678 100644
--- a/string/tst-xbzero-opt.c
+++ b/string/tst-xbzero-opt.c
@@ -119,17 +119,17 @@ static void
 setup_no_clear (void)
 {
   unsigned char buf[TEST_BUFFER_SIZE];
-  prepare_test_buffer (buf);
   vol_glob = buf;
+  prepare_test_buffer (buf);
 }
 
 static void
 setup_ordinary_clear (void)
 {
   unsigned char buf[TEST_BUFFER_SIZE];
+  vol_glob = buf;
   prepare_test_buffer (buf);
   memset (buf, 0, TEST_BUFFER_SIZE);
-  vol_glob = buf;
 }
 
 static void


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [glibc/google/grte/v5-2.27/master] More aggressively prevent a buffer from being optimized out
@ 2021-08-28  0:38 Fangrui Song
  0 siblings, 0 replies; 2+ messages in thread
From: Fangrui Song @ 2021-08-28  0:38 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=df64d523104d05a17c9ef66345077154588a5424

commit df64d523104d05a17c9ef66345077154588a5424
Author: Shu-Chun Weng <scw@google.com>
Date:   Mon May 3 16:12:44 2021 -0700

    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.

Diff:
---
 string/tst-xbzero-opt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/string/tst-xbzero-opt.c b/string/tst-xbzero-opt.c
index e9c411b2ef..4f16c4d678 100644
--- a/string/tst-xbzero-opt.c
+++ b/string/tst-xbzero-opt.c
@@ -119,17 +119,17 @@ static void
 setup_no_clear (void)
 {
   unsigned char buf[TEST_BUFFER_SIZE];
-  prepare_test_buffer (buf);
   vol_glob = buf;
+  prepare_test_buffer (buf);
 }
 
 static void
 setup_ordinary_clear (void)
 {
   unsigned char buf[TEST_BUFFER_SIZE];
+  vol_glob = buf;
   prepare_test_buffer (buf);
   memset (buf, 0, TEST_BUFFER_SIZE);
-  vol_glob = buf;
 }
 
 static void


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-28  0:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 19:42 [glibc/google/grte/v5-2.27/master] More aggressively prevent a buffer from being optimized out Shu-Chun Weng
2021-08-28  0:38 Fangrui Song

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).