public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "joey.ye at arm dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/54733] New: Missing opportunity to optimize endian independent load/store Date: Fri, 28 Sep 2012 10:03:00 -0000 [thread overview] Message-ID: <bug-54733-4@http.gcc.gnu.org/bugzilla/> (raw) 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;
next reply other threads:[~2012-09-28 10:03 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-09-28 10:03 joey.ye at arm dot com [this message] 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-54733-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).