HTM builtins aren't treated as compiler barriers on powerpc

Bug #1517093 reported by bugproxy
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-4.8 (Ubuntu)
Fix Released
Medium
Unassigned
Trusty
Fix Released
Medium
Unassigned
gcc-5 (Ubuntu)
Fix Released
Medium
Taco Screen team

Bug Description

---Problem Description---
HTM builtins aren't treated as compiler barriers on powerpc

Contact Information = <email address hidden>

---Steps to Reproduce---

 This bug is a mirror of the (fixed) upstream FSF bugzilla https://gcc.gnu.org/PR67281
All relevant information regarding the bug and the fix can be found there. This bugzilla is to track backporting of the fix to the GCC 4.8, 4.9 and 5 based compilers.

Userspace tool common name: GCC
Userspace rpm: gcc-4.8, gcc-4.9 and gcc-5

== Comment: #1
The fix for the FSF GCC 5 branch was committed with:

r228846 | bergner | 2015-10-15 11:38:47 -0500 (Thu, 15 Oct 2015) | 16 lines

        Backport from mainline
        2015-10-14 Peter Bergner <email address hidden>
                            Torvald Riegel <email address hidden>

        PR target/67281
        * config/rs6000/htm.md (UNSPEC_HTM_FENCE): New.
        (tabort, tabort<wd>c, tabort<wd>ci, tbegin, tcheck, tend,
        trechkpt, treclaim, tsr, ttest): Rename define_insns from this...
        (*tabort, *tabort<wd>c, *tabort<wd>ci, *tbegin, *tcheck, *tend,
        *trechkpt, *treclaim, *tsr, *ttest): ...to this. Add memory barrier.
        (tabort, tabort<wd>c, tabort<wd>ci, tbegin, tcheck, tend,
        trechkpt, treclaim, tsr, ttest): New define_expands.
        * config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Define
        __TM_FENCE__ for htm.
        * doc/extend.texi: Update documentation for htm builtins.

== Comment: #2
The fix for the FSF GCC 4.9 branch was committed with:

r228847 | bergner | 2015-10-15 11:40:14 -0500 (Thu, 15 Oct 2015) | 16 lines

        Backport from mainline
        2015-10-14 Peter Bergner <email address hidden>
                            Torvald Riegel <email address hidden>

        PR target/67281
        * config/rs6000/htm.md (UNSPEC_HTM_FENCE): New.
        (tabort, tabort<wd>c, tabort<wd>ci, tbegin, tcheck, tend,
        trechkpt, treclaim, tsr, ttest): Rename define_insns from this...
        (*tabort, *tabort<wd>c, *tabort<wd>ci, *tbegin, *tcheck, *tend,
        *trechkpt, *treclaim, *tsr, *ttest): ...to this. Add memory barrier.
        (tabort, tabort<wd>c, tabort<wd>ci, tbegin, tcheck, tend,
        trechkpt, treclaim, tsr, ttest): New define_expands.
        * config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Define
        __TM_FENCE__ for htm.
        * doc/extend.texi: Update documentation for htm builtins.

== Comment: #3
Since the FSF 4.8 branch is closed, here is a backport of the fix along with another
simple HTM wrong code bug to GCC 4.8.

        Backport from mainline
        2015-10-14 Peter Bergner <email address hidden>
                            Torvald Riegel <email address hidden>

        PR target/67281
        * config/rs6000/htm.md (UNSPEC_HTM_FENCE): New.
        (tabort, tabort<wd>c, tabort<wd>ci, tbegin, tcheck, tend,
        trechkpt, treclaim, tsr, ttest): Rename define_insns from this...
        (*tabort, *tabort<wd>c, *tabort<wd>ci, *tbegin, *tcheck, *tend,
        *trechkpt, *treclaim, *tsr, *ttest): ...to this. Add memory barrier.
        (tabort, tabort<wd>c, tabort<wd>ci, tbegin, tcheck, tend,
        trechkpt, treclaim, tsr, ttest): New define_expands.
        * config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Define
        __TM_FENCE__ for htm.
        * doc/extend.texi: Update documentation for htm builtins.

        Backport from mainline:
        2015-08-03 Peter Bergner <email address hidden>

        * config/rs6000/htm.md (tabort.): Restrict the source operand to
        using a base register.

