2012-05-15 Tristan Gingold <gingold@adacore.com>
authorgingold <gingold@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 May 2012 09:31:45 +0000 (09:31 +0000)
committergingold <gingold@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 May 2012 09:31:45 +0000 (09:31 +0000)
      * tree-ssa-strlen.c (get_string_length): Convert lhs if needed.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187507 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-ssa-strlen.c

index ba4cd85..da1587e 100644 (file)
@@ -1,3 +1,7 @@
+2012-05-15  Tristan Gingold  <gingold@adacore.com>
+
+      * tree-ssa-strlen.c (get_string_length): Convert lhs if needed.
+
 2012-05-15  Richard Guenther  <rguenther@suse.de>
 
        * gimple.c (gimple_set_modified): Move ...
@@ -26,7 +30,7 @@
 
        * doc/md.texi (fma): Define to only be applicable for single
        rounding.
-       
+
 2012-05-14  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/46098
index a37633a..05fd10d 100644 (file)
@@ -427,6 +427,12 @@ get_string_length (strinfo si)
                                    NULL);
          add_referenced_var (lhs_var);
          tem = gimple_call_arg (stmt, 0);
+          if (!ptrofftype_p (TREE_TYPE (lhs)))
+            {
+              lhs = convert_to_ptrofftype (lhs);
+              lhs = force_gimple_operand_gsi (&gsi, lhs, true, NULL_TREE,
+                                              true, GSI_SAME_STMT);
+            }
          lenstmt
            = gimple_build_assign_with_ops (POINTER_PLUS_EXPR,
                                            make_ssa_name (lhs_var, NULL),