This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11295] New: *reinterpret_cast<std::string *> causes ICE
- From: "jfc at legra dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jun 2003 15:50:41 -0000
- Subject: [Bug c++/11295] New: *reinterpret_cast<std::string *> causes ICE
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11295
Summary: *reinterpret_cast<std::string *> causes ICE
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jfc at legra dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
I tried to make a fake std::string value using reinterpret_cast and got a core dump.
Source:
#include <string>
std::string fakefoo()
{
return
({static char rep[] = { "\0\0\x00\x04\0\0\x00\x04\0\0\0\0" "foo?"};
struct { void *p; } p = {&rep[12]};
*reinterpret_cast<std::string *>(&p);})
;
}
With gcc 3.3 on i386-linux I get
str.ii:5700: internal compiler error: in cp_expr_size, at cp/cp-lang.c:312
with gcc 3.2.1 or gcc3.2.2 on Linux, mips, or SPARC I get
str.ii:5700: Internal compiler error in simplify_gen_subreg, at simplify-rtx.c:
2711
This happens regardless of optimization level.