https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104213
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Try: val = build2 (MODIFY_EXPR, TREE_TYPE (val), DECL_RESULT (delete_dtor), val); tree stmt = build_stmt (0, RETURN_EXPR, val); suppress_warning (stmt, OPT_Wuse_after_free); add_stmt (stmt); That is do it for the RETURN_EXPR instead of the MODIFY_EXPR. It might be saved. Otherwise the gimplification of RETURN_EXPR to GIMPLE_RETURN needs to save it around.