From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 469233858404; Wed, 1 Mar 2023 21:57:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 469233858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677707824; bh=TSuaQ4BpWwNGfaw7BYNqRs43Ygnql+mxzh+QshE9MHU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SCGzjqzpeIufqypiR+6HCh7GMNm//YMsVcSdiQo+R/EuVSYokFFT3FdrrFZ6ecGg7 qEu+V0oi0wjJuN3K7BP6K266I13+msmno3uzRRx1FoL4HmJ9c04tVIqJ2lIKjQvTks n7Lvisoy0XnOWpLBiVBrIHifZtS96rOJ8x3tJ6IA= From: "dmalcolm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/108988] gimple_fold_builtin_fputs doesn't preserve gimple_builtin_call_types_compatible_p Date: Wed, 01 Mar 2023 21:57:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dmalcolm at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108988 --- Comment #1 from David Malcolm --- Replacement stmt is created here: (gdb) bt #0 gimple_set_op (gs=3D, i=3D1, op=3D) at ../../src/gcc/gimple.h:2629 #1 0x0000000001093a6f in gimple_build_call_1 (fn=3D, nargs=3D4) at ../../src/gcc/gimple.cc:234 #2 0x0000000001093bfd in gimple_build_call (fn=3D, nargs=3D4) at ../../src/gcc/gimple.cc:270 #3 0x00000000010b1a0b in gimple_fold_builtin_fputs (gsi=3D0x7fffffffd740, arg0=3D, arg1=3D,=20 unlocked=3Dfalse) at ../../src/gcc/gimple-fold.cc:2993 #4 0x00000000010b884f in gimple_fold_builtin (gsi=3D0x7fffffffd740) at ../../src/gcc/gimple-fold.cc:5060 #5 0x00000000010baf8a in gimple_fold_call (gsi=3D0x7fffffffd740, inplace= =3Dfalse) at ../../src/gcc/gimple-fold.cc:5575 #6 0x00000000010be650 in fold_stmt_1 (gsi=3D0x7fffffffd740, inplace=3Dfals= e, valueize=3D0x10be840 ) at ../../src/gcc/gimple-fold.cc:6327 #7 0x00000000010be8ca in fold_stmt (gsi=3D0x7fffffffd740) at ../../src/gcc/gimple-fold.cc:6410 #8 0x00000000010aa554 in replace_call_with_call_and_fold (gsi=3D0x7fffffff= d740, repl=3D) at ../../src/gcc/gimple-fold.cc:842 #9 0x00000000010b3c93 in gimple_fold_builtin_fprintf (gsi=3D0x7fffffffd740, fp=3D, fmt=3D,=20 arg=3D, fcode=3DBUILT_IN_FPRINTF) at ../../src/gcc/gimple-fold.cc:3796 #10 0x00000000010b8a66 in gimple_fold_builtin (gsi=3D0x7fffffffd740) at ../../src/gcc/gimple-fold.cc:5100 #11 0x00000000010baf8a in gimple_fold_call (gsi=3D0x7fffffffd740, inplace= =3Dfalse) at ../../src/gcc/gimple-fold.cc:5575 #12 0x00000000010be650 in fold_stmt_1 (gsi=3D0x7fffffffd740, inplace=3Dfals= e, valueize=3D0x10be840 ) at ../../src/gcc/gimple-fold.cc:6327 #13 0x00000000010be8ca in fold_stmt (gsi=3D0x7fffffffd740) at ../../src/gcc/gimple-fold.cc:6410 #14 0x0000000002c93123 in lower_stmt (gsi=3D0x7fffffffd740, data=3D0x7fffff= ffd950) at ../../src/gcc/gimple-low.cc:793 #15 0x0000000002c910ee in lower_sequence (seq=3D0x7fffea65d1b8, data=3D0x7fffffffd950) at ../../src/gcc/gimple-low.cc:229 #16 0x0000000002c935ff in lower_gimple_bind (gsi=3D0x7fffffffd860, data=3D0x7fffffffd950) at ../../src/gcc/gimple-low.cc:882 #17 0x0000000002c92d28 in lower_stmt (gsi=3D0x7fffffffd860, data=3D0x7fffff= ffd950) at ../../src/gcc/gimple-low.cc:650 #18 0x0000000002c910ee in lower_sequence (seq=3D0x7fffea65d178, data=3D0x7fffffffd950) at ../../src/gcc/gimple-low.cc:229 #19 0x0000000002c935ff in lower_gimple_bind (gsi=3D0x7fffffffd930, data=3D0x7fffffffd950) 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=3D0x3f43e20) at ../../src/gcc/gimple-low.cc:206 #22 0x000000000140ff5a in execute_one_pass (pass=3D) at ../../src/gcc/passes.cc:2644 2993 gimple *repl =3D gimple_build_call (fn_fwrite, 4, arg0, 2994 size_one_node, len, arg1); 2995 replace_call_with_call_and_fold (gsi, repl);=