diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-07 15:34:43 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-07 15:34:43 +0000 |
commit | 789a8d72f35c340e98859cb1ecdf72d70573bdbf (patch) | |
tree | 4175c00ea44d892ce1035c8ff1cbaf29665e98fe /gcc/tree-ssa-strlen.c | |
parent | 71e72cc261bbd16dad0ec1ca9731fa4fe3eb9f74 (diff) | |
download | gcc-789a8d72f35c340e98859cb1ecdf72d70573bdbf.tar.gz |
2013-01-07 Richard Biener <rguenther@suse.de>
PR middle-end/55890
* gimple.h (gimple_call_builtin_p): New overload.
* gimple.c (validate_call): New function.
(gimple_call_builtin_p): Likewise.
* tree-ssa-structalias.c (find_func_aliases_for_builtin_call):
Use gimple_call_builtin_p.
(find_func_clobbers): Likewise.
* tree-ssa-strlen.c (adjust_last_stmt): Likewise.
(strlen_optimize_stmt): Likewise.
* gcc.dg/torture/pr55890-1.c: New testcase.
* gcc.dg/torture/pr55890-2.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194975 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-strlen.c')
-rw-r--r-- | gcc/tree-ssa-strlen.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c index aa8b3d69164..a574a83fe43 100644 --- a/gcc/tree-ssa-strlen.c +++ b/gcc/tree-ssa-strlen.c @@ -807,12 +807,10 @@ adjust_last_stmt (strinfo si, gimple stmt, bool is_strcat) return; } - if (!is_gimple_call (last.stmt)) - return; - callee = gimple_call_fndecl (last.stmt); - if (callee == NULL_TREE || DECL_BUILT_IN_CLASS (callee) != BUILT_IN_NORMAL) + if (!gimple_call_builtin_p (last.stmt, BUILT_IN_NORMAL)) return; + callee = gimple_call_fndecl (last.stmt); switch (DECL_FUNCTION_CODE (callee)) { case BUILT_IN_MEMCPY: @@ -1750,7 +1748,7 @@ strlen_optimize_stmt (gimple_stmt_iterator *gsi) if (is_gimple_call (stmt)) { tree callee = gimple_call_fndecl (stmt); - if (callee && DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL) + if (gimple_call_builtin_p (stmt, BUILT_IN_NORMAL)) switch (DECL_FUNCTION_CODE (callee)) { case BUILT_IN_STRLEN: |