On 09/11/2014 01:41 PM, Richard Biener wrote:
On Thu, Sep 11, 2014 at 12:12 PM, Bernd Schmidt <ber...@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?

I did now (full test on x86_64, and also tested with ptx), and that also appears to work. Ok?


Bernd

diff --git a/gcc/gimple.h b/gcc/gimple.h
index ec41585..8d4032b 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -2384,9 +2384,10 @@ gimple_assign_cast_p (const_gimple s)
   if (is_gimple_assign (s))
     {
       enum tree_code sc = gimple_assign_rhs_code (s);
-      return CONVERT_EXPR_CODE_P (sc)
-	     || sc == VIEW_CONVERT_EXPR
-	     || sc == FIX_TRUNC_EXPR;
+      return (CONVERT_EXPR_CODE_P (sc)
+	      || sc == VIEW_CONVERT_EXPR
+	      || sc == FIX_TRUNC_EXPR
+	      || sc == ADDR_SPACE_CONVERT_EXPR);
     }
 
   return false;

Reply via email to