diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-06-09 08:49:06 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-06-09 08:49:06 +0000 |
commit | f3250c32ff42ae18fd03a5311c1f0caec3415aba (patch) | |
tree | b37da52bcf8015c4b29bb8387c30727e2b4de824 /powerpc/ConstpropOp.vp | |
parent | 326d33e5b0f9dc0d3ccf6d75c62fedbc3ca085e5 (diff) |
Make min_int / -1 and min_int % -1 semantically undefined
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1919 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'powerpc/ConstpropOp.vp')
-rw-r--r-- | powerpc/ConstpropOp.vp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/powerpc/ConstpropOp.vp b/powerpc/ConstpropOp.vp index 60b5c63..c39ccdb 100644 --- a/powerpc/ConstpropOp.vp +++ b/powerpc/ConstpropOp.vp @@ -95,8 +95,12 @@ Nondetfunction eval_static_operation (op: operation) (vl: list approx) := | Osubimm n, I n1 :: nil => I (Int.sub n n1) | Omul, I n1 :: I n2 :: nil => I(Int.mul n1 n2) | Omulimm n, I n1 :: nil => I(Int.mul n1 n) - | Odiv, I n1 :: I n2 :: nil => if Int.eq n2 Int.zero then Unknown else I(Int.divs n1 n2) - | Odivu, I n1 :: I n2 :: nil => if Int.eq n2 Int.zero then Unknown else I(Int.divu n1 n2) + | Odiv, I n1 :: I n2 :: nil => + if Int.eq n2 Int.zero then Unknown else + if Int.eq n1 (Int.repr Int.min_signed) && Int.eq n2 Int.mone then Unknown + else I(Int.divs n1 n2) + | Odivu, I n1 :: I n2 :: nil => + if Int.eq n2 Int.zero then Unknown else I(Int.divu n1 n2) | Oand, I n1 :: I n2 :: nil => I(Int.and n1 n2) | Oandimm n, I n1 :: nil => I(Int.and n1 n) | Oor, I n1 :: I n2 :: nil => I(Int.or n1 n2) |