https://gcc.gnu.org/g:075104eef6d0ff215c394b6eaadcb525fa7c4975

commit r14-9468-g075104eef6d0ff215c394b6eaadcb525fa7c4975
Author: Juergen Christ <jchr...@linux.ibm.com>
Date:   Wed Oct 25 14:57:03 2023 +0200

    s390: fix htm-builtins test cases
    
    Transactional and non-transactional stores to the same cache line cause
    transactions to abort on newer generations.  Add sufficient padding to make
    sure another cache line is used.
    
    Tested on s390.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/s390/htm-builtins-1.c: Fix.
            * gcc.target/s390/htm-builtins-2.c: Fix.
    
    Signed-off-by: Juergen Christ <jchr...@linux.ibm.com>

Diff:
---
 gcc/testsuite/gcc.target/s390/htm-builtins-1.c | 4 +++-
 gcc/testsuite/gcc.target/s390/htm-builtins-2.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.target/s390/htm-builtins-1.c 
b/gcc/testsuite/gcc.target/s390/htm-builtins-1.c
index ff43be9fe73..4f95bf3acca 100644
--- a/gcc/testsuite/gcc.target/s390/htm-builtins-1.c
+++ b/gcc/testsuite/gcc.target/s390/htm-builtins-1.c
@@ -53,9 +53,11 @@ __attribute__ ((aligned(256))) struct
 __attribute__ ((aligned(256))) struct
 {
   volatile uint64_t c1;
+  char pad1[256 - sizeof(uint64_t)];
   volatile uint64_t c2;
+  char pad2[256 - sizeof(uint64_t)];
   volatile uint64_t c3;
-} counters = { 0, 0, 0 };
+} counters = { 0 };
 
 /* ---------------------------- local helper functions --------------------- */
 
diff --git a/gcc/testsuite/gcc.target/s390/htm-builtins-2.c 
b/gcc/testsuite/gcc.target/s390/htm-builtins-2.c
index bb9d346ea56..2e838caacc8 100644
--- a/gcc/testsuite/gcc.target/s390/htm-builtins-2.c
+++ b/gcc/testsuite/gcc.target/s390/htm-builtins-2.c
@@ -94,9 +94,11 @@ float global_float_3 = 0.0;
 __attribute__ ((aligned(256))) struct
 {
   volatile uint64_t c1;
+  char pad1[256 - sizeof(uint64_t)];
   volatile uint64_t c2;
+  char pad2[256 - sizeof(uint64_t)];
   volatile uint64_t c3;
-} counters = { 0, 0, 0 };
+} counters = { 0 };
 
 /* ---------------------------- local helper functions --------------------- */

Reply via email to