This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH] improve tree-ssa-phiopt a little, PR 14466
- From: "Dave Korn" <dk at artimi dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 13 May 2004 16:50:40 +0100
- Subject: RE: [PATCH] improve tree-ssa-phiopt a little, PR 14466
> -----Original Message-----
> From: gcc-patches-owner On Behalf Of Daniel Jacobowitz
> Sent: 13 May 2004 16:34
> To: Andrew Pinski
> On Thu, May 13, 2004 at 10:36:31AM -0400, Andrew Pinski wrote:
> > @@ -174,12 +186,16 @@ conditional_replacement (basic_block bb,
> > /* If the condition is not a naked SSA_NAME and its type does not
> > match the type of the result, then we can not
> optimize this case
> > as it would likely create non-gimple code when the condition
> > - was converted to the result's type. */
> > + so we create a new variable for it. */
>
> I don't think you really meant to remove the end of this sentence?
And thereby turn a large chunk of code into a comment. Ouch.
--------snip---
@@ -174,12 +186,16 @@ conditional_replacement (basic_block bb,
/* If the condition is not a naked SSA_NAME and its type does not
match the type of the result, then we can not optimize this case
as it would likely create non-gimple code when the condition
- was converted to the result's type. */
+ so we create a new variable for it. */
cond = COND_EXPR_COND (last_stmt (cond_block));
result = PHI_RESULT (phi);
if (TREE_CODE (cond) != SSA_NAME
&& !lang_hooks.types_compatible_p (TREE_TYPE (cond), TREE_TYPE
(result)))
- return false;
+ {
+ new_var = make_temp (TREE_TYPE (cond));
+ old_result = cond;
+ cond = new_var;
+ }
/* If the condition was a naked SSA_NAME and the type is not the
same as the type of the result, then convert the type of the
--------snip---
All those lines would have been ignored and then the second comment would
end the comment block (but produce a nested comment warning, presumably).
Which I guess means the bootstrap and testing probably needs redoing.
cheers,
DaveK
--
Can't think of a witty .sigline today....