This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR70187] Safely use nodes[0] in possible_polymorphic_call_targets
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Tom de Vries <Tom_deVries at mentor dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Wed, 16 Mar 2016 10:44:12 +0100
- Subject: Re: [PATCH, PR70187] Safely use nodes[0] in possible_polymorphic_call_targets
- Authentication-results: sourceware.org; auth=none
- References: <56E915B8 dot 5090503 at mentor dot com>
On Wed, Mar 16, 2016 at 9:13 AM, Tom de Vries <Tom_deVries@mentor.com> wrote:
> Hi,
>
> this patch fixes lto PR70187, a 6 regression.
>
> We run into an ICE in in possible_polymorphic_call_targets when accessing
> nodes[0]->decl because nodes == vNULL:
> ...
> if (!outer_type->all_derivations_known)
> {
> if (!speculative && final_warning_records
> && TREE_CODE (TREE_TYPE (nodes[0]->decl)) == METHOD_TYPE)
> {
> if (complete
> && nodes.length () == 1
> && warn_suggest_final_types
> && !outer_type->derived_types.length ())
> {
> ...
>
> The patch fixes this by moving the 'nodes.length () == 1' test to before the
> use of nodes[0].
>
> Bootstrapped and reg-tested on x86_64.
>
> OK for stage4 trunk?
Ok (even obvious I think).
Thanks,
Richard.
> Thanks,
> - Tom