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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Yann Droneaud from comment #4)
> I'm still playing with this, for example https://godbolt.org/z/dfjr8veh5,
> and I've noticed the size of the compound_initializer is incorrect too:
> Maybe it's the result of computing the size as 3 + -3 + 1, but it's far
> fetched.

Yes the .size is wrong. But it does not matter much as the ICE on the trunk is
definitely showing there are more issues.

Also yes the ICE is due to checking being enabled:
          gcc_checking_assert (check_string_literal (exp, size));

static bool
check_string_literal (tree string, unsigned HOST_WIDE_INT size)
{
  tree type = TREE_TYPE (string);
  tree eltype = TREE_TYPE (type);
  unsigned HOST_WIDE_INT elts = tree_to_uhwi (TYPE_SIZE_UNIT (eltype));
  unsigned HOST_WIDE_INT mem_size = tree_to_uhwi (TYPE_SIZE_UNIT (type));


The ICE is in that last tree_to_uhwi .

Reply via email to