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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |msebor at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think we have various dups of this, the FE emits STRING_CST with VLA array
type which is invalid.
This happens in digest_init_r, which for init being STRING_CST does:
          if (type != TREE_TYPE (init))
            {
              init = copy_node (init);
              TREE_TYPE (init) = type;
            }
I think if type is VLA, we should just keep the STRING_CST as is and do
something like __builtin_memcpy from the STRING_CST to the VLA, maybe followed
by __builtin_memset for the remainder if the STRING_CST is shorter than the VLA
size.

I can surely work around this in asan.c by ignoring STRING_CSTs with
non-constant sizes, but that just seems to be papering over the real bug.

Reply via email to