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

--- Comment #4 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
build_vec_init_elt (tree.c) says:

/* Subroutine of build_vec_init_expr: Build up a single element
   intialization as a proxy for the full array initialization to get things
   marked as used and any appropriate diagnostics.

   Since we're deferring building the actual constructor calls until
   gimplification time, we need to build one now and throw it away so
   that the relevant constructor gets mark_used before cgraph decides
   what functions are needed.  Here we assume that init is either
   NULL_TREE, void_type_node (indicating value-initialization), or
   another array to copy.  */

With constexprs now in play, that appears to be an incorrect approach.   I'm
not sure why it's even sensible to go building things early only to throw them
away and redo it.  It would seem better to just build the constructor (or
whatever) tree and keep it.

Reply via email to