This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] ARM half-precision floating point, 5/8 (detect constant overflow)


On Thu, 16 Apr 2009, Richard Guenther wrote:

> How does the C frontend react to TREE_OVERFLOW set on
> constant initializers (which we are allowed to accept?).

It diagnoses the overflow, which is as desired.  See fp16-compile-alt-7.c, 
fp16-compile-alt-10.c, fp16-compile-alt-11.c.  If the value being 
converted is outside the range of representable values for the target type 
(which isn't possible with IEEE because of Inf being in the range of 
representable values) then there is undefined behavior, which GCC treats 
as meaning constant overflow should be diagnosed.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]