This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] ARM half-precision floating point, 5/8 (detect constant overflow)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: Sandra Loosemore <sandra at codesourcery dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 16 Apr 2009 11:37:43 +0000 (UTC)
- Subject: Re: [PATCH] ARM half-precision floating point, 5/8 (detect constant overflow)
- References: <49E65E6F.4040303@codesourcery.com> <84fc9c000904160118w3598a76eq66625503c85b7250@mail.gmail.com>
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