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

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Bernd Edlinger from comment #11)
> Instead of:
> 
>             if (thissize == 0
>                 || TREE_STRING_POINTER (str) [thissize - 1] != '\0')
>               size = MAX (size, thissize + 1);
> 
> maybe:
> 
>             if (thissize != 0
>                 && TREE_STRING_POINTER (str) [thissize - 1] != '\0')
>               size = MAX (size, thissize + 1);

Well, it matches what output_constant does:
        case STRING_CST:
          thissize = (unsigned HOST_WIDE_INT)TREE_STRING_LENGTH (exp);
          if (merge_strings
              && (thissize == 0
                  || TREE_STRING_POINTER (exp) [thissize - 1] != '\0'))
            thissize++;
(using MAX just in case there is already some extra padding in the length or
whatever else).

Reply via email to