This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, obvious?] Some minor nits in string folding functions

On 07/19/2018 12:04 PM, Bernd Edlinger wrote:

this fixes a few minor nits, which I spotted while
looking at the string folding functions:

Please hold off until the patch for bug 86532 has been reviewed,
approved, and committed.  I'm making changes in this area,
partly to address some of your comments on it, including some
of the same ones you are making here.  It doesn't help for you
to be making other changes to the same code at the same time.


string_constant: Remove impossible check: TREE_CODE (arg)
can't be COMPONENT_REF and MEM_REF at the same time.

c_strlen: maxelts is (signed) HOST_WIDE_INT, therefore
use tree_to_shwi.

c_getstr: tree_to_uhwi needs to be protected by

BTW: c_getstr uses string_constant which appears to be
able to extract wide char string initializers, but c_getstr
does not seem to be prepared for wide char strings:

   else if (string[string_length - 1] != '\0')
       /* Support only properly NUL-terminated strings but handle
          consecutive strings within the same array, such as the six
          substrings in "1\0002\0003".  */
       return NULL;

Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
Is it OK for trunk?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]