This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Tree based inlining fix (take 2)
Jakub Jelinek <jakub@redhat.com> writes:
| On Sun, Jan 28, 2001 at 11:32:59AM +0100, Gabriel Dos Reis wrote:
| > | + else if (TREE_CODE (*tp) == MODIFY_EXPR
| > | + && TREE_OPERAND (*tp, 0) == TREE_OPERAND (*tp, 1)
| > | + && nonstatic_local_decl_p (TREE_OPERAND (*tp, 0))
| > | + && DECL_CONTEXT (TREE_OPERAND (*tp, 0)) == fn)
| > | + {
| > | + /* Assignments like a = a; don't generate any rtl code
| > | + and don't count as variable modification. Avoid
| > | + keeping bogosities like 0 = 0. */
| >
| > I think your comment is a bit misleading and I didn't test if the
| > following is correctly handled.
|
| I think it is just misleading comment wording, would
| s/Assignments/Some assignments/ be ok?
| Basically, if x = x generates any rtl code, then it will count as variable
| modification, ie. x will have TREE_READONLY flag cleared and remap_decl will
| not replace it with a constant. The code there will only avoid keeping
| MODIFY_EXPRs which assign into a constant.
| Note your example will be compiled correctly, it needs to be in a function
| which is being inlined and even if it was, it does not create MODIFY_EXPR
| with TREE_OPERAND(t, 0) == TREE_OPERAND(t, 1).
Thankf for the clarification.
-- Gaby
CodeSourcery, LLC http://www.codesourcery.com