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] Re: fold_builtin_memcpy cannot optimize <retval>?


On Fri, 2005-01-21 at 09:56 -0500, Jakub Jelinek wrote:
> On Fri, Jan 21, 2005 at 11:51:58AM +0100, Jakub Jelinek wrote:
> > The arguments to __builtin_memcpy fail validation (validate_arglist).
> > The reason is that second argument in this case is not POINTER_TYPE
> > as memcpy requires, but REFERENCE_TYPE.
> > 
> > Not sure if it is better to just make sure __builtin_memcpy will
> > never see a REFERENCE_TYPE argument in this case, or make argument
> > validation in builtins.c less strict and for POINTER_TYPE requirements
> > allow REFERENCE_TYPEs as well.
> 
> The following patch does the former, is that the right fix?
> 
> 2005-01-21  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* call.c (build_over_call): Avoid passing REFERENCE_TYPE arguments to
> 	__builtin_memcpy.
> 
> 	* g++.dg/tree-ssa/empty-1.C: New test.
I prefer your other solution (use POINTER_TYPE_P more consistently in
the affected code.

jeff



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