Acceptance creterium: No regressions in the testsuite, and the new test passes.

Revision history for this message
bugproxy (bugproxy) wrote : Backported fix for GCC 4.8

Default Comment by Bridge

tags: added: architecture-ppc64le bugnameltc-133232 severity-medium targetmilestone-inin---
Changed in ubuntu:
assignee: nobody → Taco Screen team (taco-screen-team)
Kevin W. Rudd (kevinr)
affects: ubuntu → gcc-defaults (Ubuntu)
Revision history for this message
Steve Langasek (vorlon) wrote :

The gcc-5 package in xenial is at r229478, so this fix is already included there.

For toolchain versions in previous releases, the bug is still present. However, as you have marked this bug as 'medium' severity, it does not meet the requirements for a stable release update - particularly for the toolchain, for which SRUs must meet a high standard of regression testing. So we do not intend to fix this for 14.04.

affects: gcc-defaults (Ubuntu) → gcc-5 (Ubuntu)
Changed in gcc-5 (Ubuntu):
importance: Undecided → Medium
status: New → Fix Released
Matthias Klose (doko)
no longer affects: gcc-5 (Ubuntu Trusty)
description: updated
Revision history for this message
Matthias Klose (doko) wrote :

we would need a backport to 4.8.4. Not planning to update to 4.8.5 anymore.

Changed in gcc-4.8 (Ubuntu Trusty):
status: New → Incomplete
Revision history for this message
Matthias Klose (doko) wrote :

this needs PR64579 from 4.8.5.

Changed in gcc-4.8 (Ubuntu Trusty):
status: Incomplete → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.8 - 4.8.5-2ubuntu1

---------------
gcc-4.8 (4.8.5-2ubuntu1) xenial; urgency=medium

  * Merge with Debian; remaining changes:
    - Build from the upstream source.

gcc-4.8 (4.8.5-2) unstable; urgency=medium

  * Update the Linaro support to the 4.8-2015.07 release.
  * Adjust setting DH_COMPAT for dh_movefiles with updated debhelper supporting
    globbing of arguments. Closes: #800248.
  * Fix PR libstdc++/56158, taken from the trunk.
    Addresses: #804521. LP: #1514309.
  * Backport fixes to allow building with cloog-0.18.4 and isl-0.15.
  * Backport PR target/67281 from the trunk (HTM fixes). LP: #1517093.
  * Fix auto-loading of gdb pretty printers. LP: #1446828.

 -- Matthias Klose <email address hidden> Wed, 18 Nov 2015 19:57:42 +0100

Changed in gcc-4.8 (Ubuntu):
status: New → Fix Released
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2015-12-15 17:58 EDT-------
*** Bug 131903 has been marked as a duplicate of this bug. ***

Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello bugproxy, or anyone else affected,

Accepted gcc-4.8 into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gcc-4.8/4.8.4-2ubuntu1~14.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in gcc-4.8 (Ubuntu Trusty):
status: Confirmed → Fix Committed
tags: added: verification-needed
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2016-01-27 14:37 EDT-------
I verified that GCC 4.8.4-2ubuntu1~14.04.1 appears to fix the problem, meaning the test case that showed the bad asm scheduling doesn't show it anymore and the loads are not scheduled above the .tbegin instruction. Closing.

tags: added: targetmilestone-inin14041
removed: targetmilestone-inin---
Matthias Klose (doko)
tags: added: verification-done
removed: verification-needed
Mathew Hodson (mhodson)
Changed in gcc-4.8 (Ubuntu):
importance: Undecided → Medium
Changed in gcc-4.8 (Ubuntu Trusty):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.8 - 4.8.4-2ubuntu1~14.04.1

---------------
gcc-4.8 (4.8.4-2ubuntu1~14.04.1) trusty-proposed; urgency=medium

  * SRU:
  * Fix auto-loading of gdb pretty printers. LP: #1446828.
  * Fix PR libstdc++/56158, taken from the trunk.
    Addresses: #804521. LP: #1514309.
  * Backport PR target/64579 and PR target/67281 from the trunk (HTM fixes).
    LP: #1517093.

 -- Matthias Klose <email address hidden> Wed, 18 Nov 2015 17:48:36 +0100

Changed in gcc-4.8 (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for gcc-4.8 has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.