From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A3347385842B; Fri, 3 Mar 2023 10:20:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3347385842B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677838836; bh=KiKGnh5jonqvFkwUA3mRWb4zZMHdL7dZDF3P5Mz2SoA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LfoZsKMzeGjjRAfYTgabIq34H6r1Lept3wUDKzz+nrSpOFJH4smOsJ3nZDR1IMSow TrSzQVOuECpZDRWOM/kCUIdI/b5647P9CkcWscc/2Uq5aa2ORYyUPoNx+tyRHDhUcq xOQoWO65fSW3kmH8F9nuUDTDz0OSCQ2tZRLef040= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108988] gimple_fold_builtin_fputs doesn't preserve gimple_builtin_call_types_compatible_p Date: Fri, 03 Mar 2023 10:20:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: internal-improvement X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub 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 #5 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:dbeccab7a1f5dcc1876c854f17816047ba1ef137 commit r13-6441-gdbeccab7a1f5dcc1876c854f17816047ba1ef137 Author: Jakub Jelinek Date: Fri Mar 3 11:13:40 2023 +0100 gimple-fold: Fix up fputs -> fwrite folding [PR108988] gimple_fold_builtin_fputs when folding fputs into fwrite emits the third argument (INTEGER_CST) with incorrect type - get_maxval_strlen or c_str= len return ssizetype, while fwrite argument is size_type_node. The following patch fixes that, I've skimmed through the rest of gimple-fold.cc and in all other places get_maxval_strlen/c_strlen result was fold_converted to size_type_node already (or GIMPLE cast stmt has b= een emitted directly etc.). 2023-03-03 Jakub Jelinek PR tree-optimization/108988 * gimple-fold.cc (gimple_fold_builtin_fputs): Fold len to size_type_node before passing it as argument to fwrite. Format= ting fixes.=