public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/19661] unnecessary atexit calls emitted for static objects with empty destructors Date: Tue, 07 May 2024 21:47:18 +0000 [thread overview] Message-ID: <bug-19661-4-MhwN7pORbQ@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-19661-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19661 --- Comment #20 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>: https://gcc.gnu.org/g:c9dd853680b12d9c9def5de61abde5d057c526ba commit r15-308-gc9dd853680b12d9c9def5de61abde5d057c526ba Author: Andrew Pinski <quic_apinski@quicinc.com> Date: Fri Mar 15 16:34:22 2024 -0700 DCE __cxa_atexit calls where the function is pure/const [PR19661] In C++ sometimes you have a deconstructor function which is "empty", like for an example with unions or with arrays. The front-end might not know it is empty either so this should be done on during optimization.o To implement it I added it to DCE where we mark if a statement is necessary or not. Bootstrapped and tested on x86_64-linux-gnu with no regressions. Changes since v1: * v2: Add support for __aeabi_atexit for arm-*eabi. Add extra comments. Add cxa_atexit-5.C testcase for -fPIC case. * v3: Fix testcases for the __aeabi_atexit (forgot to do in the v2). PR tree-optimization/19661 gcc/ChangeLog: * tree-ssa-dce.cc (is_cxa_atexit): New function. (is_removable_cxa_atexit_call): New function. (mark_stmt_if_obviously_necessary): Don't mark removable cxa_at_exit calls. (mark_all_reaching_defs_necessary_1): Likewise. (propagate_necessity): Likewise. gcc/testsuite/ChangeLog: * g++.dg/tree-ssa/cxa_atexit-1.C: New test. * g++.dg/tree-ssa/cxa_atexit-2.C: New test. * g++.dg/tree-ssa/cxa_atexit-3.C: New test. * g++.dg/tree-ssa/cxa_atexit-4.C: New test. * g++.dg/tree-ssa/cxa_atexit-5.C: New test. * g++.dg/tree-ssa/cxa_atexit-6.C: New test. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
next prev parent reply other threads:[~2024-05-07 21:47 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-19661-4@http.gcc.gnu.org/bugzilla/> 2021-09-24 7:41 ` antoshkka at gmail dot com 2022-11-02 15:47 ` pinskia at gcc dot gnu.org 2022-11-02 15:53 ` redi at gcc dot gnu.org 2022-11-02 17:16 ` redi at gcc dot gnu.org 2024-03-15 22:56 ` pinskia at gcc dot gnu.org 2024-03-15 23:40 ` pinskia at gcc dot gnu.org 2024-03-16 2:17 ` pinskia at gcc dot gnu.org 2024-03-16 22:47 ` i at maskray dot me 2024-04-19 0:39 ` pinskia at gcc dot gnu.org 2024-04-19 0:59 ` pinskia at gcc dot gnu.org 2024-05-07 21:47 ` cvs-commit at gcc dot gnu.org [this message] 2024-05-07 21:47 ` pinskia at gcc dot gnu.org [not found] <bug-19661-6649@http.gcc.gnu.org/bugzilla/> 2008-02-20 21:53 ` pinskia at gcc dot gnu dot org 2005-01-27 22:24 [Bug c++/19661] New: many redundant atexit calls emitted into the executable " yuri at tsoft dot com 2005-09-24 17:43 ` [Bug tree-optimization/19661] unnecessary atexit calls emitted " pinskia at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-19661-4-MhwN7pORbQ@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).