This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/36578] cast to long double not taken into account when result stored to a double
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jun 2008 16:41:36 -0000
- Subject: [Bug middle-end/36578] cast to long double not taken into account when result stored to a double
- References: <bug-36578-6373@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from rguenth at gcc dot gnu dot org 2008-06-21 16:41 -------
Testcase
double foo (double x, double y)
{
return (long double)x * (long double)y;
}
where we fold the multiplication to x * y. This is only ok with
-funsafe-math-optimizations (like any other conversions removing
FP operations). It is of course also ok if we for some reason
know that x * y is exactly representable in both double and
long double.
It is convert_to_real doing this optimization.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |wrong-code
Last reconfirmed|0000-00-00 00:00:00 |2008-06-21 16:41:36
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36578