This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/25474] New: Extra load for some FP code
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Dec 2005 02:36:57 -0000
- Subject: [Bug middle-end/25474] New: Extra load for some FP code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Take the following example:
double d;
float f;
void g(void)
{
d = 1.0;
f = 1.0f;
}
----
Currently we get:
_g:
lis r9,ha16(LC1)
lis r2,ha16(_d)
lfs f13,lo16(LC1)(r9)
lfs f0,lo16(LC1)(r9)
lis r9,ha16(_f)
stfs f13,lo16(_f)(r9)
stfd f0,lo16(_d)(r2)
blr
--
We should get instead:
_g:
lis r9,ha16(LC1)
lis r2,ha16(_d)
lfs f13,lo16(LC1)(r9)
lis r9,ha16(_f)
stfs f13,lo16(_f)(r9)
stfd f13,lo16(_d)(r2)
blr
Only one lfs.
--
Summary: Extra load for some FP code
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: powerpc-*-*
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25474