aboutsummaryrefslogtreecommitdiffstats
path: root/driver/CommonOptions.ml
Commit message (Collapse)AuthorAgeFilesLines
* Native support for bit fields (#400)Xavier Leroy2021-08-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This big PR adds support for bit fields in structs and unions to the verified part of CompCert, namely the CompCert C and Clight languages. The compilation of bit field accesses to normal integer accesses + shifts and masks is done and proved correct as part of the Cshmgen pass. The layout of bit fields in memory is done by the functions in module Ctypes. It follows the ELF ABI layout algorithm. As a bonus, basic soundness properties of the layout are shown, such as "two different bit fields do not overlap" or "a bit field and a regular field do not overlap". All this replaces the previous emulation of bit fields by source-to-source rewriting in the unverified front-end of CompCert (module cparse/Bitfield.ml). This emulation was prone to errors (see nonstandard layout instead. The core idea for the PR is that expressions in l-value position denote not just a block, a byte offset and a type, but also a bitfield designator saying whether all the bits of the type are accessed (designator Full) or only some of its bits (designator Bits). Designators of the Bits kind appear when the l-value is a bit field access; the bit width and bit offset in Bits are computed by the functions in Ctypes that implement the layout algorithm. Consequently, both in the semantics of CompCert C and Clight and in the SimplExpr, SimplLocals and Cshmgen compilation passes, pairs of a type and a bitfield designator are used in a number of places where a single type was used before. The introduction of bit fields has a big impact on static initialization (module cfrontend/Initializers.v), which had to be rewritten in large part, along with its soundness proof (cfrontend/Initializersproof.v). Both static initialization and run-time manipulation of bit fields are tested in test/abi using differential testing against GCC and randomly-generated structs. This work exposed subtle interactions between bit fields and the volatile modifier. Currently, the volatile modifier is ignored when accessing a bit field (and a warning is printed at compile-time), just like it is ignored when accessing a struct or union as a r-value. Currently, the natural alignment of bit fields and their storage units cannot be modified with the aligned attribute. _Alignas on bit fields is rejected as per C11, and the packed modifier cannot be applied to a struct containing bit fields.
* Remove `-version-file` option from option summaryXavier Leroy2021-04-231-1/+0
| | | | | The `-version-file` option was removed in commit 600803cae, but remained in the option summary, as reported in #386.
* Remove -version-file optionXavier Leroy2020-10-121-19/+2
| | | | It is specific to AbsInt's commercial version of CompCert.
* Add missing comment for print_version_file_and_exitChristoph Cullmann2020-07-301-0/+1
|
* No trailing commas for --version-file option.Bernhard Schommer2020-07-091-1/+1
|
* Fix typo.Bernhard Schommer2020-07-081-1/+1
|
* Revert "Use the same version string."Bernhard Schommer2020-07-081-3/+10
| | | | This reverts commit 1a01ad629109cdb60fddae3787e3a589d20e9790.
* Use the same version string.Bernhard Schommer2020-07-081-10/+3
| | | | | | The version string dumped in the file should be the same as the version string printed by `-version`. The option is also not printed by `-help` since it is for internal use only.
* Introduce additional "branch" build information.Bernhard Schommer2020-07-081-3/+5
|
* Add option to print version information in fileBernhard Schommer2020-07-081-1/+17
|
* Change to AbsInt version string.Bernhard Schommer2019-05-101-2/+2
| | | | | The AbsInt build number no longer contains "release", so it must be printed additionally.
* Share code for common options.Bernhard Schommer2018-01-291-0/+89
In order to avoid more divergence between the command line options of clightgen and ccomp the code for the common options, the language support options, the version string and the general options.