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,rfh] More precise aliasing for builtins


On 7/10/07, Zdenek Dvorak <rakdver@kam.mff.cuni.cz> wrote
Hello,

> What you should do is, in find_func_aliases (or thereabouts), make it
> look at calls, and mark the variable memcpy'd into  as
> "no-tbaa-pruning", like we do for CHANGE_DYNAMIC_TYPE_EXPR.
>
> This should stop it from pruning the access.

thanks, it helps.  Below is the updated version of the patch that now
passes bootstrap & regtesting on ia64 and i686.

This looks good. Though I believe I cannot approve it.


Thanks for doing this!

Richard.


Zdenek


        * tree.h (DEF_BUILTIN): Add SIG argument.
        (DECL_IS_NOVOPS): Removed.
        (DECL_SIGNATURE): New.
        (struct function_signature): New type.
        (struct tree_function_decl): Remove novops_flag, add sig field.
        (ECF_NOVOPS): Removed.
        * builtins.c (DEF_BUILTIN): Add SIG argument.
        * builtin-attrs.def: Remove NOVOPS attribute and corresponding
        attribute lists.
        * builtins.def: Replace NOVOPS attribute by signature.  Add signatures
        for string functions.
        * tree-ssa-alias.c (count_derefs_in_call): New function.
        (count_uses_and_derefs): Use count_derefs_in_call.
        (is_escape_site): Functions with signature are not escape sites.
        * c-decl.c (merge_decls): Do not copy DECL_IS_NOVOPS.  Copy
        DECL_SIGNATURE.
        * calls.c (flags_from_decl_or_type): Do not handle DECL_IS_NOVOPS.
        * tree-ssa-loop-prefetch.c (tree_ssa_prefetch_arrays): Set signature
        for builtin_prefetch instead of DECL_IS_NOVOPS.
        * tree-vect-transform.c (novops_signature_p): New function.
        (vectorizable_function): Use novops_signature_p instead of testing
        for ECF_NOVOPS.
        * c-common.c (handle_novops_attribute): Removed.
        (c_common_attributes): Remove NOVOPS attribute.
        (def_builtin_1): Set DECL_SIGNATURE for the created decls.
        (DEF_BUILTIN): Pass signature to def_builtin_1.
        (parse_builtin_signature): New function.
        * tree-ssa-operands.c (get_ptr_operands): Split from ...
        (get_indirect_ref_operands): ... here.
        (find_errno_decl, add_call_signature_operands): New functions.
        (get_call_expr_operands): Call add_call_signature_operands for
        functions with signature.
        * tree-ssa-structalias.c (find_func_aliases): Set no_tbaa_pruning
        for arguments of functions with a signature.

* gcc.dg/tree-prof/stringop-1.c: Update outcome.


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