This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix ICE during LTO odr reporting (PR lto/65361)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>, Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 9 Mar 2015 19:31:25 +0100
- Subject: [PATCH] Fix ICE during LTO odr reporting (PR lto/65361)
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
BINFO_BASE_BINFO always gives a TREE_BINFO, so using DECL_CONTEXT on it
is wrong. The following patch fixes it to use BINFO_TYPE instead.
Bootstrapped/regtested on x86_64-linux and i686-linux, tested also on the
testcase in the PR. Ok for trunk?
We don't seem to have infrastructure for testing errors during LTO linking,
so no testcase included.
2015-03-09 Jakub Jelinek <jakub@redhat.com>
PR lto/65361
* ipa-devirt.c (add_type_duplicate): Don't use DECL_CONTEXT
on a TREE_BINFO, instead use BINFO_TYPE.
--- gcc/ipa-devirt.c.jj 2015-03-09 08:05:13.000000000 +0100
+++ gcc/ipa-devirt.c 2015-03-09 16:23:42.277861689 +0100
@@ -1505,9 +1505,9 @@ add_type_duplicate (odr_type val, tree t
extra_base = BINFO_BASE_BINFO
(TYPE_BINFO (val->type),
BINFO_N_BASE_BINFOS (TYPE_BINFO (type)));
- inform (DECL_SOURCE_LOCATION
- (TYPE_NAME (DECL_CONTEXT (extra_base))),
- "the extra base is defined here ");
+ tree extra_base_type = BINFO_TYPE (extra_base);
+ inform (DECL_SOURCE_LOCATION (TYPE_NAME (extra_base_type)),
+ "the extra base is defined here");
}
base_mismatch = true;
}
Jakub