summaryrefslogtreecommitdiff
path: root/cfrontend
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-11-26 15:27:12 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-11-26 15:27:12 +0000
commit015c64c64a5a547dcef81a75a589eeaf034654cd (patch)
treec1eb0fde67fcc867e825c71a26bd9e298056e634 /cfrontend
parent3d8ebc77e801c81cd733cf42dde2153adc3f9037 (diff)
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
Diffstat (limited to 'cfrontend')
-rw-r--r--cfrontend/C2C.ml7
1 files changed, 5 insertions, 2 deletions
diff --git a/cfrontend/C2C.ml b/cfrontend/C2C.ml
index f35598c..1287a7e 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)