This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] improve C++ code by changing fold-const.c
- From: Jeffrey A Law <law at redhat dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: Roger Sayle <roger at eyesopen dot com>, Diego Novillo <dnovillo at redhat dot com>, Dale Johannesen <dalej at apple dot com>, gcc-patches at gcc dot gnu dot org, Richard Henderson <rth at redhat dot com>, Mark Mitchell <mark at codesourcery dot com>
- Date: Wed, 02 Jun 2004 10:42:04 -0600
- Subject: Re: [PATCH] improve C++ code by changing fold-const.c
- Organization: Red Hat, Inc
- References: <200405210300.i4L30AW5011486@speedy.slc.redhat.com> <40AEB4C1.6090804@codesourcery.com> <4E341518-AB9A-11D8-A4A1-000393A6D2F2@physics.uc.edu> <40AECA32.60900@codesourcery.com> <B47F4926-AF70-11D8-ACD4-000393A6D2F2@physics.uc.edu> <1086124024.2870.5.camel@speedy> <8357EB22-B44D-11D8-AEF3-000393A6D2F2@physics.uc.edu> <504D4132-B44E-11D8-AEF3-000393A6D2F2@physics.uc.edu>
- Reply-to: law at redhat dot com
On Tue, 2004-06-01 at 22:35, Andrew Pinski wrote:
> On Jun 2, 2004, at 00:30, Andrew Pinski wrote:
>
> >
> > On Jun 2, 2004, at 00:12, Jeffrey A Law wrote:
> >> Basically if the inner & outer types are pointer types (which include
> >> references), then we want to compare what each type points to. This
> >> (of course) iterates until one or both types are no longer a pointer
> >> type.
> >
> > Actually it looks like Dale messed up when he changed
> > tree_ssa_useless_type_conversion_1 to use the language hook and he
> > changed
> > the checking of the how it considers the pointer types compatible,
> > which
> > broke this tree_ssa_useless_type_conversion with this respect.
> > See
> > <http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa.c.diff?
> > r1=1.1.4.212&r2=1.1.4.213&f=h>
>
>
> And here is the patch which fixes the mess up by Dale also improves
> all of the code I have been looking at too.
>
> OK? Bootstrapped on powerpc-apple-darwin with no regressions.
>
> Thanks,
> Andrew Pinski
>
> ChangeLog:
> * tree-ssa.c: Check the type which the pointer points to
> instead of the pointer types.
This is fine. It would also be nice if you could convert your three
examples into tests for the testsuite.
Jeff