summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-strlen.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-05 18:09:56 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-05 18:09:56 +0000
commit725879e5caf2838593d887bfa5818fc4455af6c6 (patch)
tree99ed37acdae5a5c6f97be8b341cb72e795a2ff6d /gcc/tree-ssa-strlen.c
parent099bc03438cfca41bd79cc094604d6c82fd52363 (diff)
downloadgcc-725879e5caf2838593d887bfa5818fc4455af6c6.tar.gz
PR tree-optimization/50613
* tree-ssa-strlen.c (find_equal_ptrs): If CASE_CONVERT operand is ADDR_EXPR, fallthru into ADDR_EXPR handling, and if it is neither that not SSA_NAME, give up. * gcc.dg/pr50613.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179567 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-strlen.c')
-rw-r--r--gcc/tree-ssa-strlen.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index b2ee2f96f44..d997c73451e 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -692,6 +692,14 @@ find_equal_ptrs (tree ptr, int idx)
{
case SSA_NAME:
break;
+ CASE_CONVERT:
+ if (!POINTER_TYPE_P (TREE_TYPE (ptr)))
+ return;
+ if (TREE_CODE (ptr) == SSA_NAME)
+ break;
+ if (TREE_CODE (ptr) != ADDR_EXPR)
+ return;
+ /* FALLTHRU */
case ADDR_EXPR:
{
int *pidx = addr_stridxptr (TREE_OPERAND (ptr, 0));
@@ -699,10 +707,6 @@ find_equal_ptrs (tree ptr, int idx)
*pidx = idx;
return;
}
- CASE_CONVERT:
- if (POINTER_TYPE_P (TREE_TYPE (ptr)))
- break;
- return;
default:
return;
}