On Mon, Mar 12, 2018 at 9:42 AM, Martin Liška <mli...@suse.cz> wrote:
> Hi.
>
> This is what I was recommended in 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84658#c18.
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>
> Ready to be installed?

Please do not remove the DECL_PT_UID setting (set_alias_uids).   That's required
to make followup PTA runs compute correct points-to sets.

Otherwise...

+       /* The above get's us to 99% I guess, at least catching the
+         address compares.  Below also gets us aliasing correct
+         but as said we're giving leeway to the situation with
+         readonly vars anyway, so ... */
+       basic_block bb;
+       FOR_EACH_BB_FN (bb, DECL_STRUCT_FUNCTION (cnode->decl))
+       for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi);
+            gsi_next (&gsi))

so if you want to keep this (as the comment says I think it's not
strictly necessary) then you can replace DECL_STRUCT_FUNCTION (cnode->decl)
with 'fn' you compute earlier.

Otherwise looks ok.

Thanks,
Richard.

> Martin
>
> gcc/ChangeLog:
>
> 2018-03-12  Martin Liska  <mli...@suse.cz>
>
>         PR ipa/84658.
>         * ipa-icf.c (set_alias_uids): Remove.
>         (sem_variable::merge): Remove usage.
>         (sem_item_optimizer::sem_item_optimizer): Initialize new
>         vector.
>         (sem_item_optimizer::~sem_item_optimizer): Release it.
>         (sem_item_optimizer::merge_classes): Register variable aliases.
>         (sem_item_optimizer::fixup_pt_set): New function.
>         (sem_item_optimizer::fixup_points_to_sets): Likewise.
>         * ipa-icf.h: Declare new variables and functions.
>
> gcc/testsuite/ChangeLog:
>
> 2018-03-12  Martin Liska  <mli...@suse.cz>
>
>         PR ipa/84658.
>         * g++.dg/ipa/pr84658.C: New test.
> ---
>  gcc/ipa-icf.c                      | 88 
> +++++++++++++++++++++++++++++---------
>  gcc/ipa-icf.h                      | 10 +++++
>  gcc/testsuite/g++.dg/ipa/pr84658.C | 30 +++++++++++++
>  3 files changed, 108 insertions(+), 20 deletions(-)
>  create mode 100644 gcc/testsuite/g++.dg/ipa/pr84658.C
>
>

Reply via email to