diff mbox

ptx preliminary address space fixes [4/4]

Message ID 54117596.1070309@codesourcery.com
State New
Headers show

Commit Message

Bernd Schmidt Sept. 11, 2014, 10:12 a.m. UTC
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

Comments

Richard Biener Sept. 11, 2014, 11:41 a.m. UTC | #1
On Thu, Sep 11, 2014 at 12:12 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> 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?

Did you try adding ADDR_SPACE_CONVERT_EXPR to the tree codes
handled in gimple_assign_cast_p?

Thanks,
Richard.

>
> Bernd
diff mbox

Patch

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)))))
 	    {