On 08/04/2015 09:04 AM, Jason Merrill wrote:

This is largely historical baggage, I think, from days where computers
had less memory and we were trying to do as much processing as possible
immediately.
Right. Also note the early folding was from a time before we had the gimple optimization pipeline -- the only significant optimizations we did on trees was the (excessive) fold-const.c stuff.



The c++-delayed-folding branch delays folding the ?: expression until
the end of the function, at which point we can see better what context
the function is being used in, which could simplify your patch.
Right. And that's a design direction we want to take with folding in general -- delay it until the transition to gimple/ssa. That way what we get out of the front-ends looks much more like the original source.

jeff

Reply via email to