public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11295] New: *reinterpret_cast<std::string *> causes ICE
@ 2003-06-23 15:52 jfc at legra dot com
  2003-06-23 15:55 ` [Bug c++/11295] " jfc at legra dot com
                   ` (33 more replies)
  0 siblings, 34 replies; 35+ messages in thread
From: jfc at legra dot com @ 2003-06-23 15:52 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2004-04-18 17:26 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-23 15:52 [Bug c++/11295] New: *reinterpret_cast<std::string *> causes ICE jfc at legra dot com
2003-06-23 15:55 ` [Bug c++/11295] " jfc at legra dot com
2003-06-23 16:02 ` [Bug c++/11295] [3.3/3.4 Regression] " pinskia at physics dot uc dot edu
2003-06-23 16:42 ` bangerth at dealii dot org
2003-06-23 22:16 ` jfc at legra dot com
2003-06-23 23:09 ` bangerth at dealii dot org
2003-06-24  0:18 ` pinskia at physics dot uc dot edu
2003-06-24  1:56 ` [Bug c++/11295] [3.3/3.4 regression] ICE in cp_expr_size, at cp/cp-lang.c:314 when using a non-trivial object in a compound statement expression giovannibajo at libero dot it
2003-07-23 13:56 ` nathan at gcc dot gnu dot org
2003-08-01  9:28 ` nathan at gcc dot gnu dot org
2003-08-01  9:34 ` cvs-commit at gcc dot gnu dot org
2004-01-08 23:59 ` pinskia at gcc dot gnu dot org
2004-01-21 23:16 ` schwab at suse dot de
2004-01-21 23:23 ` pinskia at gcc dot gnu dot org
2004-01-21 23:47 ` schwab at suse dot de
2004-01-22 16:07 ` [Bug c++/11295] [3.4/3.5 " pinskia at gcc dot gnu dot org
2004-01-22 17:41 ` schwab at suse dot de
2004-01-22 17:54 ` schwab at suse dot de
2004-02-01 22:29 ` schwab at suse dot de
2004-02-02 17:46 ` mmitchel at gcc dot gnu dot org
2004-02-03  0:06 ` schwab at suse dot de
2004-02-05 19:43 ` mmitchel at gcc dot gnu dot org
2004-02-05 23:10 ` wilson at specifixinc dot com
2004-02-05 23:14 ` pinskia at gcc dot gnu dot org
2004-02-06  0:50 ` schwab at suse dot de
2004-02-06  2:43 ` pinskia at gcc dot gnu dot org
2004-02-07  9:17 ` wilson at specifixinc dot com
2004-02-07 16:15 ` schwab at suse dot de
2004-02-07 20:55 ` mark at codesourcery dot com
2004-02-09 21:32 ` cvs-commit at gcc dot gnu dot org
2004-02-09 21:32 ` cvs-commit at gcc dot gnu dot org
2004-02-09 23:21 ` wilson at gcc dot gnu dot org
2004-03-15 17:42 ` [Bug c++/11295] [3.3 regression] ICE " reichelt at gcc dot gnu dot org
2004-04-18 17:29 ` gdr at gcc dot gnu dot org
2004-04-18 17:43 ` pinskia 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).