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]: Fix PR58542, Arguments of __atomic_* functions are converted in unsigned mode


Hello!

As shown in the attached testcase, arguments of various __atomic
builtins should be converted as signed, so the immediates get properly
extended.

2013-10-08  Uros Bizjak  <ubizjak@gmail.com>

    * optabs.c (maybe_emit_atomic_exchange): Convert operands as signed.
    (maybe_emit_sync_lock_test_and_set): Ditto.
    (expand_atomic_compare_and_swap): Ditto.
    (maybe_emit_op): Ditto.

testsuite/ChangeLog:

2013-10-08  Uros Bizjak  <ubizjak@gmail.com>

    * g++.dg/ext/atomic-2.C: New test.

Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu {,-m32}.

OK for mainline and release branches?

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]