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

--- Comment #2 from David Faust <david.faust at oracle dot com> ---
Created attachment 62061
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62061&action=edit
proposed patch

Use unsigned HOST_WIDE_INT (which should always be 64 bits) when calculating
the array bounds so we can at least know that we overflowed uint32.  The value
stored in DW_AT_upper_bound can be >32-bits.

Seems like falling back to CTF_K_UNKNOWN is the only safe option since anything
else misrepresents the array size with no way for a CTF consumer to know.

If we want a useful warning though I think we'll have to pass down source
location info from the variable/member/whatever decl. is using the problematic
type. Otherwise we don't have a location nor name to use, and the diagnostic
from warning () points to the last source line.

Reply via email to