This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Re: fold_builtin_memcpy cannot optimize <retval>?(take 2)
- From: Jeffrey A Law <law at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>, Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 28 Jan 2005 10:22:29 -0700
- Subject: Re: [PATCH] Re: fold_builtin_memcpy cannot optimize <retval>?(take 2)
- Organization: Red Hat, Inc
- References: <Pine.LNX.email@example.com> <20050121105158.GH4777@sunsite.mff.cuni.cz> <firstname.lastname@example.org> <41F14409.email@example.com> <20050121215138.GH10340@devserv.devel.redhat.com>
- Reply-to: law at redhat dot com
On Fri, 2005-01-21 at 16:51 -0500, Jakub Jelinek wrote:
> On Fri, Jan 21, 2005 at 10:03:53AM -0800, Mark Mitchell wrote:
> > Jeffrey A Law wrote:
> > >I'm not an expert on the differences in the semantics of POINTER_TYPE
> > >and REFERENCE_TYPE, but I do know that I've been treating them as
> > >effectively the same.
> > The only difference is that a REFERENCE_TYPE object can never be NULL.
> > Other than that, they are identical. (In C++, you cannot assign to a
> > reference, but that is expressed by TREE_READONLY on the object.)
> > I think that it makes sense to use POINTER_TYPE_P almost everywhere in
> > the middle-end. The other choices is to introduce explicit NOP_EXPRs to
> > do the conversions -- but that's just a waste of memory, in my opinion.
> Is this ok to commit then assuming bootstrap/regtest are ok?
> Certainly cures the testcase.
> 2005-01-21 Jakub Jelinek <firstname.lastname@example.org>
> * builtins.c (get_pointer_alignment, gimplify_va_arg_expr,
> expand_builtin_printf, expand_builtin_fprintf,
> expand_builtin_sprintf): Use POINTER_TYPE_P instead TREE_CODE
> checking against POINTER_TYPE.
> (validate_arglist): Handle POINTER_TYPE code by checking
> * g++.dg/tree-ssa/empty-1.C: New test.
Yea, I think this is OK once the bootstrap and regression testing are