aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPeter Bergner <bergner@linux.ibm.com>2022-02-15 16:51:32 -0600
committerPeter Bergner <bergner@linux.ibm.com>2022-02-15 16:53:07 -0600
commit3d8d8e34f796fefda53be9a6cec7c6c950856a14 (patch)
tree81a21c66bb24529eec3ac5c63d888db63d93db29 /gcc
parente15425e899e4a9eec768cf74aaf36cdbf1d29913 (diff)
downloadgcc-3d8d8e34f796fefda53be9a6cec7c6c950856a14.zip
gcc-3d8d8e34f796fefda53be9a6cec7c6c950856a14.tar.gz
gcc-3d8d8e34f796fefda53be9a6cec7c6c950856a14.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.target/powerpc/htm-1.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.target/powerpc/htm-1.c b/gcc/testsuite/gcc.target/powerpc/htm-1.c
index f27e32c..399a7ec 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)
{