]> git.ipfire.org Git - thirdparty/glibc.git/commit
Fix string/tst-xbzero-opt if build with gcc head.
authorStefan Liebler <stli@linux.ibm.com>
Thu, 26 Jul 2018 15:09:44 +0000 (17:09 +0200)
committerStefan Liebler <stli@linux.ibm.com>
Thu, 26 Jul 2018 15:09:44 +0000 (17:09 +0200)
commitc9dc4d5117afea7283d5fd80c80be8cc09cde84d
tree915d2f3ac4ab5e720455f777a5fe378835095421
parentcfba5dbb10cc3abde632b46c60c10b2843917035
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.
ChangeLog
string/tst-xbzero-opt.c