This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.27.9000-646-gc9dc4d5


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  c9dc4d5117afea7283d5fd80c80be8cc09cde84d (commit)
      from  cfba5dbb10cc3abde632b46c60c10b2843917035 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c9dc4d5117afea7283d5fd80c80be8cc09cde84d

commit c9dc4d5117afea7283d5fd80c80be8cc09cde84d
Author: Stefan Liebler <stli@linux.ibm.com>
Date:   Thu Jul 26 17:09:44 2018 +0200

    Fix string/tst-xbzero-opt if build with gcc head.
    
    On s390x, the test string/tst-xbzero-opt is failing if build with gcc head:
    FAIL: no clear/prepare: expected 32 got 0
    FAIL: no clear/test: expected some got 0
    FAIL: ordinary clear/prepare: expected 32 got 0
    INFO: ordinary clear/test: found 0 patterns (memset not eliminated)
    PASS: explicit clear/prepare: expected 32 got 32
    PASS: explicit clear/test: expected 0 got 0
    
    In setup_no_clear / setup_ordinary_clear, GCC is omitting the memcpy loop
    in prepare_test_buffer. Thus count_test_patterns does not find any of the
    test_pattern.
    
    This patch calls use_test_buffer in order to force the compiler to really copy
    the pattern to buf.
    
    ChangeLog:
    
    	* string/tst-xbzero-opt.c (use_test_buffer): New function.
    	(prepare_test_buffer): Call use_test_buffer as compiler barrier.

diff --git a/ChangeLog b/ChangeLog
index d88a798..3e25bd7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-07-26  Stefan Liebler  <stli@linux.ibm.com>
+
+	* string/tst-xbzero-opt.c (use_test_buffer): New function.
+	(prepare_test_buffer): Call use_test_buffer as compiler barrier.
+
 2018-07-26  Florian Weimer  <fweimer@redhat.com>
 
 	* htl/lockfile.c (flockfile, funlockfile, ftrylockfile): Use weak
diff --git a/string/tst-xbzero-opt.c b/string/tst-xbzero-opt.c
index aab4a7f..898345b 100644
--- a/string/tst-xbzero-opt.c
+++ b/string/tst-xbzero-opt.c
@@ -97,6 +97,17 @@ static const unsigned char test_pattern[16] =
 
 static ucontext_t uc_main, uc_co;
 
+static __attribute__ ((noinline, noclone)) int
+use_test_buffer (unsigned char *buf)
+{
+  unsigned int sum = 0;
+
+  for (unsigned int i = 0; i < PATTERN_REPS; i++)
+    sum += buf[i * PATTERN_SIZE];
+
+  return (sum == 2 * PATTERN_REPS) ? 0 : 1;
+}
+
 /* Always check the test buffer immediately after filling it; this
    makes externally visible side effects depend on the buffer existing
    and having been filled in.  */
@@ -116,6 +127,10 @@ prepare_test_buffer (unsigned char *buf)
 
   if (swapcontext (&uc_co, &uc_main))
     abort ();
+
+  /* Force the compiler to really copy the pattern to buf.  */
+  if (use_test_buffer (buf))
+    abort ();
 }
 
 static void

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog               |    5 +++++
 string/tst-xbzero-opt.c |   15 +++++++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]