From: Peter Bergner Date: Tue, 15 Feb 2022 22:51:32 +0000 (-0600) Subject: rs6000: Retry tbegin. instructions that can fail intermittently X-Git-Tag: basepoints/gcc-13~1059 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d8d8e34f796fefda53be9a6cec7c6c950856a14;p=thirdparty%2Fgcc.git 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 gcc/testsuite/ * gcc.target/powerpc/htm-1.c: Retry intermittent failing tbegins. --- diff --git a/gcc/testsuite/gcc.target/powerpc/htm-1.c b/gcc/testsuite/gcc.target/powerpc/htm-1.c index f27e32ca281a..399a7ec88123 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) {