]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
asan.c (build_check_stmt): Fix maybe-uninitialized warning.
authorYury Gribov <y.gribov@samsung.com>
Mon, 16 Jun 2014 18:31:22 +0000 (18:31 +0000)
committerYury Gribov <ygribov@gcc.gnu.org>
Mon, 16 Jun 2014 18:31:22 +0000 (18:31 +0000)
2014-06-16  Yury Gribov  <y.gribov@samsung.com>

* asan.c (build_check_stmt): Fix maybe-uninitialized warning.

From-SVN: r211713

gcc/ChangeLog
gcc/asan.c

index b74893a59ec94486ae79302337009b1fa00ecb99..bc36d0683e479684e454c2cee80ee3f541c50170 100644 (file)
@@ -1,3 +1,7 @@
+2014-06-16  Yury Gribov  <y.gribov@samsung.com>
+
+       * asan.c (build_check_stmt): Fix maybe-uninitialized warning.
+
 2014-06-16  Vladimir Makarov  <vmakarov@redhat.com>
 
        PR rtl-optimization/61522
index 19e15247766de6bc1d3f56b1d11ea3dec3fe44ed..281a7956bbe64e1d11763922683074f75bf861d8 100644 (file)
@@ -1636,6 +1636,13 @@ build_check_stmt (location_t location, tree base, tree len,
 
   gcc_assert (!(size_in_bytes > 0 && !non_zero_len_p));
 
+  if (start_instrumented && end_instrumented)
+    {
+      if (!before_p)
+        gsi_next (iter);
+      return;
+    }
+
   if (len)
     len = unshare_expr (len);
   else
@@ -1735,7 +1742,7 @@ build_check_stmt (location_t location, tree base, tree len,
   gsi_insert_after (&gsi, g, GSI_NEW_STMT);
   tree base_addr = gimple_assign_lhs (g);
 
-  tree t;
+  tree t = NULL_TREE;
   if (real_size_in_bytes >= 8)
     {
       tree shadow = build_shadow_mem_access (&gsi, location, base_addr,