``` if (!ptrofftype_p (TREE_TYPE (lhs))) { lhs = convert_to_ptrofftype (lhs); lhs = force_gimple_operand_gsi (&gsi, lhs, true, NULL_TREE, true, GSI_SAME_STMT); } lenstmt = gimple_build_assign (make_ssa_name (TREE_TYPE (gimple_call_arg (stmt, 0))), POINTER_PLUS_EXPR,tem, lhs); gsi_insert_before (&gsi, lenstmt, GSI_SAME_STMT); ``` This could be using gimple_convert_to_ptrofftype and then gimple_build instead of convert_to_ptrofftype/force_gimple_operand_gsi /gimple_build_assign/gsi_insert_before .
Confirmed.
Hello I got this issue link from GNU Tools weekly and would like to work on it.
The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>: https://gcc.gnu.org/g:2985e0bd9b2aee03a932e5ab406523a95c04de5f commit r17-82-g2985e0bd9b2aee03a932e5ab406523a95c04de5f Author: Avinal Kumar <avinal.xlvii@gmail.com> Date: Thu Apr 23 23:43:23 2026 +0530 tree-ssa-strlen: Use gimple_build/gimple_convert_to_ptrofftype [PR122989] Replace convert_to_ptrofftype, force_gimple_operand_gsi, gimple_build_assign, and gsi_insert_before with gimple_convert_to_ptrofftype and gimple_build. gcc/ChangeLog: PR tree-optimization/122989 * tree-ssa-strlen.cc (get_string_length): Use gimple_convert_to_ptrofftype and gimple_build instead of convert_to_ptrofftype/force_gimple_operand_gsi/gimple_build_assign. Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
Fixed. Thanks again for working on this.