This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Implement C11 _Atomic
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Andrew MacLeod <amacleod at redhat dot com>, Mike Stump <mikestump at comcast dot net>, <stanshebs at earthlink dot net>, Jason Merrill <jason at redhat dot com>, Richard Henderson <rth at redhat dot com>, "jh at suse dot cz" <jh at suse dot cz>
- Date: Thu, 7 Nov 2013 18:44:18 +0000
- Subject: Re: Implement C11 _Atomic
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1311052316480 dot 30260 at digraph dot polyomino dot org dot uk> <20131107164555 dot GI27813 at tucnak dot zalov dot cz> <CAFULd4bpn+rO=_i+CHAgjGF4i=hpf-6E-MHCTNFG-OQ09XHFAQ at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1311071824560 dot 20971 at digraph dot polyomino dot org dot uk> <CAFULd4a6BAxjL0c8S2zLqiJWb7cZkGz9_TwSgmydG0KGSg2S4A at mail dot gmail dot com>
On Thu, 7 Nov 2013, Uros Bizjak wrote:
> [uros@localhost test]$ gcc -lm -g fpex.c
> [uros@localhost test]$ ./a.out
> Floating point exception (core dumped)
> [uros@localhost test]$ gcc -lm -g -m32 fpex.c
> [uros@localhost test]$ ./a.out
> [uros@localhost test]$
I see code of the form (testing compilation rather than execution):
flds 4(%esp)
flds 8(%esp)
fmulp %st, %st(1)
fstps 12(%esp)
where the fstps should result in the exception, and glibc uses volatile in
several places, conditional on __FLT_EVAL_METHOD__ != 0, to force a
conversion to the semantic type (whether for correct results, or to ensure
exceptions).
--
Joseph S. Myers
joseph@codesourcery.com