https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87390

--- Comment #21 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
(In reply to jos...@codesourcery.com from comment #20)
> I think the statement in 6.3.1.8 is only observing a consequence of 
> specifications elsewhere,

No, 6.3.1.8 gives a specification about the choices of the types for the
operations. It is not an informative part of the standard. And in it, there is
nothing that differentiates integer sources from floating-point sources. This
is just an operand converted to (here) a floating-point type. Note: at this
point, the precision and range are unspecified, and that's why 6.3.1.4 and
6.3.1.5 do not come into play and are currently unrelated. It is only when
considering 5.2.4.2.2p8 (about FLT_EVAL_METHOD) that a specification can be
given using 6.3.1.4 and 6.3.1.5: with FLT_EVAL_METHOD = 2, "evaluate all
operations and constants to the range and precision of the long double type",
so that 6.3.1.4 and 6.3.1.5 are applied with long double as the target type for
conversions.

> and stating that this excess range and precision 
> does not affect semantic types;

Note that the reason this is described like that may be that the expression
needs to have a type, which cannot necessarily be expressed by the range and
precision (think of FLT_EVAL_METHOD = -1, for instance).

> it does not, by itself, result in any 
> expression having excess range and precision for a given value of 
> FLT_EVAL_METHOD, because it's the specification elsewhere that has those 
> results.

5.2.4.2.2p8 (about FLT_EVAL_METHOD) just gives *additional* information about
the range and precision when FLT_EVAL_METHOD is not -1.

Reply via email to