This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/35730] ICE on valid code convert_move expr.c:373



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]