From owner-sc22wg14+sc22wg14-domo2=www.open-std.org@open-std.org  Thu Jun  9 23:32:31 2016
Return-Path: <owner-sc22wg14+sc22wg14-domo2=www.open-std.org@open-std.org>
X-Original-To: sc22wg14-domo2
Delivered-To: sc22wg14-domo2@www.open-std.org
Received: by www.open-std.org (Postfix, from userid 521)
	id C671A358759; Thu,  9 Jun 2016 23:32:31 +0200 (CEST)
Delivered-To: sc22wg14@open-std.org
Received: from relay1.mentorg.com (relay1.mentorg.com [192.94.38.131])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by www.open-std.org (Postfix) with ESMTP id 39CD0356E70
	for <sc22wg14@open-std.org>; Thu,  9 Jun 2016 23:32:25 +0200 (CEST)
Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com)
	by relay1.mentorg.com with esmtp 
	id 1bB7Yt-0002Cq-Ak from joseph_myers@mentor.com 
	for sc22wg14@open-std.org; Thu, 09 Jun 2016 14:32:23 -0700
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.3.224.2; Thu, 9 Jun 2016 22:32:21 +0100
Received: from jsm28 (helo=localhost)	by digraph.polyomino.org.uk with
 local-esmtp (Exim 4.86_2)	(envelope-from <joseph@codesourcery.com>)	id
 1bB7Yq-00061a-Mh	for sc22wg14@open-std.org; Thu, 09 Jun 2016 21:32:20 +0000
Date: Thu, 9 Jun 2016 21:32:20 +0000
From: Joseph Myers <joseph@codesourcery.com>
X-X-Sender: jsm28@digraph.polyomino.org.uk
To: <sc22wg14@open-std.org>
Subject: FLT_EVAL_METHOD, exceptions and lvalue-to-rvalue conversion
Message-ID: <alpine.DEB.2.20.1606092117560.31478@digraph.polyomino.org.uk>
User-Agent: Alpine 2.20 (DEB 67 2015-01-07)
MIME-Version: 1.0
Content-Type: text/plain; charset="US-ASCII"
Sender: owner-sc22wg14@open-std.org
Precedence: bulk

Suppose that with an implementation of C11 + TS 18661-1, that defines 
FLT_EVAL_METHOD to 2, you have:

static volatile double x = SNAN;
(void) x;

Suppose also that the implementation defines the "(void) x;" statement to 
constitute an access to volatile-qualified x.

May the implementation define that access to convert x from the format of 
double to the format of long double, with greater range and precision, 
that format being used to represent double operands in accordance with the 
setting of FLT_EVAL_METHOD, and thereby to raise the "invalid" exception?

That is, may a convertFormat operation be applied as part of 
lvalue-to-rvalue conversion where FLT_EVAL_METHOD implies that a wider 
evaluation format is in use?

Even without signaling NaNs, the issue can apply to the case of exact 
underflow, which can be detected using pragmas from TS 18661-5, if the 
wider format has extra precision but not extra range and so exact 
underflow occurs on converting a subnormal value to the wider format.

-- 
Joseph S. Myers
joseph@codesourcery.com
