From 015c64c64a5a547dcef81a75a589eeaf034654cd Mon Sep 17 00:00:00 2001 From: xleroy Date: Sat, 26 Nov 2011 15:27:12 +0000 Subject: Fixed serious bug in handling of volatile arrays. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1737 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- cfrontend/C2C.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cfrontend') diff --git a/cfrontend/C2C.ml b/cfrontend/C2C.ml index f35598c7..1287a7ef 100644 --- a/cfrontend/C2C.ml +++ b/cfrontend/C2C.ml @@ -367,6 +367,10 @@ let first_class_value env ty = let is_volatile_access env e = List.mem C.AVolatile (Cutil.attributes_of_type env e.etyp) && Cutil.is_lvalue e + && begin match Cutil.unroll env e.etyp with + | TFun _ | TArray _ -> false + | _ -> true + end let volatile_kind ty = match ty with @@ -377,8 +381,7 @@ let volatile_kind ty = | Tint(I32, _) -> ("int32", Tint(I32, Signed), Mint32) | Tfloat F32 -> ("float32", ty, Mfloat32) | Tfloat F64 -> ("float64", ty, Mfloat64) - | Tpointer _ | Tarray _ | Tfunction _ | Tcomp_ptr _ -> - ("pointer", Tpointer Tvoid, Mint32) + | Tpointer _ -> ("pointer", Tpointer Tvoid, Mint32) | _ -> unsupported "operation on volatile struct or union"; ("", Tvoid, Mint32) -- cgit