Bug 15573 - infinite recursion in cc1plus
Summary: infinite recursion in cc1plus
Status: RESOLVED DUPLICATE of bug 15209
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-21 19:11 UTC by Tim Walberg
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work: 3.3.3
Known to fail: 3.4.0
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Walberg 2004-05-21 19:11:26 UTC
Attempting to use gcc-3.4.0 vanilla to compile par2cmdline-0.4 resulted in
ICE due to infite loop in cc1plus - portion of stack trace:

#723 0x081ebac9 in build_over_call (cand=0x4141ca20, flags=3)
    at ../../gcc/cp/call.c:4475
#724 0x081ec932 in build_new_method_call (instance=0x41cfcd20, fns=0x41cfcd34, 
    args=0x41cfccf8, conversion_path=0x41419580, flags=3)
    at ../../gcc/cp/call.c:5126
#725 0x0822ab39 in ocp_convert (type=0x4141c9b4, expr=0x41716330, convtype=65, 
    flags=3) at ../../gcc/cp/cvt.c:753
#726 0x0805e2b9 in force_rvalue (expr=0x41716330) at ../../gcc/cp/cvt.c:592
#727 0x081ed111 in convert_like_real (convs=0x4141c9b4, expr=0x41716330, 
    fn=0x41420654, argnum=0, inner=0, issue_conversion_warnings=24)
    at ../../gcc/cp/call.c:4088
#728 0x081ebac9 in build_over_call (cand=0x4141ca20, flags=3)
    at ../../gcc/cp/call.c:4475
#729 0x081ec932 in build_new_method_call (instance=0x41cfcc6c, fns=0x41cfcc80, 
    args=0x41cfcc44, conversion_path=0x41419580, flags=3)
    at ../../gcc/cp/call.c:5126
#730 0x0822ab39 in ocp_convert (type=0x4141c9b4, expr=0x41716330, convtype=65, 
    flags=3) at ../../gcc/cp/cvt.c:753
#731 0x0805e2b9 in force_rvalue (expr=0x41716330) at ../../gcc/cp/cvt.c:592
#732 0x081ed111 in convert_like_real (convs=0x4141c9b4, expr=0x41716330, 
    fn=0x41420654, argnum=0, inner=0, issue_conversion_warnings=24)
    at ../../gcc/cp/call.c:4088
#733 0x081ebac9 in build_over_call (cand=0x4141ca20, flags=3)
    at ../../gcc/cp/call.c:4475


gcc configuration:

tew@hobbes> gcc -v
Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.0/specs
Configured with: ../configure --prefix=/usr --enable-shared --with-gnu-as
--with-gnu-ld --enable-multilib --enable-threads --with-cpu=pentium4
--enable-cpp --enable-version-specific-runtime-libs --disable-nls
Thread model: posix
gcc version 3.4.0


output from compiler run:
if g++ -DHAVE_CONFIG_H -I. -I. -I.    -Wall -g -O2 -MT par2cmdline.o -MD -MP -MF
".deps/par2cmdline.Tpo" -c -o par2cmdline.o par2cmdline.cpp; \
then mv -f ".deps/par2cmdline.Tpo" ".deps/par2cmdline.Po"; else rm -f
".deps/par2cmdline.Tpo"; exit 1; fi
In file included from par2cmdline.h:265,
                 from par2cmdline.cpp:20:
