http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57643

            Bug ID: 57643
           Summary: libitm.c/reentrant.c hangs on POWER8 with HTM
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libitm
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bergner at gcc dot gnu.org

The libitm.c/reentrant.c test case hangs on POWER8 hardware with HTM.  The
symptoms I'm seeing are my tbegin. instruction succeeds, but we fail the test
(meaning someone has the write lock) at beginend.cc:200:

    if (unlikely(serial_lock.is_write_locked()))
      htm_abort();

...so we abort the transaction.  The failure is not persistent, so we do
not break out of the loop due to:

    if (!htm_abort_should_retry(ret))
      break;

We then fall into the following code, where we hang trying to get the
read lock:

    serial_lock.read_lock(tx);

If I hack the call to htm_abort_should_retry(ret) so that we break of of the
loop and fallback to SW TM, then the test case executes correctly.  Andreas
Krebbel said this fails on S390 as well.  Andreas Kleen said this works on X86
with RTM.  It's unknown whether on X86 whether its hw txn fails or succeeds or
whether if it does fail over to sw txn, whether it skips the code we're hanging
in.

Reply via email to