Published September 21, 2022 | Version 2.0.0
Software Open

CompCertGSA

  • 1. Imperial College London
  • 2. Université Rennes 1, IRISA

Description

CompCert GSA

This repository contains the implementation of Gated-SSA in CompCertSSA.

Files

GSA semantics

  • ./midend/GSA.v: Syntax and semantics for GSA.

Generation of GSA

  • ./midend/GSAvalid.v: Translation from SSA to GSA.
  • ./midend/GSAvalidspec.v: Specification of translation.
  • ./midend/GSAvalidproof.v: Proof of semantics preservation for translation.
  • ./midend/GSApredicate.v: The implementation of three-valued logic predicates.
  • ./midend/GSApaths.v: Implementation of Tarjan’s path algorithm.
  • ./midend/RTLloopgen.v, ./midend/RTLloopgenproof.v: Loop normalisation using noops.
  • ./midend/GSAcommon.v: Common shared proofs and definitions.
  • ./midend/GSASat.v: A fallback implementation of a SAT solver.

SMTCoq integration

  • ./midend/GSAhashtree.v: Hashing used to implement sharing of formulas and atoms for SMTCoq.
  • ./midend/GSAsmtpredicate.v: Solving three-valued logic predicates using an SMT solver through SMTCoq.

Building GSA

Dependencies

  • Coq 8.13.2
  • veriT: This exact version is needed: https://www.lri.fr/~keller/Documents-recherche/Smtcoq/veriT9f48a98.tar.gz To install : - untar the archive - launch ./configure script and check that it succeeds - launch make. Some versions of clang might fail, in which case you need to add the -Wno-implicit-function-declaration option to it. This can be done by editing Makefile.config - add the veriT executable to your path.
  • Ocaml dependencies: menhir, num (v.1.4), zarith (v.1.12).

Building

First build SMTCoq:

cd smtcoq/src
make -j7
cd extraction
make  # Important: not parallel

Then build CompCertGSA, as you would build CompCert

cd ../../..  # or back to root directory
./configure [your-architecture] # we only support the x86 backend (e.g. x86_64-linux)
make -j7

Compiling with GSA

The GSA intermediate representation can be enabled with -ssa gsa. Then, the GSA representation can be printed out using -dgsa, or the GSA will be translated back to SSA and finally compiled to an executable.

If there are linktime errors, the CompCert library might have to be included with -L./runtime for example.

The following command is expected to finish in around 20s.

./ccomp -ssa gsa -dgsa ./test/c/qsort.c

The GSA representation will then be available as qsort.gsa.0.

Files

Files (4.0 MB)

Name Size Download all
md5:9c6997eec463aa5a030a0769c534736e
4.0 MB Download