This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, i386]: Fix PR 59432, sync/atomic FAILs on 32bit x86 systems without .cfi directives


Hello!

Now that %ebx is no more fixed, we can remove all PIC related
complications in atomic_compare_and_swap<dwi>_doubleword pattern. The
immediate consequence is, that we avoid "hidden" xchgs that clobbered
unwinding state.

Earlier fix by Ian [1] partly solved this issue using various .cfi
directives to fixup the mess, but these were not available on the
systems without .cfi directives (e.g. Centos 5 and Solaris).

The patch fixes this problem for good by removing problematic
alternative that tried to skip %ebx allocations.

2014-10-15  Uros Bizjak  <ubizjak@gmail.com>

    PR go/59432
    * config/i386/sync.md (atomic_compare_and_swap<dwi>_doubleword):
    Remove the second alternative.
    (regprefix): Remove mode attribute.
    (atomic_compare_and_swap<mode>): Do not fixup operand 2.
    * config/i386/predicates.md (cmpxchg8b_pic_memory_operand): Remove.

    Revert:
    2013-11-05  Ian Lance Taylor  <iant@google.com>

    * config/i386/sync.md (atomic_compare_and_swap<dwi>_doubleword):
    If possible, add .cfi directives to record change to bx.
    * config/i386/i386.c (ix86_emit_cfi): New function.
    * config/i386/i386-protos.h (ix86_emit_cfi): Declare.

Patch was bootstrapped and regression tested on x86_64-linux-gnu
{,-m32} on Fedora 20 and Centos 5.11, where fixes Go sync/atomic
failure on 32bit targets.

Patch was committed to mainline SVN.

Uros

Attachment: p.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]