public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/35730] New: ICE on valid code convert_move expr.c:373
@ 2008-03-28 8:56 davids at webmaster dot com
2008-03-28 9:25 ` [Bug c++/35730] " davids at webmaster dot com
2008-03-28 10:31 ` rguenth at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: davids at webmaster dot com @ 2008-03-28 8:56 UTC (permalink / raw)
To: gcc-bugs
The following code produces an ICE with GCC-4.3.0 when compiled with g++ and
-O. Removing -O or using gcc removes the ICE.
#include <string.h>
int moo(void)
{
unsigned char msg[] = { 0, 0 };
unsigned char data[2];
memcpy(data, msg, sizeof (msg));
return memcmp(data, msg, sizeof (data)) != 0;
}
Also, changing msg's declaration from "msg[]" to "msg[2]" avoids the ICE.
g++430 test.c -c -O
test.c: In function 'int moo()':
test.c:6: internal compiler error: in convert_move, at expr.c:373
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions
Using gcc430, g++423, or g++412, the code compiles fine. Of the builds I
tested, only g++ 4.3.0 has the problem.
--
Summary: ICE on valid code convert_move expr.c:373
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: davids at webmaster dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35730
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/35730] ICE on valid code convert_move expr.c:373
2008-03-28 8:56 [Bug c++/35730] New: ICE on valid code convert_move expr.c:373 davids at webmaster dot com
@ 2008-03-28 9:25 ` davids at webmaster dot com
2008-03-28 10:31 ` rguenth at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: davids at webmaster dot com @ 2008-03-28 9:25 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/35730] ICE on valid code convert_move expr.c:373
2008-03-28 8:56 [Bug c++/35730] New: ICE on valid code convert_move expr.c:373 davids at webmaster dot com
2008-03-28 9:25 ` [Bug c++/35730] " davids at webmaster dot com
@ 2008-03-28 10:31 ` rguenth at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-03-28 10:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2008-03-28 10:30 -------
*** This bug has been marked as a duplicate of 35526 ***
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35730
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-03-28 10:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-28 8:56 [Bug c++/35730] New: ICE on valid code convert_move expr.c:373 davids at webmaster dot com
2008-03-28 9:25 ` [Bug c++/35730] " davids at webmaster dot com
2008-03-28 10:31 ` rguenth at gcc dot gnu dot org
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).