public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-7254] rs6000: Retry tbegin. instructions that can fail intermittently
@ 2022-02-15 22:53 Peter Bergner
  0 siblings, 0 replies; only message in thread
From: Peter Bergner @ 2022-02-15 22:53 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:3d8d8e34f796fefda53be9a6cec7c6c950856a14

commit r12-7254-g3d8d8e34f796fefda53be9a6cec7c6c950856a14
Author: Peter Bergner <bergner@linux.ibm.com>
Date:   Tue Feb 15 16:51:32 2022 -0600

    rs6000: Retry tbegin. instructions that can fail intermittently
    
    The HTM tbegin. instruction can fail intermittently due to many reasons.
    This can lead to htm-1.c FAILing from time to time.  The solution is to
    allow retrying the instruction a few times before aborting.
    
    2022-02-15  Peter Bergner  <bergner@linux.ibm.com>
    
    gcc/testsuite/
            * gcc.target/powerpc/htm-1.c: Retry intermittent failing tbegins.

Diff:
---
 gcc/testsuite/gcc.target/powerpc/htm-1.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.target/powerpc/htm-1.c b/gcc/testsuite/gcc.target/powerpc/htm-1.c
index f27e32ca281..399a7ec8812 100644
--- a/gcc/testsuite/gcc.target/powerpc/htm-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/htm-1.c
@@ -12,14 +12,21 @@ main (void)
 {
   long i;
   unsigned long mask = 0;
+  unsigned long retry_count = 0;
 
 repeat:
   if (__builtin_tbegin (0))
     {
       mask++;
+      retry_count = 0;
     }
   else
-    abort();
+    {
+      /* Retry a limited number of times before aborting.  */
+      if (retry_count++ < 10)
+	goto repeat;
+      abort ();
+    }
 
   if (mask == 1)
     {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-15 22:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15 22:53 [gcc r12-7254] rs6000: Retry tbegin. instructions that can fail intermittently Peter Bergner

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