https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89314
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Fri Aug 30 11:52:29 2019 New Revision: 275110 URL: https://gcc.gnu.org/viewcvs?rev=275110&root=gcc&view=rev Log: Backported from mainline 2019-02-14 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/89314 * fold-const.c (fold_binary_loc): Cast strlen argument to const char * before dereferencing it. Formatting fixes. * gcc.dg/pr89314.c: New test. Added: branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr89314.c Modified: branches/gcc-7-branch/gcc/ChangeLog branches/gcc-7-branch/gcc/fold-const.c branches/gcc-7-branch/gcc/testsuite/ChangeLog