Re: [PATCH] avoid assuming arrays have nonzero size (PR 88956)

2019-01-29 Thread Martin Sebor
On 1/29/19 11:23 AM, Jakub Jelinek wrote: --- gcc/gimple-fold.c (revision 268086) +++ gcc/gimple-fold.c (working copy) @@ -6715,12 +6715,14 @@ fold_array_ctor_reference (tree type, tree ctor, elt_size = wi::to_offset (TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (ctor; /* When TYPE is

Re: [PATCH] avoid assuming arrays have nonzero size (PR 88956)

2019-01-29 Thread Jakub Jelinek
On Tue, Jan 22, 2019 at 06:18:28PM -0700, Martin Sebor wrote: > PS In GCC 10, unless there is an important use case that escapes > me, I think GCC should warn for zero-length non-member array > objects, or perhaps even for internal struct members (those followed > by another member). Not to avoid

Re: [PATCH] avoid assuming arrays have nonzero size (PR 88956)

2019-01-29 Thread Martin Sebor
On 1/29/19 5:44 AM, Richard Sandiford wrote: Martin Sebor writes: Ping: https://gcc.gnu.org/ml/gcc-patches/2019-01/msg01340.html This is a straightforward fix for an ICE. I will commit it tomorrow unless there are suggestions for other changes. That's not how it works. Please wait for the

Re: [PATCH] avoid assuming arrays have nonzero size (PR 88956)

2019-01-29 Thread Richard Sandiford
Martin Sebor writes: > Ping: https://gcc.gnu.org/ml/gcc-patches/2019-01/msg01340.html > > This is a straightforward fix for an ICE. I will commit it tomorrow > unless there are suggestions for other changes. That's not how it works. Please wait for the patch to be approved by someone. Thanks,

Re: [PATCH] avoid assuming arrays have nonzero size (PR 88956)

2019-01-28 Thread Martin Sebor
Ping: https://gcc.gnu.org/ml/gcc-patches/2019-01/msg01340.html This is a straightforward fix for an ICE. I will commit it tomorrow unless there are suggestions for other changes. On 1/22/19 6:18 PM, Martin Sebor wrote: The enhancement to treat char initializer-lists as STRING_CSTs committed ea

Re: [PATCH] avoid assuming arrays have nonzero size (PR 88956)

2019-01-22 Thread Joseph Myers
On Tue, 22 Jan 2019, Martin Sebor wrote: > PS In GCC 10, unless there is an important use case that escapes > me, I think GCC should warn for zero-length non-member array > objects, or perhaps even for internal struct members (those followed > by another member). Not to avoid these sorts of bugs

[PATCH] avoid assuming arrays have nonzero size (PR 88956)

2019-01-22 Thread Martin Sebor
The enhancement to treat char initializer-lists as STRING_CSTs committed earlier last year introduced an assumption that array elements have a non-zero size. As it turns out, the zero-length array extension that makes it possible to define even multi- dimensional zero-length array objects breaks