@@ -1,3 +1,11 @@
+2014-11-04 David Malcolm <dmalcolm@redhat.com>
+
+ * asan.c (get_mem_ref_of_assignment): Weaken param "assignment"
+ from const gassign * to gassign *.
+ * gimple.h (gimple_assign_single_p): Eliminate const_gimple variant,
+ since this could call itself, leading to an infinite recursion.
+ (gimple_assign_load_p): Likewise.
+
2014-11-03 David Malcolm <dmalcolm@redhat.com>
* ipa-polymorphic-call.c (walk_ssa_copies): Add checked cast.
@@ -465,7 +465,7 @@ has_mem_ref_been_instrumented (const asan_mem_ref *ref, tree len)
otherwise. */
static bool
-get_mem_ref_of_assignment (const gassign *assignment,
+get_mem_ref_of_assignment (gassign *assignment,
asan_mem_ref *ref,
bool *ref_is_store)
{
@@ -2487,21 +2487,13 @@ gimple_assign_rhs_class (const_gimple gs)
return get_gimple_rhs_class (gimple_assign_rhs_code (gs));
}
-/* Return true if GS is an assignment with a singleton RHS, i.e.,
- there is no operator associated with the assignment itself.
- Unlike gimple_assign_copy_p, this predicate returns true for
+/* Return GS (as a gassign *) if GS is an assignment with a singleton
+ RHS, i.e., there is no operator associated with the assignment itself,
+ Otherwise, return NULL.
+ Unlike gimple_assign_copy_p, this predicate returns non-NULL for
any RHS operand, including those that perform an operation
and do not have the semantics of a copy, such as COND_EXPR. */
-static inline bool
-gimple_assign_single_p (const_gimple gs)
-{
- return gimple_assign_single_p (const_cast <gimple> (gs));
-}
-
-/* As above, but non-const, and return GS as a gassign * if
- the predicate holds. */
-
static inline gassign *
gimple_assign_single_p (gimple gs)
{
@@ -2521,16 +2513,8 @@ gimple_store_p (const_gimple gs)
return lhs && !is_gimple_reg (lhs);
}
-/* Return true if GS is an assignment that loads from its rhs1. */
-
-static inline bool
-gimple_assign_load_p (const_gimple gs)
-{
- return gimple_assign_load_p (const_cast <gimple> (gs));
-}
-
-/* As above, but non-const, and return GS as a gassign * if
- the predicate holds. */
+/* Return GS (as a gassign *) if GS is an assignment that loads from its rhs1,
+ or NULL otherwise. */
static inline gassign *
gimple_assign_load_p (gimple gs)