diff options
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/function.c b/gcc/function.c index 9f96031..1170742 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -837,6 +837,11 @@ assign_temp (type, keep, memory_required, dont_promote) HOST_WIDE_INT size = int_size_in_bytes (type); rtx tmp; + /* Zero sized arrays are GNU C extension. Set size to 1 to avoid + problems with allocating the stack space. */ + if (size == 0) + size = 1; + /* Unfortunately, we don't yet know how to allocate variable-sized temporaries. However, sometimes we have a fixed upper limit on the size (which is stored in TYPE_ARRAY_MAX_SIZE) and can use that |