But folding during parsing and semantic analysis, beyond that required
    by the language standard, is hobbled by such matters as needing to
    preserve language-specific lvalue-nature - for example, needing to
    keep a COND_EXPR in a form which the C++ front end understands as a
    lvalue if the original COND_EXPR was one.  

I think the confusion may be in what is being called "parsing and 
semantic analysis" as opposed to "the front end".  I agree that fold
is probably not appropriate to be called during the former, but the latter
includes the act of building the GENERIC tree and I see absolutely no
reason to avoid calling fold as part of that process: it's far more efficient
to do it then and build simpler trees than to burden the gimplication
process with junk trees.  And, so long as the front end isn't going to
go back and make semantic deductions from the GENERIC (which would seem
a bad idea in any event), it isn't going to be relying on fold to
preserve language semantics.

Reply via email to