Local Open Scope logic.
Section SEMAX_SC.
Context {cs: compspecs}.

Lemma semax_SC_field_store:
forall {Espec: OracleKind},
forall Delta sh n (p: val) P Q R (e1 e2 : expr)
(t_root: type) (gfs0 gfs1 gfs: list gfield)
(v0: reptype (nested_field_type (nested_field_type t_root gfs0) gfs1))
(v0_val: val) (v v_new: reptype (nested_field_type t_root gfs0)),
typeof e1 = nested_field_type t_root gfs ->
type_is_by_value (nested_field_type t_root gfs) = true ->
type_is_volatile (nested_field_type t_root gfs) = false ->
gfs = gfs1 ++ gfs0 ->
nth_error R n = Some (field_at sh t_root gfs0 v p) ->
ENTAIL Delta, PROPx P (LOCALx Q (SEPx R)) |--
local (`(eq (field_address t_root gfs p)) (eval_lvalue e1)) ->
ENTAIL Delta, PROPx P (LOCALx Q (SEPx R)) |--
local (`(eq v0_val) (eval_expr (Ecast e2 (nested_field_type t_root gfs)))) ->
writable_share sh ->
JMeq v0 v0_val ->
data_equal (upd_reptype (nested_field_type t_root gfs0) gfs1 v v0) v_new ->
ENTAIL Delta, PROPx P (LOCALx Q (SEPx R)) |--
(tc_lvalue Delta e1) &&
(tc_expr Delta (Ecast e2 (nested_field_type t_root gfs))) ->
semax Delta (|>PROPx P (LOCALx Q (SEPx R)))
(Sassign e1 e2)
(normal_ret_assert
(PROPx P
(LOCALx Q
(SEPx
(replace_nth n R
(field_at sh t_root gfs0 v_new p)))))).