https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91570
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> --- One more test-case with a bit different backtrace: $ cat ice.i int a; int fprintf(int *, char *, ...); char *strcat(); char *strrchr(); void store_sif(outname, src, offset, incr, height) char *outname; char src; int offset, incr, height; { char *b, *c, *d = outname, *e = strrchr(d, '/'); strcat(outname, ".SIF"); b = e ?: d; c = b; fprintf(&a, "saving %s\n", c); } $ gcc ice.i -c -O2 during GIMPLE pass: strlen ice.i: In function ‘store_sif’: ice.i:5:6: internal compiler error: tree check: expected integer_cst, have plus_expr in get_len, at tree.h:5826 5 | void store_sif(outname, src, offset, incr, height) char *outname; | ^~~~~~~~~ 0x72ffde tree_check_failed(tree_node const*, char const*, int, char const*, ...) /home/marxin/Programming/gcc/gcc/tree.c:9925 0x70e3d9 get_range_strlen_dynamic /home/marxin/Programming/gcc/gcc/tree.h:3519 0xf69eb3 get_range_strlen_dynamic(tree_node*, c_strlen_data*, vr_values const*) /home/marxin/Programming/gcc/gcc/tree-ssa-strlen.c:1037 0x161aec6 get_string_length /home/marxin/Programming/gcc/gcc/gimple-ssa-sprintf.c:1980 0x161aec6 format_string /home/marxin/Programming/gcc/gcc/gimple-ssa-sprintf.c:2170 0x161b856 format_directive /home/marxin/Programming/gcc/gcc/gimple-ssa-sprintf.c:2730 0x161f2b3 compute_format_length /home/marxin/Programming/gcc/gcc/gimple-ssa-sprintf.c:3532 0x161f2b3 handle_printf_call(gimple_stmt_iterator*, vr_values const*) /home/marxin/Programming/gcc/gcc/gimple-ssa-sprintf.c:4199 0xf700d7 strlen_check_and_optimize_call /home/marxin/Programming/gcc/gcc/tree-ssa-strlen.c:4459 0xf700d7 check_and_optimize_stmt /home/marxin/Programming/gcc/gcc/tree-ssa-strlen.c:4595 0xf700d7 strlen_dom_walker::before_dom_children(basic_block_def*) /home/marxin/Programming/gcc/gcc/tree-ssa-strlen.c:4822 0x15d73a7 dom_walker::walk(basic_block_def*) /home/marxin/Programming/gcc/gcc/domwalk.c:309 0xf652d9 printf_strlen_execute /home/marxin/Programming/gcc/gcc/tree-ssa-strlen.c:4888 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.