public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/54733] New: Missing opportunity to optimize endian independent load/store
@ 2012-09-28 10:03 joey.ye at arm dot com
  2012-09-28 10:47 ` [Bug tree-optimization/54733] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: joey.ye at arm dot com @ 2012-09-28 10:03 UTC (permalink / raw)
  To: gcc-bugs


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;


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-26 13:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-28 10:03 [Bug tree-optimization/54733] New: Missing opportunity to optimize endian independent load/store joey.ye at arm dot com
2012-09-28 10:47 ` [Bug tree-optimization/54733] " rguenth at gcc dot gnu.org
2014-03-19  6:31 ` thomas.preudhomme at arm dot com
2014-05-23  3:34 ` thopre01 at gcc dot gnu.org
2014-05-26 13:49 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).