aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-strlen.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2014-11-21 10:27:19 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2014-11-21 10:27:19 +0100
commit1e762c6ad828137e5cd2310e7acb2a6c80be17d1 (patch)
treec42b16609c961418091986ce3830bcb9a07f493c /gcc/tree-ssa-strlen.c
parentaa7da51a8c95366b781d0ce5e6cb046ef0aa899f (diff)
downloadgcc-1e762c6ad828137e5cd2310e7acb2a6c80be17d1.zip
gcc-1e762c6ad828137e5cd2310e7acb2a6c80be17d1.tar.gz
gcc-1e762c6ad828137e5cd2310e7acb2a6c80be17d1.tar.bz2
re PR tree-optimization/61773 (ICE in tree-ssa-strlen.c:417)
PR tree-optimization/61773 * tree-ssa-strlen.c (get_string_length): Don't assert stpcpy has been prototyped if si->stmt is BUILT_IN_MALLOC. * gcc.dg/pr61773.c: New test. From-SVN: r217910
Diffstat (limited to 'gcc/tree-ssa-strlen.c')
-rw-r--r--gcc/tree-ssa-strlen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index c02e612..7b1c0d9 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -430,7 +430,6 @@ get_string_length (strinfo si)
callee = gimple_call_fndecl (stmt);
gcc_assert (callee && DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL);
lhs = gimple_call_lhs (stmt);
- gcc_assert (builtin_decl_implicit_p (BUILT_IN_STPCPY));
/* unshare_strinfo is intentionally not called here. The (delayed)
transformation of strcpy or strcat into stpcpy is done at the place
of the former strcpy/strcat call and so can affect all the strinfos
@@ -479,6 +478,7 @@ get_string_length (strinfo si)
case BUILT_IN_STRCPY_CHK:
case BUILT_IN_STRCPY_CHKP:
case BUILT_IN_STRCPY_CHK_CHKP:
+ gcc_assert (builtin_decl_implicit_p (BUILT_IN_STPCPY));
if (gimple_call_num_args (stmt) == (with_bounds ? 4 : 2))
fn = builtin_decl_implicit (BUILT_IN_STPCPY);
else