This is the mail archive of the gcc-bugs@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]

Re: Example program takes 2000 times as long to compile underC++ as C


>>>>> "Zack" == Zack Weinberg <zack@wolery.cumb.org> writes:

    Zack> I see no alternative at this point but to do something like
    Zack> what verify_stmt_tree does in order to prevent visiting
    Zack> nodes more than once (it remembers every node in a hash
    Zack> table).  But I thought I'd ask you if there were something
    Zack> obviously wrong with the tree structure.  Should we be
    Zack> visiting that SAVE_EXPR so very many times? 

Well, it depends what you mean.  SAVE_EXPRs are supposed to appear in
tree structure several times over, and that's part of why I think they
are evil.  I'm not quite sure why we'd get there *that* many times,
and I think we should understand that better.

In this particular case, it looks like we are creating a lot more
SAVE_EXPRs than we need to; there's nothing about that function that
should require any SAVE_EXPRs, really.  (There's nothing about what
you showed that has any side-effects.)  So, I bet that in this case,
there is an easy fix.  Send me the complete source code for a pared
down test-case; I promise to look at it today.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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