This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
ptx preliminary address space fixes [4/4]
- From: Bernd Schmidt <bernds at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 11 Sep 2014 12:12:38 +0200
- Subject: ptx preliminary address space fixes [4/4]
- Authentication-results: sourceware.org; auth=none
This one isn't a wrong-code issue, just a missed optimization. The
strlen optimizations need to be made to look through
ADDR_SPACE_CONVERT_EXPR to work on ptx.
Bootstrapped and tested together with the other patches on x86_64-linux.
Ok?
Bernd
commit 35d765aeba4ea7d0ba829b2b502c8c7af0c24728
Author: Bernd Schmidt <bernds@codesourcery.com>
Date: Wed Sep 10 16:34:04 2014 +0200
* tree-ssa-strlen.c (strlen_optimize_stmt): Look through
ADDR_SPACE_CONVERT_EXPR.
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index bb42cc7..f72ecf5 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -1930,6 +1930,7 @@ strlen_optimize_stmt (gimple_stmt_iterator *gsi)
if (TREE_CODE (lhs) == SSA_NAME && POINTER_TYPE_P (TREE_TYPE (lhs)))
{
if (gimple_assign_single_p (stmt)
+ || gimple_assign_rhs_code (stmt) == ADDR_SPACE_CONVERT_EXPR
|| (gimple_assign_cast_p (stmt)
&& POINTER_TYPE_P (TREE_TYPE (gimple_assign_rhs1 (stmt)))))
{