public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/105728] dead store to static var not optimized out Date: Fri, 27 May 2022 06:25:35 +0000 [thread overview] Message-ID: <bug-105728-4-6LVLSwEIEH@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-105728-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105728 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|c |ipa Last reconfirmed| |2022-05-27 Ever confirmed|0 |1 Keywords| |missed-optimization CC| |hubicka at gcc dot gnu.org, | |marxin at gcc dot gnu.org, | |rguenth at gcc dot gnu.org Status|UNCONFIRMED |NEW --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- the dummy1/dummy2 optimizations could eventually be done by DCE if we knew that 'removeme' is only ever accessed from 'dummy1' / 'dummy2', in that case we could consider the variable local and since there's no data dependence on it we could elide it. Don't we track that already in IPA? I think local passes cannot rely on IPA references? We also need to consider void foo (int *); int dummy1() { static int removeme = 0; static int *p = &removeme; foo (p); if (removeme) { return 0; } removeme = 1; return 0; } thus global CTORs (the above will see the init in dummy1(), but not sure whether we can rely on that?)
next prev parent reply other threads:[~2022-05-27 6:25 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-05-25 14:14 [Bug c/105728] New: " felix-gcc at fefe dot de 2022-05-25 16:21 ` Jan Hubicka 2022-05-25 16:21 ` [Bug c/105728] " hubicka at kam dot mff.cuni.cz 2022-05-27 6:25 ` rguenth at gcc dot gnu.org [this message] 2022-05-27 12:24 ` [Bug ipa/105728] " rguenth at gcc dot gnu.org 2022-05-27 13:16 ` felix-gcc at fefe dot de
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-105728-4-6LVLSwEIEH@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).