http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46888
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
Status|UNCONFIRMED |NEW
Last reconfirmed| |2010.12.10 19:42:11
Version|unknown |4.6.0
Ever Confirmed|0 |1
Severity|normal |enhancement
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-12-10
19:42:11 UTC ---
Here is a simpler example. Take:
struct b
{
int t;
int tt;
};
union a
{
long long t;
struct b b;
};
long long f(int i, int t)
{
long long ii = ((long long)i) << 32;
union a a;
a.t = 0;
a.b.t = i;
a.b.tt = t;
return a.t;
}
--- CUT ---
For MIPS64r2 (both n64 and n32):
move $2,$0
dins $2,$4,32,32
j $31
dins $2,$5,0,32
--- CUT ---
is produced but the first two instructions can really be done as one shift:
dsll $2,$4,32
j $31
dins $2,$5,0,32