This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/32686] New: Code to convert double to _Complex double for arguments passing is not good (extra load)
- 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: 9 Jul 2007 03:31:51 -0000
- Subject: [Bug middle-end/32686] New: Code to convert double to _Complex double for arguments passing is not good (extra load)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Testcase:
_Complex double f(_Complex double);
_Complex double g(double a)
{
return f(a);
}
----- Cut ----
We currently get:
mflr r0
bcl 20,31,"L00000000001$pb"
"L00000000001$pb":
stw r31,-4(r1)
mflr r31
stfd f1,-24(r1)
mtlr r0
lwz r3,-24(r1)
lwz r4,-20(r1)
addis r2,r31,ha16(LC0-"L00000000001$pb")
lwz r31,-4(r1)
la r5,lo16(LC0-"L00000000001$pb")(r2)
lwz r6,4(r5)
lwz r5,0(r5)
b L_f$stub
We should be able to get:
stfd f1,-8(r1)
li r6,0
li r5,0
lwz r3,-8(r1)
lwz r4,-4(r1)
b L_f$stub
Without the need for the PIC register.
--
Summary: Code to convert double to _Complex double for arguments
passing is not good (extra load)
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
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-darwin
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32686