This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/23684] Combine stores for non strict alignment targets
- From: "acahalan at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Nov 2006 05:11:02 -0000
- Subject: [Bug rtl-optimization/23684] Combine stores for non strict alignment targets
- References: <bug-23684-6528@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from acahalan at gmail dot com 2006-11-29 05:11 -------
This hits it too. (example is PowerPC)
///////////////////
#include <string.h>
char *foo(char *buf)
{
short temp;
int temp1;
*buf++=42;
temp = 0xfeed;
memcpy(buf, &temp, sizeof(temp));
buf+=sizeof(temp);
temp1 = 0x12345678;
memcpy(buf, &temp1, sizeof(temp1));
buf+=sizeof(temp1);
temp1 = 0x12345678;
memcpy(buf, &temp1, sizeof(temp1));
buf+=sizeof(temp1);
*buf++=42;
return buf;
}
///////////////
foo:
stwu 1,-32(1)
lis 9,0x1234
li 11,42
li 0,-275
ori 9,9,22136
stb 11,11(3)
stb 11,0(3)
sth 0,1(3)
stw 9,7(3)
stw 9,3(3)
addi 3,3,12
addi 1,1,32
blr
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23684