This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/14384] Invalid use of extra precision floating-point with -O0 optimization
- From: "wilson at specifixinc dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Mar 2004 18:57:03 -0000
- Subject: [Bug c/14384] Invalid use of extra precision floating-point with -O0 optimization
- References: <20040302150001.14384.anz@obs-nice.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From wilson at specifixinc dot com 2004-03-03 18:57 -------
Subject: Re: New: Invalid use of extra precision floating-point
with -O0 optimization
anz at obs-nice dot fr wrote:
> Arithmetic involving a float and a "lesser" type should be done in float in C89,
> at least when optimization is turned off.
This is false. K&R C required float operations to be performed in
double. C89 allows float operations to be performed as float, but does
not require it.
In my ANSI C 89 manual, this is section 3.2.1.5 Usual Arithmetic
Conversions, last sentence
"The values of floating operands and of the results of floating
expressions may be represented in greater precision and range than that
required by the type; the types are not changed thereby."
This gives the compiler the option of using float/double/long double for
operations on float types. This is unfortunately necessary, because
some hardware, the classic x86 FPU in particular, does not have a full
set of operations. It only has one, which for linux, is long double by
default.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14384