asan.c (instrument_assignment): Instrument lhs only for gimple_store_p and rhs1 only...
authorJakub Jelinek <jakub@redhat.com>
Mon, 3 Dec 2012 13:57:29 +0000 (14:57 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 3 Dec 2012 13:57:29 +0000 (14:57 +0100)
* asan.c (instrument_assignment): Instrument lhs only
for gimple_store_p and rhs1 only for gimple_assign_load_p.

From-SVN: r194087

gcc/ChangeLog
gcc/asan.c

index a886c0480cdd1e2331d5ea4521fdfb70779da672..455420e672fc762b84fecb21120b41d22302b4a3 100644 (file)
@@ -1,3 +1,8 @@
+2012-12-03  Jakub Jelinek  <jakub@redhat.com>
+
+       * asan.c (instrument_assignment): Instrument lhs only
+       for gimple_store_p and rhs1 only for gimple_assign_load_p.
+
 2012-12-03  Michael Zolotukhin  <michael.v.zolotukhin@intel.com>
 
        * Makefile.in: Add target mddump, build/genmddump.o.  Extend
index 26c4178a9f073d2a69a019d7fac60f39e5b75feb..2563a305b20b7659f4191c7f2bf2517b8831b806 100644 (file)
@@ -1339,10 +1339,12 @@ instrument_assignment (gimple_stmt_iterator *iter)
 
   gcc_assert (gimple_assign_single_p (s));
 
-  instrument_derefs (iter, gimple_assign_lhs (s),
-                    gimple_location (s), true);
-  instrument_derefs (iter, gimple_assign_rhs1 (s),
-                    gimple_location (s), false);
+  if (gimple_store_p (s))
+    instrument_derefs (iter, gimple_assign_lhs (s),
+                      gimple_location (s), true);
+  if (gimple_assign_load_p (s))
+    instrument_derefs (iter, gimple_assign_rhs1 (s),
+                      gimple_location (s), false);
 }
 
 /* Instrument the function call pointed to by the iterator ITER, if it