From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12332 invoked by alias); 7 Nov 2013 20:33:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 12322 invoked by uid 89); 7 Nov 2013 20:33:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.3 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,SPAM_SUBJECT,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 Nov 2013 20:33:46 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1VeWGh-0006c8-2s from joseph_myers@mentor.com ; Thu, 07 Nov 2013 12:33:31 -0800 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 7 Nov 2013 12:33:30 -0800 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Thu, 7 Nov 2013 20:33:27 +0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.76) (envelope-from ) id 1VeWGc-0004Ia-R7; Thu, 07 Nov 2013 20:33:26 +0000 Date: Thu, 07 Nov 2013 21:02:00 -0000 From: "Joseph S. Myers" To: Uros Bizjak CC: Subject: Re: Implement C11 _Atomic In-Reply-To: Message-ID: References: <20131107164555.GI27813@tucnak.zalov.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2013-11/txt/msg00835.txt.bz2 On Thu, 7 Nov 2013, Uros Bizjak wrote: > > 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). > > Yes, this is the exact sequence my example compiles to: > > 8048405: d9 44 24 14 flds 0x14(%esp) > 8048409: d9 44 24 18 flds 0x18(%esp) > 804840d: de c9 fmulp %st,%st(1) > 804840f: d9 5c 24 1c fstps 0x1c(%esp) > > unfortunately, it won't generate exception. Are you sure? It's documented as generating an exception. That may mean, as usual on x87, setting the exception bit (as can be tested by fetestexcept) and only calling a trap handler on the *next* x87 instruction. So if fstps is the last floating-point instruction executed by the program, a trap handler may not be called - but that's no different from an ordinary floating-point compound assignment having the exception-raising operation as the last floating-point instruction. -- Joseph S. Myers joseph@codesourcery.com