c++/10471: [3.3?/3.4 regression] SegFault in build_cxx_call

bangerth@dealii.org bangerth@dealii.org
Wed Apr 23 22:06:00 GMT 2003


>Number:         10471
>Category:       c++
>Synopsis:       [3.3?/3.4 regression] SegFault in build_cxx_call
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 23 22:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang Bangerth
>Release:        unknown-1.0
>Organization:
>Environment:
present mainline
>Description:
This broke our nightly builds yesterday:
-----------------
struct X {
    X ();
};

template <int> struct O {
    struct I {
        I (const X & = X());
    };
};
template struct O<2>;
-----------------------
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c y.cc
y.cc: In constructor `O<<anonymous> >::I::I(const X&) [with int <anonymous> =
   2]':
y.cc:6:   instantiated from `O<2>::I'
y.cc:10:   instantiated from here
y.cc:6: internal compiler error: Segmentation fault

The ICE happens here:
(gdb) bt
#0  0x080566b2 in build_cxx_call (fn=0x4015dda0, args=0x401a9154, 
    converted_args=0x401a9168) at ../../gcc-3.4-CVS/gcc/cp/call.c:4741
#1  0x080557ea in build_over_call (cand=0x40180c34, flags=3)
    at ../../gcc-3.4-CVS/gcc/cp/call.c:4710
#2  0x08057760 in build_new_method_call (instance=0x401a9140, fns=0x401a0ec4, 
    args=0x0, conversion_path=0x401a2fc0, flags=3)
    at ../../gcc-3.4-CVS/gcc/cp/call.c:5158
#3  0x080bbf39 in build_functional_cast (exp=0x401a03cc, parms=0x0)
    at ../../gcc-3.4-CVS/gcc/cp/typeck2.c:1239
#4  0x0809f44d in tsubst_default_argument (fn=0x401a03cc, type=0x0, 
    arg=0x401a03cc) at ../../gcc-3.4-CVS/gcc/cp/pt.c:5830
#5  0x0809f5b3 in tsubst_default_arguments (fn=0x401a03cc)
    at ../../gcc-3.4-CVS/gcc/cp/pt.c:5862

Mark, I bet this is the patch that caused this:
----------------------------
revision 1.377
date: 2003/04/22 05:44:07;  author: mmitchel;  state: Exp;  lines: +26 -4
	* Makefile.in (calls.o): Depend on except.h.
	* calls.c: Include except.h.
	(emit_call_1): Call note_eh_region_may_contain_throw if
	appropriate.
	* except.c (eh_region): Add may_contain_throw.
	(expand_eh_region_end_cleanup): Do not include handler code when
	it cannot be reached.
	(note_eh_region_may_contain_throw): New function.
	* except.h (note_eh_region_may_contain_throw): New function.

	* call.c (build_over_call): Use build_cxx_call.
	(build_cxx_call): New method, split out of build_over_call.
	* cp-tree.h (language_function): Add can_throw.
	(build_cxx_call): Declare it.
	* decl.c (finish_function): If a function does not contain any
	calls to functions that can throw an exception, indicate that
	fact.
	* decl2.c (mark_used): Do not defer the instantiation of
	functions, if the current function does not throw.
	* optimize.c (maybe_clone_body): Copy TREE_NOTHROW to the clones.
	* pt.c (instantiate_decl): Make sure import_export_decl is called
	before emitting things.
	* rtti.c (throw_bad_cast): Use build_cxx_call.
	(build_dynamic_cast_1): Likewise.
	* typeck.c (build_function_call): Likewise.

Can you take a look? The patch also seems to be on the
3.3 branch, but I don't have a recent enough build to
actually check that the same happens there.

Thanks
  Wolfgang
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list