This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9524: ICE in c_expand_expr, at c-common.c:4319 whencompiling boost 1.29.0
- From: Michael Matz <matz at suse dot de>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 14 Feb 2003 15:46:01 -0000
- Subject: Re: c++/9524: ICE in c_expand_expr, at c-common.c:4319 whencompiling boost 1.29.0
- Reply-to: Michael Matz <matz at suse dot de>
The following reply was made to PR c++/9524; it has been noted by GNATS.
From: Michael Matz <matz@suse.de>
To: <reichelt@igpm.rwth-aachen.de>
Cc: <gcc-bugs@gcc.gnu.org>, <gcc-prs@gcc.gnu.org>,
<gcc-gnats@gcc.gnu.org>, <larsbj@gullik.net>,
Mark Mitchell <mark@codesourcery.com>
Subject: Re: c++/9524: ICE in c_expand_expr, at c-common.c:4319 when
compiling boost 1.29.0
Date: Fri, 14 Feb 2003 13:27:43 +0100 (CET)
Hi,
reichelt@igpm.rwth-aachen.de writes:
> State-Changed-From-To: open->analyzed
> State-Changed-Why:
> The code does indeed crash the compiler.
> I bet this is the same failure as in PR 9443.
> Just to be sure, however, I'm leaving the PR open.
A very reduced testcase for this error is:
-------- snip -------------
struct B {
void (*f)(void);
void g();
};
void B::g()
{
B::f();
}
--------- snap ------------
This compiled with either 3.3 CVS or HEAD ICEs the compiler exhibits the
abort. The causing patch for this is a big one from Mark, ChangeLog
starting with:
+2002-07-31 Mark Mitchell <mark@codesourcery.com>
+
+ * call.c (build_field_call): Do not look up the field by name.
+ (build_method_call): Simplify.
+ (struct z_candidate): Add access_path and conversion_path. Remove
+ basetype_path.
+ (convert_class_to_reference): Adjust use of
+ add_function_candidate.
+ (add_candidate): Add conversion_path argument.
....
When one removes the qualification from the call (i.e. replace 'B::f()'
with 'f()'), the file compiles. The difference is, that while expanding
the call, in the working case it's a:
<call_expr 0x40159d00
...
arg 0 <component_ref 0x40159ce0
type <pointer_type 0x40189e70 type <function_type 0x4015e2a0>
...
while in the broken case the call expressions is a:
<call_expr 0x40159ce0
...
arg 0 <field_decl 0x40189ee0 f
...
A field_decl is never expected as the first elem of a call_expr, and this
makes finally the expansion functions crash.
Ciao,
Michael.