This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [alias-export] Account for stack slot shared vars when exporting info


Richard Guenther wrote:
referenced_var (uid) should give you the decl (you may need to
delay deallocating that hastable).
Indeed, thanks. I need this only during expand, so referenced vars are still available there. Fixed as follows, committed to the branch.

Andrey

        * alias-export.c (uids_to_decls): Remove. Remove all uses.
        (map_uid_to_decl): Likewise.
        (record_stack_var_partition_for): Adjust comment.
        (mark_conflict_stack_vars): Use referenced_var.


Index: gcc/alias-export.c =================================================================== *** gcc/alias-export.c (revision 146128) --- gcc/alias-export.c (working copy) *************** static struct pointer_map_t *exprs_to_pt *** 53,62 **** /* The map of decls to stack partitions. */ static struct pointer_map_t *decls_to_stack = NULL;

- /* The map of decl uids to decl pointers. This is needed because points-to sets
- have only decl uids. */
- static struct pointer_map_t *uids_to_decls = NULL;
-
/* The map of partition representative decls to bitmaps that are
unified points-to sets for pointer decls. */
static struct pointer_map_t *part_repr_to_pta = NULL;
--- 53,58 ----
*************** mark_conflict_stack_vars (tree pointer A
*** 103,117 ****
{
temp = BITMAP_ALLOC (NULL);
EXECUTE_IF_SET_IN_BITMAP (pid->pt.vars, 0, i, bi)
! if ((pdecl = (tree *) pointer_map_contains (uids_to_decls,
! (void *) (size_t) i)))
! {
! pdecl = (tree *) pointer_map_contains (decls_to_stack, *pdecl);
! gcc_assert (pdecl);
! bitmap_ior_into (temp,
! *((bitmap *) pointer_map_contains (part_repr_to_part,
! *pdecl)));
! }
bitmap_ior_into (pid->pt.vars, temp);
BITMAP_FREE (temp);
}
--- 99,109 ----
{
temp = BITMAP_ALLOC (NULL);
EXECUTE_IF_SET_IN_BITMAP (pid->pt.vars, 0, i, bi)
! if ((pdecl = (tree *) pointer_map_contains (decls_to_stack,
! referenced_var (i))))
! bitmap_ior_into (temp,
! *((bitmap *) pointer_map_contains (part_repr_to_part,
! *pdecl)));
bitmap_ior_into (pid->pt.vars, temp);
BITMAP_FREE (temp);
}
*************** unshare_and_record_pta_info (tree orig_e
*** 157,175 ****
return orig_expr;
}


- /* Record the uid mapping for DECL. */
- static void
- map_uid_to_decl (tree decl)
- {
- if (DECL_P (decl))
- {
- if (!uids_to_decls)
- uids_to_decls = pointer_map_create ();
- *((tree *) pointer_map_insert (uids_to_decls,
- (void *) (size_t) DECL_UID (decl))) = decl;
- }
- }
-
/* Record the DECL mapping to its PART_DECL representative. */
static void
map_decl_to_representative (tree decl, tree part_decl)
--- 149,154 ----
*************** record_stack_var_partition_for (tree dec
*** 209,218 ****
{
bitmap temp;


! /* First, record that decl has part_decl as a representative, and their uids. */
map_decl_to_representative (decl, part_decl);
- map_uid_to_decl (decl);
- map_uid_to_decl (part_decl);


    /* Second, create a bitmap that represents all partition.  */
    temp = map_decl_to_bitmap (&part_repr_to_part, part_decl);
--- 188,195 ----
  {
    bitmap temp;

!   /* First, record that decl has part_decl as a representative.  */
    map_decl_to_representative (decl, part_decl);

    /* Second, create a bitmap that represents all partition.  */
    temp = map_decl_to_bitmap (&part_repr_to_part, part_decl);



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]