https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121411

David Faust <david.faust at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick.alcock at oracle dot com

--- Comment #1 from David Faust <david.faust at oracle dot com> ---
The problem here is the array type.  I don't think CTF (v3) has a
representation for an array with more than 0xffff_ffff elements.  Format spec
for arrays is:

typedef struct ctf_array
{
  uint32_t cta_contents;
  uint32_t cta_index;
  uint32_t cta_nelems;
} ctf_array_t;

In this case it is the array nelems which is wrapping to 0. If such an array is
a member in the struct then the member size is sizeof (int [0]) = 0.

If we have:
 int dummy [0x100000007];
then we wrap to int[7] etc.

So, this is a limitation of the format, but it is also definitely not good to
misrepresent array size due to uint32 wrapping.  A warning certainly seems
warranted here.  Should also make a decision on what to encode for such an
array.

Reply via email to