This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/16797] Opportunity to remove unnecessary load instructions
- 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: 8 Nov 2004 14:15:54 -0000
- Subject: [Bug tree-optimization/16797] Opportunity to remove unnecessary load instructions
- References: <20040728170038.16797.steinmtz@us.ibm.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-11-08 14:15 -------
Here is a PPC32 example:
short b,d;
short logic_func1() {
if (d< b) return b; else return d;
}
We get:
lis r2,ha16(_b)
lis r9,ha16(_d)
lha r0,lo16(_b)(r2)
lha r2,lo16(_d)(r9)
cmpw cr7,r2,r0
blt- cr7,L4
mr r0,r2
L4:
mr r3,r0 <-- extra
blr
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16797