This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70205] [4.9/5/6 Regression] ICE on valid code on x86_64-linux-gnu: tree check: expected tree_binfo, have error_mark in add_candidates, at cp/call.c:5283
- From: "ppalka at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 17 Mar 2016 14:40:59 +0000
- Subject: [Bug c++/70205] [4.9/5/6 Regression] ICE on valid code on x86_64-linux-gnu: tree check: expected tree_binfo, have error_mark in add_candidates, at cp/call.c:5283
- Auto-submitted: auto-generated
- References: <bug-70205-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70205
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppalka at gcc dot gnu.org
--- Comment #7 from Patrick Palka <ppalka at gcc dot gnu.org> ---
That would suppress the ICE but in turn it would make us silently generate
wrong code since the call to D::f() won't be emitted.
adjust_result_of_qualified_name_lookup() is responsible for clobbering the
BASELINK_BINFO of the function. This seems to work:
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -1751,9 +1751,11 @@ adjust_result_of_qualified_name_lookup (tree decl,
if (base && base != error_mark_node)
{
BASELINK_ACCESS_BINFO (decl) = base;
- BASELINK_BINFO (decl)
+ tree decl_binfo
= lookup_base (base, BINFO_TYPE (BASELINK_BINFO (decl)),
ba_unique, NULL, tf_none);
+ if (decl_binfo && decl_binfo != error_mark_node)
+ BASELINK_BINFO (decl) = decl_binfo;
}
}