Do not put incomplete CONSTRUCTORs into static memory
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 5 May 2020 10:31:26 +0000 (12:31 +0200)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 5 May 2020 10:39:09 +0000 (12:39 +0200)
commit2badc9885330b56dfabb49328c42de792bc67b1e
treeb22c407697e40808090e2657de0ce0508a9a6f99
parent0424a5ece5307cc22bbc0fe97edf4707d7a798ed
Do not put incomplete CONSTRUCTORs into static memory

The CONSTRUCTOR_NO_CLEARING flag was invented to avoid generating a memset
for  CONSTRUCTORS that lack elements, but it turns out that the gimplifier
can generate a memcpy for them instead, which is worse performance-wise,
so this prevents it from doing that for them.

* gimplify.c (gimplify_init_constructor): Do not put the constructor
into static memory if it is not complete.
gcc/ChangeLog
gcc/gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/aggr29.adb [new file with mode: 0644]