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)