diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-02-03 17:17:33 +0100 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-02-03 17:17:33 +0100 |
commit | 9ac665bba44e45eed8517d8f40a1b41c51051348 (patch) | |
tree | af82f36389926343b91eb94777853c8e4ea17f80 | |
parent | b71f1c635f20550f6ffdea7f99e65b8516d46768 (diff) | |
parent | 1dd98d18c57abdbc8dc50bbef729e8a898d55aad (diff) | |
download | compcert-kvx-9ac665bba44e45eed8517d8f40a1b41c51051348.tar.gz compcert-kvx-9ac665bba44e45eed8517d8f40a1b41c51051348.zip |
Merge branch 'dm-cse2' of /home/monniaux/progs/CompCert/dm-cse2 into mppa-cse2
-rw-r--r-- | backend/CSE2.v | 6 | ||||
-rw-r--r-- | backend/CSE2proof.v | 8 | ||||
-rw-r--r-- | test/monniaux/cse2/loopaccess.c | 7 | ||||
-rw-r--r-- | test/monniaux/cse2/loopinvariant.c | 7 | ||||
-rw-r--r-- | test/monniaux/cse2/loopload.c | 5 |
5 files changed, 33 insertions, 0 deletions
diff --git a/backend/CSE2.v b/backend/CSE2.v index a1c1d9cb..1b3d415d 100644 --- a/backend/CSE2.v +++ b/backend/CSE2.v @@ -1,3 +1,9 @@ +(* +Replace available expressions by the register containing their value. + +David Monniaux, CNRS, VERIMAG + *) + Require Import Coqlib Maps Errors Integers Floats Lattice Kildall. Require Import AST Linking. Require Import Memory Registers Op RTL Maps. diff --git a/backend/CSE2proof.v b/backend/CSE2proof.v index f0351c3a..2b9b71dc 100644 --- a/backend/CSE2proof.v +++ b/backend/CSE2proof.v @@ -1,3 +1,11 @@ +(* +Replace available expressions by the register containing their value. + +Proofs. + +David Monniaux, CNRS, VERIMAG + *) + Require Import Coqlib Maps Errors Integers Floats Lattice Kildall. Require Import AST Linking. Require Import Memory Registers Op RTL Maps. diff --git a/test/monniaux/cse2/loopaccess.c b/test/monniaux/cse2/loopaccess.c new file mode 100644 index 00000000..5ddaeb66 --- /dev/null +++ b/test/monniaux/cse2/loopaccess.c @@ -0,0 +1,7 @@ +double toto(double x, int count) { + double r = 5*x + 3; + while (count > r) { + count --; + } + return 5*x + 3; +} diff --git a/test/monniaux/cse2/loopinvariant.c b/test/monniaux/cse2/loopinvariant.c new file mode 100644 index 00000000..64caf80b --- /dev/null +++ b/test/monniaux/cse2/loopinvariant.c @@ -0,0 +1,7 @@ +int toto(int *t, int n) { + int x = t[0]; + for(int i=1; i<n; i++) { + if (t[i] > t[0]) return i; + } + return 0; +} diff --git a/test/monniaux/cse2/loopload.c b/test/monniaux/cse2/loopload.c new file mode 100644 index 00000000..6e0925f7 --- /dev/null +++ b/test/monniaux/cse2/loopload.c @@ -0,0 +1,5 @@ +int find_index(int *t, int n) { + if (t[0] > 0) return 3; + while (n > 0) n--; + return t[0]; +} |