public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rjpeters at klab dot caltech dot edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/16951] New: ICE with recursion in C++ constructor
Date: Mon, 09 Aug 2004 21:46:00 -0000	[thread overview]
Message-ID: <20040809214639.16951.rjpeters@klab.caltech.edu> (raw)

This looks like a 3.5 regression; not sure if I should put "[3.5 regression]" in
the subject line myself, or if I just let someone else do that.

Got an internal compiler error with the latest 3.5 snapshot with 'g++ -O1'; the
code compiles cleanly with 'g++-3.3.3 -O1', also with 'g++-3.4.1 -O1', and also
with recent 3.4 snapshot 'g++-3.4-20040730 -O1'.

[sideswipe 02:33 PM 1]$ cat fail.cc

struct foo;

void dummy_use(foo*);

struct foo
{
  foo()
  {
    dummy_use(this);
    foo r;
  }
};

void crash()
{
  foo r;
}

[sideswipe 02:33 PM 2]$ \
/home/rjpeters/local/gcc-3.5-20040808/bin/g++-3.5-20040808 -v -O1 -dHa gdb-c \
fail.cc

Reading specs from
/home/rjpeters/local/gcc-3.5-20040808/lib/gcc/i686-pc-linux-gnu/3.5.0/specs
Configured with: /home/rjpeters/build/gcc-3.5-20040808/configure
--prefix=/home/rjpeters/local/gcc-3.5-20040808 --program-suffix=-3.5-20040808
--enable-shared -enable-threads=posix --enable-checking --with-system-zlib
--enable-__cxa_atexit --enable-languages=c,c++
Thread model: posix
gcc version 3.5.0 20040808 (experimental)
 /home/rjpeters/local/gcc-3.5-20040808/libexec/gcc/i686-pc-linux-gnu/3.5.0/cc1plus
-quiet -v -D_GNU_SOURCE fail.cc -quiet -dumpbase fail.cc -mtune=pentiumpro
-auxbase fail -O1 -version -o /tmp/ccM74Apb.s
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/home/rjpeters/local/gcc-3.5-20040808/lib/gcc/i686-pc-linux-gnu/3.5.0/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/rjpeters/local/gcc-3.5-20040808/lib/gcc/i686-pc-linux-gnu/3.5.0/../../../../include/c++/3.5.0
 /home/rjpeters/local/gcc-3.5-20040808/lib/gcc/i686-pc-linux-gnu/3.5.0/../../../../include/c++/3.5.0/i686-pc-linux-gnu
 /home/rjpeters/local/gcc-3.5-20040808/lib/gcc/i686-pc-linux-gnu/3.5.0/../../../../include/c++/3.5.0/backward
 /home/rjpeters/local/gcc-3.5-20040808/include
 /home/rjpeters/local/gcc-3.5-20040808/lib/gcc/i686-pc-linux-gnu/3.5.0/include
 /usr/include
End of search list.
GNU C++ version 3.5.0 20040808 (experimental) (i686-pc-linux-gnu)
	compiled by GNU C version 3.5.0 20040808 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

fail.cc: In constructor `foo::foo()':
fail.cc:9: internal compiler error: in make_decl_rtl, at varasm.c:768
g++-3.5-20040808: Internal error: Aborted (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

[sideswipe 02:35 PM 3]$ gdb \
/home/rjpeters/local/gcc-3.5-20040808/libexec/gcc/i686-pc-linux-gnu/3.5.0/cc1plus\
core.15430

GNU gdb Red Hat Linux (6.0post-0.20040223.19rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db
library "/lib/tls/libthread_db.so.1".

Core was generated by
`/home/rjpeters/local/gcc-3.5-20040808/libexec/gcc/i686-pc-linux-gnu/3.5.0/cc1pl'.
Program terminated with signal 6, Aborted.

warning: svr4_current_sos: Can't read pathname for load map: Input/output error

