This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35730] ICE on valid code convert_move expr.c:373
- From: "davids at webmaster dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Mar 2008 09:24:38 -0000
- Subject: [Bug c++/35730] ICE on valid code convert_move expr.c:373
- References: <bug-35730-531@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from davids at webmaster dot com 2008-03-28 09:24 -------
#include <string.h>
int moo(void)
{
unsigned char msg1[] = { 0, 0 };
unsigned char msg2[] = { 0, 0 };
memcpy(msg1, msg2, 2);
return memcmp(msg1, msg2, 2) != 0;
}
With this code, changing the sizes in both memcpy and memcmp from '2' to '1'
makes the problem go away. So does changing both arrays from '{ 0, 0 }' to { 0,
0, 0 }'. So maybe it's an off-by-one?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35730