From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9C4E9398B842; Sat, 16 Jan 2021 08:20:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C4E9398B842 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/96271] Failure to optimize memcmp of doubles to avoid going through memory Date: Sat, 16 Jan 2021 08:20:56 +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: 11.0 X-Bugzilla-Keywords: missed-optimization 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2021 08:20:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96271 --- Comment #6 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:b673e7547fb95d1f0d5cd17ae9e3874742cade66 commit r11-6747-gb673e7547fb95d1f0d5cd17ae9e3874742cade66 Author: Jakub Jelinek Date: Sat Jan 16 09:17:38 2021 +0100 cd_dce: Return TODO_update_address_taken from last cd_dce [PR96271] On the following testcase, handle_builtin_memcmp in the strlen pass fol= ds the memcmp into comparison of two MEM_REFs. But nothing triggers updat= ing of addressable vars afterwards, so even when the parameters are no long= er address taken, we force the parameters to stack and back anyway. This patch causes TODO_update_address_taken to happen right before last forwprop pass (at the end of last cd_dce), so after strlen1 too. 2021-01-16 Jakub Jelinek PR tree-optimization/96271 * passes.def: Pass false argument to first two pass_cd_dce instances and true to last instance. Add comment that last instance rewrites no longer addressed locals. * tree-ssa-dce.c (pass_cd_dce): Add update_address_taken_p memb= er and initialize it. (pass_cd_dce::set_pass_param): New method. (pass_cd_dce::execute): Return TODO_update_address_taken from last cd_dce instance. * gcc.target/i386/pr96271.c: New test.=