]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
s390: fix htm-builtins test cases
authorJuergen Christ <jchrist@linux.ibm.com>
Wed, 25 Oct 2023 12:57:03 +0000 (14:57 +0200)
committerJuergen Christ <jchrist@linux.ibm.com>
Thu, 14 Mar 2024 13:06:56 +0000 (14:06 +0100)
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 <jchrist@linux.ibm.com>
gcc/testsuite/gcc.target/s390/htm-builtins-1.c
gcc/testsuite/gcc.target/s390/htm-builtins-2.c

index ff43be9fe736e27024e406ab852ee960411c4e33..4f95bf3accaac2c7660e7129201eb268a2b24c4b 100644 (file)
@@ -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 --------------------- */
 
index bb9d346ea560a73ff8bb1c324295064814b0a595..2e838caacc8c20cc3f9aa2270f3038e7a0f0dcfb 100644 (file)
@@ -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 --------------------- */