par2fileformat.h:67: warning: ignoring packed attribute on unpacked non-POD
field `MD5Hash PACKET_HEADER::hash'
par2fileformat.h:68: warning: ignoring packed attribute on unpacked non-POD
field `MD5Hash PACKET_HEADER::setid'
par2fileformat.h:79: warning: ignoring packed attribute on unpacked non-POD
field `MD5Hash FILEVERIFICATIONENTRY::hash'
par2fileformat.h:86: warning: ignoring packed attribute on unpacked non-POD
field `MD5Hash FILEVERIFICATIONPACKET::fileid'
par2fileformat.h:87: warning: ignoring packed attribute on unpacked non-POD
field `FILEVERIFICATIONENTRY FILEVERIFICATIONPACKET::entries[0u]'
par2fileformat.h:101: warning: ignoring packed attribute on unpacked non-POD
field `MD5Hash FILEDESCRIPTIONPACKET::fileid'
par2fileformat.h:102: warning: ignoring packed attribute on unpacked non-POD
field `MD5Hash FILEDESCRIPTIONPACKET::hashfull'
par2fileformat.h:103: warning: ignoring packed attribute on unpacked non-POD
field `MD5Hash FILEDESCRIPTIONPACKET::hash16k'
par2fileformat.h:131: warning: ignoring packed attribute on unpacked non-POD
field `MD5Hash MAINPACKET::fileid[0u]'
g++: Internal error: Segmentation fault (program cc1plus)
Please submit a full bug report.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


At first thought this was related to the '__attribute__ ((packed))' stuff, but
looking at the cc1plus, I'm not so sure, and relocating the attribute
designation didn't fix it.

The code as distributed uses a bunch of

  struct blah { /* ... */ } __attribute__ ((packed));

I got identical symptoms with:

  struct __attribute__ ((packed)) blah { /* ... */ };

And the following gave parse errors:

  struct blah __attribute__ ((packed)) { /* ... */ };
Comment 1 Tim Walberg 2004-05-21 19:17:57 UTC
here's the top of the stack trace:

#0  0x080b4e4b in lvalue_p_1 (ref=0x41716318, treat_class_rvalues_as_lvalues=0)
    at ../../gcc/cp/tree.c:91
#1  0x080b4e50 in lvalue_p_1 (ref=0x41716318, treat_class_rvalues_as_lvalues=0)
    at ../../gcc/cp/tree.c:91
#2  0x0804db10 in reference_binding (rto=0x4141ca20, rfrom=0x0, 
    expr=0x41716330, flags=3) at ../../gcc/cp/call.c:955
#3  0x0804d49d in implicit_conversion (to=0x4141ca20, from=0x4141c9b4, 
    expr=0x41716330, flags=3) at ../../gcc/cp/call.c:1096
#4  0x0804d7c6 in add_function_candidate (candidates=0xbf800188, 
    fn=0x41420654, ctype=0x4141c57c, arglist=0x41716330, 
    access_path=0x41419580, conversion_path=0x41419580, flags=3)
    at ../../gcc/cp/call.c:1251
#5  0x080502ad in build_new_method_call (instance=0x41d072d0, fns=0x41d072e4, 
    args=0x41d072a8, conversion_path=0x41419580, flags=3)
    at ../../gcc/cp/call.c:5057
#6  0x080a54a4 in ocp_convert (type=0x4141c9b4, expr=0x41716330, convtype=65, 
    flags=3) at ../../gcc/cp/cvt.c:753
#7  0x080a66b7 in force_rvalue (expr=0x4141ca20) at ../../gcc/cp/cvt.c:592
#8  0x08050f37 in convert_like_real (convs=0x4141c9b4, expr=0x41716330, 
    fn=0x41420654, argnum=0, inner=0, issue_conversion_warnings=false)
    at ../../gcc/cp/call.c:4088
#9  0x0804f502 in build_over_call (cand=0x41d08118, flags=3)
    at ../../gcc/cp/call.c:4475
Comment 2 Tim Walberg 2004-05-21 19:23:44 UTC
and here's the other end of the stack trace:

#109168 0x08050f37 in convert_like_real (convs=0x4141c9b4, expr=0x41716330, 
    fn=0x41420654, argnum=0, inner=0, issue_conversion_warnings=false)
    at ../../gcc/cp/call.c:4088
#109169 0x0804f502 in build_over_call (cand=0x41707fc8, flags=3)
    at ../../gcc/cp/call.c:4475
#109170 0x0805052c in build_new_method_call (instance=0x41715f3c, 
    fns=0x41715f50, args=0x41715f14, conversion_path=0x41419580, flags=3)
    at ../../gcc/cp/call.c:5126
#109171 0x080a54a4 in ocp_convert (type=0x4141c9b4, expr=0x41716330, 
    convtype=65, flags=3) at ../../gcc/cp/cvt.c:753
#109172 0x080a66b7 in force_rvalue (expr=0x4141ca20) at ../../gcc/cp/cvt.c:592
#109173 0x08050f37 in convert_like_real (convs=0x4141c9b4, expr=0x41716330, 
    fn=0x0, argnum=0, inner=0, issue_conversion_warnings=false)
    at ../../gcc/cp/call.c:4088
#109174 0x08052eb9 in initialize_reference (type=0x4141ca20, expr=0x4141c9b4, 
    decl=0x0, cleanup=0x0) at ../../gcc/cp/call.c:6246
#109175 0x080a00ec in convert_for_initialization (exp=0x0, type=0x4141ca20, 
    rhs=0x4141c9b4, flags=131, errtype=0x83c3cd7 "return", fndecl=0x0, 
    parmnum=0) at ../../gcc/cp/typeck.c:5778
#109176 0x080a046c in check_return_expr (retval=0x41716330)
    at ../../gcc/cp/typeck.c:6082
#109177 0x080b1ba1 in finish_return_stmt (expr=0x0)
    at ../../gcc/cp/semantics.c:597
#109178 0x08092908 in cp_parser_statement (parser=0x40238140, 
    in_statement_expr_p=false) at ../../gcc/cp/parser.c:6075
#109179 0x0809297d in cp_parser_compound_statement (parser=0x4001d498)
    at ../../gcc/cp/parser.c:5658
#109180 0x08095ff9 in cp_parser_ctor_initializer_opt_and_function_body (
    parser=0x40238140) at ../../gcc/cp/parser.c:11339
#109181 0x08096284 in cp_parser_function_definition_after_declarator (
    parser=0x40238140, inline_p=false) at ../../gcc/cp/parser.c:14206
#109182 0x08096673 in cp_parser_init_declarator (parser=0x0, 
    decl_specifiers=0x41715c08, prefix_attributes=0x0, 
    function_definition_allowed_p=true, member_p=false, 
    declares_class_or_enum=0, function_definition_p=0xbffff1b3)
    at ../../gcc/cp/parser.c:14151
#109183 0x08091d08 in cp_parser_simple_declaration (parser=0x4001d498, 
    function_definition_allowed_p=true) at ../../gcc/cp/parser.c:6481
#109184 0x08091e6a in cp_parser_block_declaration (parser=0x40238140, 
    statement_p=152) at ../../gcc/cp/parser.c:6397
#109185 0x08096ffd in cp_parser_declaration (parser=0x40238140)
    at ../../gcc/cp/parser.c:6317
#109186 0x08097275 in cp_parser_declaration_seq_opt (parser=0x4001d498)
    at ../../gcc/cp/parser.c:6226
#109187 0x0809743d in c_parse_file () at ../../gcc/cp/parser.c:2319
#109188 0x080e5582 in c_common_parse_file (set_yydebug=1097948888)
    at ../../gcc/c-opts.c:1237
#109189 0x082b966d in toplev_main (argc=1097948888, argv=0xbffff6b1)
    at ../../gcc/toplev.c:1822
#109190 0x080e8bb2 in main (argc=1097948888, argv=0x41715ed8)
    at ../../gcc/main.c:35
#109191 0x4004ca07 in __libc_start_main () from /lib/i686/libc.so.6
Comment 3 Andrew Pinski 2004-05-21 19:29:35 UTC
This is a dup of bug 15209.

*** This bug has been marked as a duplicate of 15209 ***
Comment 4 Andrew Pinski 2004-05-21 19:31:14 UTC
And to note this has to do with the attribute see the other bug.