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] PR 5675


On Thu, 2005-01-13 at 10:13 -0500, Ian Lance Taylor wrote:
> Here is a partial patch for PR 5675.  This restores the behaviour of
> gcc mainline back to gcc 3.4, so it makes the PR no longer a 4.0
> regression.
> 
> The problem was introduced by this patch:
> 
>     2003-02-16  Jan Hubicka  <jh@suse.cz>
> 
> 	* c-typeck.c (build_c_cast):  Fold constant variables into
> 	initial values.
> 
>     http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01334.html
> 
> I think this patch is conceptually wrong, as was discussed in the
> e-mail thread.  We should not be doing this type of optimization in
> the frontend.
> 
> Fortunately, this patch is no longer necessary.  It was intended to
> fix a test case which appears here:
>     http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01325.html
> This test case now works as expected even if the patch to
> build_c_cast() is reverted.  The same optimization is now applied by
> the tree-ssa-ccp pass.
> 
> I've verified that reverting the patch causes on testsuite changes on
> i686-pc-linux-gnu.  I'm currently running a bootstrap on
> i686-pc-linux-gnu.  OK to commit if the bootstrap completes?
> 
> 
> gcc/ChangeLog:
> 
> 2005-01-13  Ian Lance Taylor  <ian@airs.com>
> 
> 	PR c/5675
> 	* c-typeck.c (build_c_cast): Revert patch of 2003-02-16: don't
> 	fold constant variables into initial values.
> 
> gcc/testsuite/ChangeLog:
> 
> 2005-01-13  Ian Lance Taylor  <ian@airs.com>
> 
> 	PR c/5675
> 	* gcc.dg/c90-const-expr-3.c: Remove xfails on tests which now
> 	pass--those that refer just to the variable, possibly with a
> 	cast.
> 	* gcc.dg/c99-const-expr-3.c: Likewise.
Approved.  Thanks,
Jeff



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