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: [PATCH]: Interprocedural detection of readonly and non-addressable static variables


> This is part 1 (of 7) of the interprocedural work Kenny and I have been
> doing for static variables, type-escape analysis, and pure/const
> detection.
> 
> This is the scanning code that finds information about which static
> variables are written/referenced/address taken in a given procedure.

I realize that there is actually no interface into aliasing bits yet,
but is it possible to have some testcases that the pass work as expected
or is it to come later? :)

>   /* Process all of the functions next. 
> 
>      We do not want to process any of the clones so we check that this
>      is a master clone.  However, we do need to process any
>      AVAIL_OVERWRITABLE functions (these are never clones) because

With current logic where we inline AVAIL_OVERWRITABLE functions when
inline keyword is present, we will get the clones with this
availability.
It might make sense to make all clones AVAIL_LOCAL like this:

Index: cgraph.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraph.c,v
retrieving revision 1.77
diff -c -3 -p -r1.77 cgraph.c
*** cgraph.c	3 Jun 2005 13:41:35 -0000	1.77
--- cgraph.c	8 Jun 2005 17:51:54 -0000
*************** cgraph_function_body_availability (struc
*** 978,984 ****
    gcc_assert (cgraph_function_flags_ready);
    if (!node->local.finalized)
      avail = AVAIL_NOT_AVAILABLE;
!   else if (node->local.local)
      avail = AVAIL_LOCAL;
    else if (node->local.externally_visible)
      avail = AVAIL_AVAILABLE;
--- 979,986 ----
    gcc_assert (cgraph_function_flags_ready);
    if (!node->local.finalized)
      avail = AVAIL_NOT_AVAILABLE;
!   /* Inline clones are no longer visible to the outside.  */
!   else if (node->local.local || node->global.inlined_to)
      avail = AVAIL_LOCAL;
    else if (node->local.externally_visible)
      avail = AVAIL_AVAILABLE;


>    
> +  /* Pointer to the structure that contains the sets of global
> +     variables modified by function calls.  This field is only used
> +     for FUNCTION_DECLs.  */
> +  ipa_reference_vars_info_t GTY ((skip)) reference_vars_info;

Would not be cgraph_node (decl)->global more appropriate place for this?
(at least you won't get it allocated for each variable in program)

Honza


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