aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2019-01-04 03:13:33 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2019-01-03 20:13:33 -0700
commitdf161fc28087971e5f6b0696c2ae7826a38d9a73 (patch)
treea8b55b78fc5535fbf204bc6173c437999fc14a0e /gcc/calls.c
parent7880e17390e2e4af1cd8b2264d37b21960f2d1f0 (diff)
downloadgcc-df161fc28087971e5f6b0696c2ae7826a38d9a73.zip
gcc-df161fc28087971e5f6b0696c2ae7826a38d9a73.tar.gz
gcc-df161fc28087971e5f6b0696c2ae7826a38d9a73.tar.bz2
PR tree-optimization/88659 - ICE in maybe_warn_nonstring_arg
gcc/ChangeLog: * calls.c (maybe_warn_nonstring_arg): Avoid assuming maxlen is set. gcc/testsuite/ChangeLog: * gcc.dg/Wstringop-truncation-6.c: New test. From-SVN: r267569
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 04aafde..2e5d411 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1681,7 +1681,7 @@ maybe_warn_nonstring_arg (tree fndecl, tree exp)
bndrng[1] = maxlen;
bound = void_type_node;
}
- else
+ else if (maxlen)
{
/* Replace the bound on the operation with the upper bound
of the length of the string if the latter is smaller. */