From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C9B22385842C; Mon, 4 Sep 2023 13:06:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C9B22385842C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693832807; bh=rgXihpKCG9gN5MGU82HtOBGnCHFclXFeLEuXarog/LM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ftErNvq7aqypKy8e3gOlxIB/rJAuPrq0dNyLK92N0IuoPeTG7JzTX2YIS1Qdn73Se NBT7lsEPbdOhnxvY8y9UcO6NDeIn+VCBobRpPF9gWfTeTfTe/4z/gT56fUZZbelkwY 13iC7mVKYMx9zww68QN+r1JQ2bnxcmK+6ijo+jKk= From: "philipp.tomsich at vrull dot eu" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/109393] Very trivial address calculation does not fold Date: Mon, 04 Sep 2023 13:06:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: philipp.tomsich at vrull dot eu X-Bugzilla-Status: NEW 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=3D109393 --- Comment #8 from philipp.tomsich at vrull dot eu --- On Mon, 4 Sept 2023 at 13:38, manolis.tsamis at vrull dot eu < gcc-bugzilla@gcc.gnu.org> wrote: > My current match.pd pattern to do that is below; any feedback or > improvements > are welcome. > > (simplify > (mult (convert@3 (plus @0 INTEGER_CST@1)) INTEGER_CST@2) > (with { tree tt =3D TREE_TYPE(@3); } > (if (INTEGRAL_TYPE_P (type) > && !TYPE_SATURATING (type) > && !TYPE_OVERFLOW_TRAPS (type) > && !TYPE_OVERFLOW_SANITIZED (type) > && !TYPE_OVERFLOW_WRAPS (TREE_TYPE (@0))) > (plus (mult (convert:tt @0) @2) (mult (convert:tt @1) @2))))) > Please attach a current .patch to this ticket to make sure that there are no surprises in reproducing.=