Bug in __sync_lock_release with 64 bit primitives

Bug #922474 reported by Ramana Radhakrishnan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GCC
Fix Released
High
Ramana Radhakrishnan
gcc-4.6 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

consider the following testcase.

long long AL[24];
void main(void)
{
 __sync_lock_release (AL+3);
}

ain:
       @ args = 0, pretend = 0, frame = 0
       @ frame_needed = 0, uses_anonymous_args = 0
       @ link register save eliminated.
       ldr r1, .L2
       mov r2, #0
       mov r3, #0
       dmb sy
       strd r2, [r1]
       bx lr
.L3:
       .align 2
.L2:

while this should instead be :

       dmb sy
.L2:
       ldrexd r0, r1, [ip]
       strexd r4, r2, r3, [ip]
       cmp r4, #0
       bne .L2
       ldmfd sp!, {r4}
       bx lr
.L5:

This was detected while reviewing an upstream patch to fix an issue with a testcase added as a part of the 64 bit sync primitives work that Linaro did.

Changed in gcc-linaro:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Ramana Radhakrishnan (ramana)
Revision history for this message
Asa Sandahl (asa-sandahl) wrote :

I have set this bug to Triaged because Ramana knows what introduced the bug and is working on a patch.

Importance is set to high because this is a case of wrong code generation.

Revision history for this message
Ramana Radhakrishnan (ramana) wrote :

Testing a patch.

Changed in gcc-linaro:
status: Triaged → In Progress
Changed in gcc-linaro:
status: In Progress → Fix Committed
milestone: none → 4.6-2012.03
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.6 - 4.6.3-1ubuntu2

---------------
gcc-4.6 (4.6.3-1ubuntu2) precise; urgency=low

  * Merge with Debian.

gcc-4.6 (4.6.3-1) unstable; urgency=low

  * GCC 4.6.3 release.

  [ Matthias Klose ]
  * Linaro only:
    Backport bug fixes (r106870, r106873) from the Linaro branch. LP: #922474.
  * Fix PR target/50946, taken from the trunk. Closes: #641849.

  [ Thorsten Glaser ]
  * Backport PR rtl-optimization/47612 from the trunk, apply for m68k only.
  * Don't set the bootstrap-lean target unconditionally.
 -- Matthias Klose <email address hidden> Thu, 01 Mar 2012 15:42:05 +0100

Changed in gcc-4.6 (Ubuntu):
status: New → Fix Released
Michael Hope (michaelh1)
Changed in gcc-linaro:
status: Fix Committed → Fix Released
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.