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] Handle builtin functions with pointer args/returns in PTA and the alias oracle


On Fri, Jun 19, 2009 at 9:45 AM, Richard Guenther<rguenther@suse.de> wrote:
> On Thu, 18 Jun 2009, Richard Guenther wrote:
>
>>
>> This implements knowledge about builtin functions with pointer arguments
>> and return values in points-to analysis as well as in the alias-oracle.
>> The effect is that arguments to most string and math functions do not
>> escape and that we know what their return values point to. ?We also
>> can restrict clobbering to the relevant arguments.
>>
>> Bootstrapped and tested on x86_64-unknown-linux-gnu, I'll apply this
>> tomorrow to let people time to comment.
>>
>> I chickened out on all the printf-style stuff due to the usual
>> problem of glibc allowing hooks here. ?If I missed commonly used
>> functions other than these please tell me.
>
> Reviewing the patch before committing revealed that I added a
> bunch of handling to the wrong function. ?Fixed and re-tested,
> the following is what I committed.
>
> Richard.
>
> 2009-06-19 ?Richard Guenther ?<rguenther@suse.de>
>
> ? ? ? ?* tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Handle
> ? ? ? ?ADDR_EXPR pointers.
> ? ? ? ?(ptr_derefs_may_alias_p): Likewise.
> ? ? ? ?(ptr_deref_may_alias_ref_p_1): New function.
> ? ? ? ?(ptr_deref_may_alias_ref_p): Likewise.
> ? ? ? ?(ref_maybe_used_by_call_p_1): Handle builtins that are not
> ? ? ? ?covered by looking at the ESCAPED solution.
> ? ? ? ?(call_may_clobber_ref_p_1): Likewise.
> ? ? ? ?* tree-ssa-structalias.c (get_constraint_for_ptr_offset):
> ? ? ? ?Handle NULL_TREE offset. ?Do not produce redundant constraints.
> ? ? ? ?(process_all_all_constraints): New helper function.
> ? ? ? ?(do_structure_copy): Use it.
> ? ? ? ?(handle_lhs_call): Likewise.
> ? ? ? ?(find_func_aliases): Handle some builtins with pointer arguments
> ? ? ? ?and/or return values explicitly.
>
> ? ? ? ?* gcc.c-torture/execute/20090618-1.c: New testcase.
>

This may have caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40495

-- 
H.J.


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