This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/34628] [4.2/4.3 Regression] problems with inlining on ARM
- From: "tbm at cyrius dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jan 2008 18:03:21 -0000
- Subject: [Bug target/34628] [4.2/4.3 Regression] problems with inlining on ARM
- References: <bug-34628-12387@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from tbm at cyrius dot com 2008-01-03 18:03 -------
Bugzilla wraps the testcase in a way that some commented out is no longer
commented out and so you don't see the segfault. Here's the testcase again
with proper wrapping:
typedef unsigned short u16;
typedef unsigned char u8;
static void
do_segfault(u8 in_buf[], const u8 out_buf[], const int len)
{
int i;
for (i = 0; i < len; i++) {
//SSVAL(in_buf, 2*i, SVAL(out_buf,2*i)); // more or less just a
// byte-wise memcpy
asm("nop\n");
in_buf[2*i] = ( out_buf[2*i] | out_buf[(2*i)+1]<<8 ) & 0xFF;
// in_buf[2*i] = out_buf[2*i];
asm("nop\n");
in_buf[(2*i)+1] = ( out_buf[2*i] | out_buf[(2*i)+1]<<8 ) >> 8;
// in_buf[(2*i)+1] = out_buf[(2*i)+1];
asm("nop\n");
}
}
int main(int argc, char *argv[])
{
u8 outbuf[32] = "buffer ";
u8 inbuf[32] = "\f";
asm("nop\n");
do_segfault(inbuf, outbuf, 12);
asm("nop\n");
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34628