diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-04-16 10:15:18 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-04-16 10:15:18 +0200 |
commit | 42e20fd25d3651349d892d8af864dc576c09019c (patch) | |
tree | 6cd4d332e0015e588afac756b2cfcf4a9f4e7b82 /gcc/function.c | |
parent | 2ca17e0a89ff6c37e17851a5bd7b0a03ee8de535 (diff) | |
download | gcc-42e20fd25d3651349d892d8af864dc576c09019c.zip gcc-42e20fd25d3651349d892d8af864dc576c09019c.tar.gz gcc-42e20fd25d3651349d892d8af864dc576c09019c.tar.bz2 |
bootstrap: Fix building with GCC 4.2 [PR89494]
GCC 4.2 (but I think not the latest tip of GCC 4.2 branch) has broken value
initialization, see PR33916. The following patch provides a workaround for
that. Tested with GCC 4.2 on a reduced testcase I've distilled from the
assign_param_data_one class which has been miscompiled the same.
2020-04-16 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/89494
* function.c (assign_parm_find_data_types): Add workaround for
BROKEN_VALUE_INITIALIZATION compilers.
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/function.c b/gcc/function.c index d8008f6..d616f5f 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -2414,7 +2414,15 @@ assign_parm_find_data_types (struct assign_parm_data_all *all, tree parm, { int unsignedp; +#ifndef BROKEN_VALUE_INITIALIZATION *data = assign_parm_data_one (); +#else + /* Old versions of GCC used to miscompile the above by only initializing + the members with explicit constructors and copying garbage + to the other members. */ + assign_parm_data_one zero_data = {}; + *data = zero_data; +#endif /* NAMED_ARG is a misnomer. We really mean 'non-variadic'. */ if (!cfun->stdarg) |