aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-05-29 10:42:50 +0200
committerJakub Jelinek <jakub@redhat.com>2020-05-29 10:42:50 +0200
commit43a4fc095e30188392cc42299c4081297e321104 (patch)
treecd0e53fe7a69dc8af7e9a3faa9e09965cf413cb6 /gcc/tree-vectorizer.h
parent07852a81f58532c63a57631d7c3757fc6bcea17d (diff)
downloadgcc-43a4fc095e30188392cc42299c4081297e321104.zip
gcc-43a4fc095e30188392cc42299c4081297e321104.tar.gz
gcc-43a4fc095e30188392cc42299c4081297e321104.tar.bz2
expander: Optimize store_expr from STRING_CST [PR95052]
In the following testcase, store_expr of e.g. 97 bytes long string literal into 1MB long array is implemented by copying the 97 bytes from .rodata section, followed by clearing the remaining bytes. But, as the STRING_CST has type char[1024*1024], we actually allocate whole 1MB in .rodata section for it, even when we only use the first 97 bytes from that. The following patch tweaks it so that if we are going to initialize only the small part from it, we don't emit all the zeros that we never use after it. 2020-05-29 Jakub Jelinek <jakub@redhat.com> PR middle-end/95052 * expr.c (store_expr): If expr_size is constant and significantly larger than TREE_STRING_LENGTH, set temp to just the TREE_STRING_LENGTH portion of the STRING_CST. * gcc.target/i386/pr95052.c: New test.
Diffstat (limited to 'gcc/tree-vectorizer.h')
0 files changed, 0 insertions, 0 deletions