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]

[lno] optimizing return statements


This implements the following transformation so that other optimizer can happen:
if (a)
return b;
else
return c;
into
if (a)
T = b;
else
T = c;
return T;
This patch along with the tree-ssa-phiopt improvements which I have applied fixes PR 14135
which is caused by the fact the returns were not being considered for optimizations.
This also fixes gcc.dg/tree-ssa/20040308-2.c which I added when applied my tree-ssa-phiopt
improvements.


Thanks,
Andrew Pinski


ChangeLog:


	PR optimization/14135
	* tree-ssa-return.c: New file.
	* Makefile.in (tree-ssa-return.o): Add.
	* tree-optimize.c (init_tree_optimization_passes): Add
	pass_return.
	* timevar.def (TV_TREE_RETURN): New.


testsuite/ChangeLog:


	PR optimization/14135
	* gcc.dg/tree-ssa/20040308-2.c: UnXFAIL.


Attachment: temp.diff.txt
Description: Text document



Attachment: tree-ssa-return.c
Description: Text document


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