]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-ssa-strlen.c (get_string_length): Convert lhs if needed.
authorTristan Gingold <gingold@adacore.com>
Tue, 15 May 2012 09:31:45 +0000 (09:31 +0000)
committerTristan Gingold <gingold@gcc.gnu.org>
Tue, 15 May 2012 09:31:45 +0000 (09:31 +0000)
2012-05-15  Tristan Gingold  <gingold@adacore.com>

      * tree-ssa-strlen.c (get_string_length): Convert lhs if needed.

From-SVN: r187507

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

index ba4cd854f5a1a021591feb53f55001a6d4c29b7a..da1587e47dff91f0b693b83b02a7c02ccf6584b7 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 a37633a920f227406df372484eabdfd312253065..05fd10d6d53d3e4be069d549ac12001f1e6b319a 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),