Definition weak_mapsto_ sh e rho :=
match (eval_expr e rho) with
| Vptr b o => (mapsto_ sh (typeof e) (Vptr b o)) ||
(mapsto_ sh (typeof e) (Vptr b o))
| _ => FF
end.

Lemma semax_ptr_compare:
forall (Delta: tycontext) (P: assert) id cmp e1 e2 ty sh1 sh2,
nonidentity sh1 -> nonidentity sh2 ->
is_comparison cmp = true  ->
eqb_type (typeof e1) int_or_ptr_type = false ->
eqb_type (typeof e2) int_or_ptr_type = false ->
(typecheck_tid_ptr_compare Delta id = true) ->
semax Espec Delta
(fun rho =>
|> (tc_expr Delta e1 rho && tc_expr Delta e2 rho  &&
!!(blocks_match cmp (eval_expr e1 rho) (eval_expr e2 rho)) &&
(mapsto_ sh1 (typeof e1) (eval_expr e1 rho) * TT) &&
(mapsto_ sh2 (typeof e2) (eval_expr e2 rho) * TT) &&
P rho))
(Sset id (Ebinop cmp e1 e2 ty))
(normal_ret_assert
(fun rho => (EX old:val,
!!(eval_id id rho =  subst id old
(eval_expr (Ebinop cmp e1 e2 ty)) rho) &&
subst id old P rho))).