This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/54733] New: Missing opportunity to optimize endian independent load/store
- From: "joey.ye at arm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 28 Sep 2012 10:03:02 +0000
- Subject: [Bug tree-optimization/54733] New: Missing opportunity to optimize endian independent load/store
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54733
Bug #: 54733
Summary: Missing opportunity to optimize endian independent
load/store
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: joey.ye@arm.com
This case tries to load from memory in little-endian way, no matter what
endianess current target is.
On trunk 4.8 little-endian target, two byte loads should be able to combined
into a single 16-byte load.
int read_aux(void *, int);
int read_le()
{
unsigned char data[2];
read_aux(data, 2);
return data[0] | (data[1]<<8);
}
Current Tree (optimized):
unsigned char data[2];
read_aux (&data, 2);
D.4064_1 = data[0];
D.4065_2 = (int) D.4064_1;
D.4066_3 = data[1];
D.4067_4 = (int) D.4066_3;
D.4068_5 = D.4067_4 << 8;
D.4063_6 = D.4068_5 | D.4065_2;
data ={v} {CLOBBER};
return D.4063_6;
Expected Tree (optimized):
unsigned char data[2];
unsigned short *temp;
unsigned in D.4064;
read_aux (&data, 2);
temp=&data;
D.4064_1 = *temp;
return D.4064_1;