Ian Lance Taylor wrote on 04/10/07 20:49: > I'm having a hard time seeing it. fold_build2 calls fold_binary; I > agree that if we can handle fold_binary, we can handle fold_build2. > But fold_binary takes trees as parameters. How are you thinking of > calling it?
the gimple version of z = x + y is stmt -> GS_ASSIGN <PLUS_EXPR, z, x, y> we have a wrapper that calls: op0 = GIMPLE_OPERAND (stmt, 0); op1 = GIMPLE_OPERAND (stmt, 1); op2 = GIMPLE_OPERAND (stmt, 2); t = fold_build2 (GIMPLE_SUBCODE(stmt), TREE_TYPE (op0), op0, op1, op2); and then stuffs t's operands back into 'stmt'.