https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108988
--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> --- Replacement stmt is created here: (gdb) bt #0 gimple_set_op (gs=<gimple_call 0x7fffea8183f0>, i=1, op=<addr_expr 0x7fffea7fa6a0>) at ../../src/gcc/gimple.h:2629 #1 0x0000000001093a6f in gimple_build_call_1 (fn=<addr_expr 0x7fffea7fa6a0>, nargs=4) at ../../src/gcc/gimple.cc:234 #2 0x0000000001093bfd in gimple_build_call (fn=<function_decl 0x7fffea771500 __builtin_fwrite>, nargs=4) at ../../src/gcc/gimple.cc:270 #3 0x00000000010b1a0b in gimple_fold_builtin_fputs (gsi=0x7fffffffd740, arg0=<addr_expr 0x7fffea7fa4e0>, arg1=<var_decl 0x7fffea652d80 fp>, unlocked=false) at ../../src/gcc/gimple-fold.cc:2993 #4 0x00000000010b884f in gimple_fold_builtin (gsi=0x7fffffffd740) at ../../src/gcc/gimple-fold.cc:5060 #5 0x00000000010baf8a in gimple_fold_call (gsi=0x7fffffffd740, inplace=false) at ../../src/gcc/gimple-fold.cc:5575 #6 0x00000000010be650 in fold_stmt_1 (gsi=0x7fffffffd740, inplace=false, valueize=0x10be840 <no_follow_ssa_edges(tree_node*)>) at ../../src/gcc/gimple-fold.cc:6327 #7 0x00000000010be8ca in fold_stmt (gsi=0x7fffffffd740) at ../../src/gcc/gimple-fold.cc:6410 #8 0x00000000010aa554 in replace_call_with_call_and_fold (gsi=0x7fffffffd740, repl=<gimple_call 0x7fffea652f30>) at ../../src/gcc/gimple-fold.cc:842 #9 0x00000000010b3c93 in gimple_fold_builtin_fprintf (gsi=0x7fffffffd740, fp=<var_decl 0x7fffea652d80 fp>, fmt=<addr_expr 0x7fffea7fa4e0>, arg=<tree 0x0>, fcode=BUILT_IN_FPRINTF) at ../../src/gcc/gimple-fold.cc:3796 #10 0x00000000010b8a66 in gimple_fold_builtin (gsi=0x7fffffffd740) at ../../src/gcc/gimple-fold.cc:5100 #11 0x00000000010baf8a in gimple_fold_call (gsi=0x7fffffffd740, inplace=false) at ../../src/gcc/gimple-fold.cc:5575 #12 0x00000000010be650 in fold_stmt_1 (gsi=0x7fffffffd740, inplace=false, valueize=0x10be840 <no_follow_ssa_edges(tree_node*)>) at ../../src/gcc/gimple-fold.cc:6327 #13 0x00000000010be8ca in fold_stmt (gsi=0x7fffffffd740) at ../../src/gcc/gimple-fold.cc:6410 #14 0x0000000002c93123 in lower_stmt (gsi=0x7fffffffd740, data=0x7fffffffd950) at ../../src/gcc/gimple-low.cc:793 #15 0x0000000002c910ee in lower_sequence (seq=0x7fffea65d1b8, data=0x7fffffffd950) at ../../src/gcc/gimple-low.cc:229 #16 0x0000000002c935ff in lower_gimple_bind (gsi=0x7fffffffd860, data=0x7fffffffd950) at ../../src/gcc/gimple-low.cc:882 #17 0x0000000002c92d28 in lower_stmt (gsi=0x7fffffffd860, data=0x7fffffffd950) at ../../src/gcc/gimple-low.cc:650 #18 0x0000000002c910ee in lower_sequence (seq=0x7fffea65d178, data=0x7fffffffd950) at ../../src/gcc/gimple-low.cc:229 #19 0x0000000002c935ff in lower_gimple_bind (gsi=0x7fffffffd930, data=0x7fffffffd950) at ../../src/gcc/gimple-low.cc:882 #20 0x0000000002c90cf1 in lower_function_body () at ../../src/gcc/gimple-low.cc:119 #21 0x0000000002c9104f in (anonymous namespace)::pass_lower_cf::execute (this=0x3f43e20) at ../../src/gcc/gimple-low.cc:206 #22 0x000000000140ff5a in execute_one_pass (pass=<opt_pass* 0x3f43e20 "lower"(15)>) at ../../src/gcc/passes.cc:2644 2993 gimple *repl = gimple_build_call (fn_fwrite, 4, arg0, 2994 size_one_node, len, arg1); 2995 replace_call_with_call_and_fold (gsi, repl);