This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR ipa/65722
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Martin LiÅka <mliska at suse dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Fri, 10 Apr 2015 18:28:01 +0200
- Subject: Re: [PATCH] Fix PR ipa/65722
- Authentication-results: sourceware.org; auth=none
- References: <5527F705 dot 5020509 at suse dot cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Apr 10, 2015 at 06:15:01PM +0200, Martin LiÅka wrote:
> Attached patch fixes PR, where we should consider just cgraph_nodes as
> objects referred by virtual table.
>
> Patch survives regression tests on x86_64-linux-pc with enabled checking.
>
> Ready for trunk?
> Thanks,
> Martin
> >From 8bff38438f6ba57732a6c3ccc3632f6789ca4d7e Mon Sep 17 00:00:00 2001
> From: mliska <mliska@suse.cz>
> Date: Fri, 10 Apr 2015 11:37:04 +0200
> Subject: [PATCH] Fix PR ipa/65722.
>
> gcc/testsuite/ChangeLog:
>
> 2015-04-10 Martin Liska <mliska@suse.cz>
>
Please add PR line here too.
> * g++.dg/ipa/pr65722.C: New test.
>
> gcc/ChangeLog:
>
> 2015-04-10 Martin Liska <mliska@suse.cz>
>
> PR ipa/65722
> * ipa-icf.c (sem_variable::equals_wpa): Consider comparsion just
> for references coming from cgraph nodes.
> ---
> gcc/ipa-icf.c | 4 ++++
> gcc/testsuite/g++.dg/ipa/pr65722.C | 21 +++++++++++++++++++++
> 2 files changed, 25 insertions(+)
> create mode 100644 gcc/testsuite/g++.dg/ipa/pr65722.C
>
> diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
> index 8f8a0cf..9e5d19c 100644
> --- a/gcc/ipa-icf.c
> +++ b/gcc/ipa-icf.c
> @@ -1670,6 +1670,10 @@ sem_variable::equals_wpa (sem_item *item,
> /* DECL_FINAL_P flag on methods referred by virtual tables is used
> to decide on completeness possible_polymorphic_call_targets lists
> and therefore it must match. */
> + if (!is_a <cgraph_node *> (ref->referred)
> + || !is_a <cgraph_node *> (ref2->referred))
> + continue;
> +
Wouldn't it be better to move this check before the DECL_FINAL_P comment, so
that it is closer to the uses?
Jakub