public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "krzysztof.a.nowicki+gcc at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/95052] Excess padding of partially initialized strings/char arrays
Date: Mon, 11 May 2020 13:18:50 +0000	[thread overview]
Message-ID: <bug-95052-4-m5p2MDoQVS@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-95052-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95052

--- Comment #3 from Krzysztof Nowicki <krzysztof.a.nowicki+gcc at gmail dot com> ---
Note, that this missed optimization is actually a regression (at least in our
case on MIPS64). Commit 23aa9f7c4637ad51587e536e245ae6adb5391bbc (released in
GCC 8.x) added the possibility to optimize initialization of a char array into
a string initialization. This means that this code:

  #include <unistd.h>
  int main(int argc, char *argv[])
  { 
    char buf[1*1024*1024] = { 0 };
    return read(0, buf, sizeof buf);
  }

generates the following binary sizes for MIPS64:

 * 13632 bytes (GCC-6.4)
 * 1061656 bytes (GCC-9.1)

  parent reply	other threads:[~2020-05-11 13:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 10:50 [Bug c/95052] New: " krzysztof.a.nowicki+gcc at gmail dot com
2020-05-11 11:32 ` [Bug c/95052] " rguenth at gcc dot gnu.org
2020-05-11 13:07 ` krzysztof.a.nowicki+gcc at gmail dot com
2020-05-11 13:18 ` krzysztof.a.nowicki+gcc at gmail dot com [this message]
2020-05-11 14:41 ` [Bug target/95052] " msebor at gcc dot gnu.org
2020-05-11 14:51 ` krzysztof.a.nowicki+gcc at gmail dot com
2020-05-11 19:06 ` [Bug middle-end/95052] " jakub at gcc dot gnu.org
2020-05-13  5:05 ` krzysztof.a.nowicki+gcc at gmail dot com
2020-05-13 12:33 ` [Bug middle-end/95052] [9/10/11 Regression] " pinskia at gcc dot gnu.org
2020-05-29  8:43 ` cvs-commit at gcc dot gnu.org
2020-05-29 13:27 ` mkuvyrkov at gcc dot gnu.org
2020-05-29 14:22 ` mkuvyrkov at gcc dot gnu.org
2020-05-29 14:26 ` mkuvyrkov at gcc dot gnu.org
2020-05-29 19:37 ` jakub at gcc dot gnu.org
2020-05-31  9:55 ` cvs-commit at gcc dot gnu.org
2020-08-03 11:10 ` ptsneves at gmail dot com
2021-01-14  8:46 ` [Bug middle-end/95052] [9/10 " rguenth at gcc dot gnu.org
2021-06-01  8:17 ` rguenth at gcc dot gnu.org
2022-05-27  9:42 ` [Bug middle-end/95052] [10 " rguenth at gcc dot gnu.org
2022-06-28 10:40 ` jakub at gcc dot gnu.org
2023-07-07  8:52 ` 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-95052-4-m5p2MDoQVS@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: link
Be 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).