[committed] correct strcmp() == 0 result for unknown strings (PR 92157)

Martin Sebor msebor@gmail.com
Fri Oct 18 22:48:00 GMT 2019


The optimization to fold (strcmp() == 0) results involving
arrays/strings of unequal size/length has a bug where it is
unprepared for the compute_string_length() function to return
an invalid length as an indication that the length is unknown.
This leads to some strings that are unequal being considered
equal.

The attached patch corrects this handling.  I have committed
it in r277194 with Jeff's okay.

Martin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-92157.diff
Type: text/x-patch
Size: 4415 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20191018/d5a0017f/attachment.bin>


More information about the Gcc-patches mailing list