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>, gcc-patches at gcc dot gnu dot org, Richard Henderson <rth at redhat dot com>, Mark Mitchell <mark at codesourcery dot com>
- Date: Tue, 01 Jun 2004 22:12:28 -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> <7BE4D8EF-AF76-11D8-ACD4-000393A6D2F2@physics.uc.edu>
- Reply-to: law at redhat dot com
On Wed, 2004-05-26 at 18:40, Andrew Pinski wrote:
> And here is C testcase which fails because the cast to "const int*" is
> not removed:
> int f()
> {
> int i;
> int *ir = &i;
> const int *ip = &i;
> *ir = 1;
> return *ip;
> }
This will also be collapsed down to a "return 1" by the changes I
suggested in my previous message.
Jeff