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] improve tree-ssa-phiopt a little, PR 14466



On May 13, 2004, at 11:50, Dave Korn wrote:


-----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.


I think you misread the patch, the patch does not move the comment end at all,
it just changes what the comment says, but then again reading the comment, it
is wrong now and needs to be changed more.


Thanks,
Andrew Pinski


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