Bug in __sync_lock_release with 64 bit primitives

Reported by Ramana Radhakrishnan on 2012-01-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GCC
High
Ramana Radhakrishnan
gcc-4.6 (Ubuntu)
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)
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.

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
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) on 2012-03-14
Changed in gcc-linaro:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers