This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16607] Incorrect FP code generated in member data initialization
- From: "npr1 at suomi24 dot fi" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jul 2004 02:01:31 -0000
- Subject: [Bug c++/16607] Incorrect FP code generated in member data initialization
- References: <20040717172049.16607.npr1@suomi24.fi>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From npr1 at suomi24 dot fi 2004-07-19 02:01 -------
To bring up the error in compilation clearly, here's a part of the original
program's assembly, for essentially this part of code:
struct C {
double x;
C(double x_) : x(x_) { }
};
void f(float x) {
const double y = x * .9f;
new C(y);
}
The above code alone doesn't compile that way, though. This is just to
illustrate what I left to show in the assembly.
_Z1ff:
; snip stack frame setup
flds 8(%ebp)
fld %st(0)
fmuls .LC0 ; .LC0 is ".9f", obviously
fsts -28(%ebp) ; float version saved for some reason (*bug*)
fstpl -24(%ebp) ; this is later used in other uses of y
; snip code for the "if" which is in the original program
pushl $8
call _Znwj
movl %eax, %ebx
flds -28(%ebp) ; the float version loaded (*bug*)
fstpl (%eax) ; and saved as double x
I forgot to reopen the bug last time, doing it now.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|DUPLICATE |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16607