Error while mapping shared library sections:
: Success.
Error while reading shared library symbols:
: No such file or directory.
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0  0x00a41402 in ?? ()
(gdb) bt
#0  0x00a41402 in ?? ()
#1  0x0016ee49 in raise () from /lib/tls/libc.so.6
#2  0x00170872 in abort () from /lib/tls/libc.so.6
#3  0x0826f03b in real_abort ()
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/diagnostic.c:604
#4  0x0826f1d5 in diagnostic_report_diagnostic (context=0x860f080, 
    diagnostic=0x25effc)
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/diagnostic.c:291
#5  0x0826f283 in internal_error (msgid=0x0)
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/diagnostic.c:548
#6  0x0826f2bf in fancy_abort (file=0x0, line=6, function=0x0)
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/diagnostic.c:594
#7  0x0849726e in make_decl_rtl (decl=0xf6dd5f68)
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/varasm.c:768
#8  0x082b9cb8 in expand_expr_real_1 (exp=0xf6dd5f68, target=0xf6dd7078, 
    tmode=VOIDmode, modifier=EXPAND_CONST_ADDRESS, alt_rtl=0x0)
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/expr.c:6344
#9  0x082c28fc in expand_expr_real (exp=0xf6dd5f68, target=0x0, 
    tmode=VOIDmode, modifier=EXPAND_CONST_ADDRESS, alt_rtl=0x0)
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/expr.c:6177
#10 0x082b413e in expand_expr_real_1 (exp=0xf6dd6160, target=Variable "target"
is not available.
) at expr.h:497
#11 0x082c28fc in expand_expr_real (exp=0xf6dd6160, target=0xf6dd9534, 
    tmode=VOIDmode, modifier=EXPAND_STACK_PARM, alt_rtl=0x0)
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/expr.c:6177
#12 0x0823bc55 in store_one_arg (arg=0xfefa0f20, argblock=0xf6e86070, 
    flags=0, variable_size=0, reg_parm_stack_space=0) at expr.h:497
#13 0x0823dfd7 in expand_call (exp=0xf6e13960, target=0x0, ignore=1)
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/calls.c:2606
#14 0x082b3aa6 in expand_expr_real_1 (exp=0xf6e13960, target=Variable "target"
is not available.
)
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/expr.c:7107
#15 0x082c2a32 in expand_expr_real (exp=0xf6e13960, target=0xf6e85210, 
    tmode=VOIDmode, modifier=EXPAND_NORMAL, alt_rtl=0x0)
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/expr.c:6171
#16 0x0846b515 in expand_expr_stmt (exp=0xf6e13960) at expr.h:497
#17 0x084abc8b in tree_expand_cfg ()
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/cfgexpand.c:295
#18 0x081b3ab2 in execute_pass_list (pass=0x860a7c0)
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/tree-optimize.c:453
#19 0x081b3d21 in tree_rest_of_compilation (fndecl=0xf6dd4074, 
    nested_p=0 '\0')
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/tree-optimize.c:556
#20 0x08131d71 in expand_body (fn=0xf6dd4074)
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/cp/semantics.c:2882
#21 0x084cc277 in cgraph_expand_function (node=0xf6dd4d98)
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/cgraphunit.c:801
#22 0x084cdb3f in cgraph_optimize ()
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/cgraphunit.c:1673
#23 0x080d96be in finish_file ()
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/cp/decl2.c:3056
#24 0x081894da in c_common_parse_file (set_yydebug=0)
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/c-opts.c:1093
#25 0x08478d55 in toplev_main (argc=0, argv=0xfefa1674)
    at /home/rjpeters/build/gcc-3.5-20040808/gcc/toplev.c:976
#26 0x0015cad4 in __libc_start_main () from /lib/tls/libc.so.6
#27 0x08049b31 in _start ()


[sideswipe 02:40 PM 5]$ ls fail.cc.*
fail.cc.00.cgraph

I'll attach 'fail.cc' and 'fail.cc.00.cgraph'.

Cheers,
Rob

-- 
           Summary: ICE with recursion in C++ constructor
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rjpeters at klab dot caltech dot edu
                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


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16951


             reply	other threads:[~2004-08-09 21:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-09 21:46 rjpeters at klab dot caltech dot edu [this message]
2004-08-09 21:47 ` [Bug c++/16951] " rjpeters at klab dot caltech dot edu
2004-08-09 21:48 ` rjpeters at klab dot caltech dot edu
2004-08-09 22:39 ` [Bug c++/16951] [3.5 regression] ICE in make_decl_rtl " bangerth at dealii dot org
2004-08-10  0:16 ` [Bug tree-optimization/16951] [3.5 regression] ICE in make_decl_rtl with recursion in C++ constructor (-O1) pinskia at gcc dot gnu dot org
2004-08-10  1:35 ` pinskia at gcc dot gnu dot org
2004-09-21 13:48 ` [Bug tree-optimization/16951] [4.0 " pinskia at gcc dot gnu dot org
2004-12-02 18:37 ` pinskia at gcc dot gnu dot org
2004-12-09 22:09 ` pinskia at gcc dot gnu dot org
2004-12-11 22:20 ` pinskia at gcc dot gnu dot org
2004-12-13 21:04 ` cvs-commit at gcc dot gnu dot org
2004-12-13 21:12 ` pinskia at gcc dot gnu dot org
2004-12-13 21:18 ` rjpeters at klab dot caltech dot edu
2004-12-23 19:37 ` cvs-commit at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040809214639.16951.rjpeters@klab.caltech.edu \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).