public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "roger at nextmovesoftware dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112508] [14 Regression] Size regression when using -Os starting with r14-4089-gd45ddc2c04e Date: Thu, 15 Feb 2024 23:08:01 +0000 [thread overview] Message-ID: <bug-112508-4-2TnnJVRe8z@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-112508-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112508 Roger Sayle <roger at nextmovesoftware dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 CC| |roger at nextmovesoftware dot com Last reconfirmed| |2024-02-15 --- Comment #2 from Roger Sayle <roger at nextmovesoftware dot com> --- The issue appears to be with (poor costing in) loop invariant store motion. Adding the command line option "-fno-move-loop-stores" reduces the .s file from 149 lines to 54 lines, and the size of main (as reported by objdump -d) from 317 bytes to 73 bytes. To confirm that this isn't specific to this (possibly pathological/obscure) test case, I ran the CSiBE benchmark on x86_64, comparing "-Os" to "-Os -fno-move-loop-stores", which shows a net saving of 1606 bytes with -fno-move-loop-stores. There are cases where -fno-move-loop-stores reduces code size (on x86_64, and I've not investigated other targets), so I guess it would be preferrable to use more accurate size costs instead of just disabling this sub-pass. Note that the bigger hammer, -fno-tree-loop-im, also avoids the code growth, but the more precise/specific -fno-move-loop-stores is sufficient.
next prev parent reply other threads:[~2024-02-15 23:08 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-11-13 11:11 [Bug tree-optimization/112508] New: " theodort at inf dot ethz.ch 2023-11-13 11:15 ` [Bug tree-optimization/112508] " rguenth at gcc dot gnu.org 2024-02-15 23:08 ` roger at nextmovesoftware dot com [this message] 2024-02-16 8:11 ` rguenth at gcc dot gnu.org 2024-02-16 8:20 ` rguenth at gcc dot gnu.org 2024-03-07 21:02 ` law at gcc dot gnu.org 2024-05-07 7:42 ` [Bug tree-optimization/112508] [14/15 " rguenth at gcc dot gnu.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-112508-4-2TnnJVRe8z@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).