PR middle-end/96665 - memcmp of a constant string not folded
authorMartin Sebor <msebor@redhat.com>
Tue, 18 Aug 2020 18:57:18 +0000 (12:57 -0600)
committerMartin Sebor <msebor@redhat.com>
Tue, 18 Aug 2020 18:59:09 +0000 (12:59 -0600)
commitd367f5fcb579d21c3093cf5c464f5787fe584a1d
tree0d1778f66517b2fb0db3927b124acca6097b5282
parentbb04901d14f7749eb949092fd3dfcb6ca1958701
PR middle-end/96665 - memcmp of a constant string not folded

Related:
PR middle-end/78257 - missing memcmp optimization with constant arrays

gcc/ChangeLog:

PR middle-end/96665
PR middle-end/78257
* expr.c (convert_to_bytes): Replace statically allocated buffer with
a dynamically allocated one of sufficient size.

gcc/testsuite/ChangeLog:

PR middle-end/96665
PR middle-end/78257
* gcc.dg/memcmp-5.c: New test.
gcc/expr.c
gcc/testsuite/gcc.dg/memcmp-5.c [new file with mode: 0644]