This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Fix PR58542, Arguments of __atomic_* functions are converted in unsigned mode
- From: Richard Henderson <rth at redhat dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 09 Oct 2013 09:23:07 -0700
- Subject: Re: [PATCH]: Fix PR58542, Arguments of __atomic_* functions are converted in unsigned mode
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4YAWui0jF8vNrTn6n=C9bHQ9f4UnXNvzwP8CB6D6q9Bpw at mail dot gmail dot com>
On 10/08/2013 11:37 AM, Uros Bizjak wrote:
>
> 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?
This doesn't seem right at all.
The bug is that I gets set to UINT64_MAX, right? Where's the
incorrect conversion from int to __int128_t? Surely you can
produce a reduced test case that doesn't involve all of <atomic>
to show that.
r~