https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #18 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Marek Polacek from comment #17) > (In reply to Jakub Jelinek from comment #16) > > (In reply to Marek Polacek from comment #15) > > > In C I don't think so, because we mostly call c_save_expr and c_fully_fold > > > therein would fold that expression to 0. And when we call save_expr, it's > > > > Yeah, I know that, and I think it is a serious bug. With the c_fully_fold > > in c_save_expr the C FE is not doing anything close to delayed folding, it > > folds immediately whenever we might need a save_expr, the old trees gone. > > So I think it would be nice to kill c_save_expr, just use save_expr, and let > > c_fully_fold fold SAVE_EXPR operand (just once, not many times). > > I agree. I'll try (guess we'll need the fold cache). That can be a > separate project, though. See above, if it is just about SAVE_EXPR, the C FE could just grab one of the many spare bits on SAVE_EXPR for a flag whether the operand has been c_fully_folded already.