From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 31DB83858CDB; Thu, 2 Mar 2023 09:38:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 31DB83858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677749922; bh=8Fb8k1BXCTfoSb0hhVQvN6KQRE780DFwcPzeaFsmVYY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LpHb/RpvIKsCrmSSz4D3yl8s620KjMEROUfBfpPKOQZBHHEq2pRjWVI7OKm6yNCQu PqN+Fui9TEOv0x9Nt+3hhujkCbwmLIAyGzf3J3e0xSWRxqBlBPSKS+ArljoTW/bcBL vfeAd1Y0wRiBBypQTbLaK2h6wb1j3Up9z8SgAPhg= From: "jakub 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: Thu, 02 Mar 2023 09:38:35 +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: jakub 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: cc bug_status assigned_to attachments.created 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 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gn= u.org --- Comment #4 from Jakub Jelinek --- Created attachment 54569 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54569&action=3Dedit gcc13-pr108988.patch Untested fix. In this function len is already checked to be INTEGER_CST, so just fold_convert is sufficient. Went through the whole gimple-fold.cc and all other values computed by c_strlen or get_maxval_strlen etc. are properly folded to size_type_node when needed.=