This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Virtual operands in tree-tailcall
- From: law at redhat dot com
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 07 Jan 2004 11:14:54 -0700
- Subject: Re: [tree-ssa] Virtual operands in tree-tailcall
- Reply-to: law at redhat dot com
In message <20040107175616.GA22631@atrey.karlin.mff.cuni.cz>, Zdenek Dvorak wri
tes:
>Hello,
>
>> > * tree-tailcall.c (eliminate_tail_call): Add phi nodes for the call
>> > vdefs.
>> You seem to have some gratutious changes included in this patch. For
>> example, why did you reverse the loops in the first hunk? If there's
>> a reason you did that, then you should indicate why you changed the
>> iteration order of those loops.
>
>since it is no longer true that every phi node corresponds to the
>function's arguments, we must look for a phi for the argument, not
>vice versa.
>
>> Consider this pre-approved after you update the comment above and after
>> you either revert the gratutious changes in loop order noted above or
>> document the change to the loop ordering.
>
>I am not really sure how to document this. I may add a comment that
>we are looking for the phi node for the argument, but it is obvious
>from the code anyway.
Use what you wrote above since that states pretty clearly why you had
to change the loop. ie, something like:
/* Not every PHI node corresponds to a function argument, so we search
for a PHI corresponding to each argument rather than searching for
which argument a PHI node corresponds to. */
Do you see how this makes the code more readable and more maintainable in
the long term? What is obvious to the author is not always obvious to
someone else reading the code. Hell, it's even guaranteed to be obvious
to the author later.
jeff