https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106502
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- Once you enable optimization a single cat () call remains (as expected). The FE does 9931 if (TREE_SIDE_EFFECTS (argarray[0])) 9932 argarray[0] = save_expr (argarray[0]); 9933 t = build_pointer_type (TREE_TYPE (fn)); 9934 fn = build_vfn_ref (argarray[0], DECL_VINDEX (fn)); but argarray[0] doesn't have TREE_SIDE_EFFECTS set, it even has TREE_READONLY set on the CONVERT_EXPR wrapping the call. Note that save_expr would do nothing on this tree as well (because TREE_READONLY and !TREE_SIDE_EFFECTS).