| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| | |
On platforms that do distinguish between text mode and binary mode,
seek_in cannot reliably be used on files opened in text mode (open_in).
The input file must therefore be opened in binary mode (open_in_bin).
Bug 34075
|
|\ \
| | |
| | | |
SimplExpr: revised handling of nested conditional, `||`, `&&` expressions
|
| | | |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In a `For_set` destination, a temporary can be reused only if it
always used with the same type. Otherwise, typing of Cminor code fails
later in the compilation pipeline.
This commit implements temporary reuse if and only if the typing
constraint is respected.
- For `&&` and `||`, it avoids the possibility of wrong reuse
(as reported in #453).
- For nested conditional expressions, it improves a bit the generated
code by reusing the temporary when possible.
Fixes: #453
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
targets (#457)
Follow-up to ed89275cb.
AArch64, ARM, RISC-V and x86 ELF targets are changed.
PowerPC / ELF is unchanged because we use the EABI variant, which has
no `.data.rel.ro` section as far as I can see in GCC's output.
(The SVR4 variant has `.data.rel.ro` but does not have `.sdata2`,
which CompCert uses.)
Fixes: #454
|
|
|
|
| |
Just like in the other test/ directories.
|
|
|
|
| |
The correct -std option is now added by ccomp itself.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It has two effects:
- With a GNU toolchain, it's passed down to the preprocessor.
This influences the contents of standard includes.
- It determines the default effect of the "C11 feature" warning:
-std=c99: warn on the use of C11 features
-std=c11 or -std=c18: don't warn
For backward compatiblity, the default, if no `-std` option is given,
is to not warn, but to pass `-std=c99` to the preprocessor.
Co-authored-by: Bernhard Schommer <bschommer@users.noreply.github.com>
|
|
|
|
|
| |
Also: use `int_of_string_opt` instead of `int_of_string` for slightly
cleaner code.
|
| |
|
|
|
|
|
| |
Activation and deactivation of a given warning,
plus set-as-error and remove-as-error.
|
|
|
|
|
| |
Some versions of the glibc standard header `<uchar.h>` are not compatible
with CompCert, causing the tests to fail on our CI.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Support C11 Unicode string literals and character constants
* Add tests for C11 string literals and character constants
* Better error message for ill-formed universal character names
E.g. \u followed by fewer than 4 hex digits, or \U followed by fewer than 8 hex digits.
* Add new warning `invalid-utf8` for byte sequences that are not valid UTF8.
The warning is activated but not fatal by default.
* Warn on uses of C11 Unicode character constants and string literals
This uses the `c11-extensions` warning, which is off by default.
* Support preprocessing option -finput-charset= for GNU toolchains
|
|
|
|
|
|
| |
And re-enable the `undeclared-scope` warning.
`Declare Scope` has been available since Coq 8.12, which is now the minimal Coq version supported.
|
| |
|
|
|
|
|
|
| |
Improves robustness in case of stronger (e)auto.
This is in preparation of a change in Coq that will make auto and eauto stronger
(https://github.com/coq/coq/pull/16293).
|
|
|
|
|
|
|
|
| |
Ignore debug statements that could have prevented the recognition
of a simple assignment.
Since debug statements can formally get stuck, revise the simulation
diagram to use the "eventually" modality.
|
|
|
|
|
|
| |
These diagrams enable the source program to make a number of finite
transitions before eventually reaching a state that restores the
simulation relation.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The `reset_constants` was only used for ARM and there it was superfluous
since the jumptables, which it additionally resets in contrast to
`reset_literals`, are always empty since jumptables are handled directly
in during printing of the instruction.
The `exists_constants` function is now also unused since we test directly
for the different sizes in `emit_constants`.
|
|
|
|
|
|
|
| |
Use the same code to split 64 bit literals into two 32 bit halfs as is
used for 64 bit initialization data and print them in PrintAsm. This
removes the need for a target specific printing function for 64 bit
literals.
|
|
|
|
|
|
| |
The function was the same for nearly all backends and also the way 32 bit
literals are printed so we moved it to PrintAsm. The 64 bit literals
however are still target specific.
|
|
|
|
| |
This makes compilation runs more reproducible.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The struct member byte and bit offsets are now set based upon the new
function `struct_layout` from Ctypes.v, thus using the same code to
compute as used to generate the actual struct access.
The struct offset member information is addded using the types computed
after the translation in C2C. Therefore we need to store the new internal
names of the members as well as the composites and use them
when adding the offset information.
Fixes: #445
|
|
|
|
|
| |
The `struct_layout` function computes for each member, that is neither
padding nor zero-length, the same result as `field_offset`.
|
|
|
|
|
| |
Note that strings containing null characters (code 0) cannot be put in
a mergeable section, as this will confuse the linker's merging criterion.
|
|
|
|
|
|
|
|
|
|
|
|
| |
On platforms that support them (ELF, macOS), use mergeable sections
(like `.rodata.cst8`) for 4-, 8- and 16-byte wide literals.
Works only if the LITERAL section is the default one. If the user
provided their own LITERAL section, all literals are put in it
regardless of their sizes.
Support for mergeable string sections is introduced in this commit too
but needs further changes in C2C.ml .
|
| |
|
|
|
|
|
|
|
| |
FP literals can have size 4 or 8 bytes, and it's incorrect to put a 4-byte
literal in a mergeable section of chunk size 8.
Fixes: #447
|
|
|
|
|
|
|
|
| |
This has been known to happen, e.g. when using Flocq 4.0.
If we don't stop the build at this point, a `ccomp` executable is built
that fails every time it is run.
Closes: #438
|
|
|
|
| |
Follow-up to 353669f8f
|
|
|
|
| |
Fixes: #441
|
|
|
|
| |
No longer triggered since commit df076edfe.
|
|
|
| |
Adapt w.r.t. coq/coq#16004.
|
| |
|
| |
|
|
|
|
|
| |
Handle constructors with 5, 6 and 7 arguments.
Handle lists.
|
| |
|
|
|
|
| |
Fixes: #435
|
|
|
|
|
|
|
|
|
|
| |
As suggested by Léo Gourdin in #437.
The previous expansion as a plain "j" instruction fails when the jump
offset is too large to be represented (issue #436).
Fixes: #436
Closes: #437
|
| |
|
|
|
|
| |
Fixes: #434
|
|
|
|
|
|
|
|
|
| |
CompCert doesn't maintain a frame pointer in X29. However, it must treat
X29 as callee-save, so that CompCert-generated code can be called from code
that uses X29 as frame pointer.
This commit makes X29 callee-save. In places where X29 was used as a
temporary, X15 or X14 is used instead.
|
|
|
|
|
|
|
|
| |
- Honor "noreturn" attributes and _Noreturn declarations on calls to
function pointers.
- Don't crash if a function type is an unknown typedef.
(This can happen with local typedefs.)
Instead, conservatively assume this function can return.
|
|
|
|
|
|
|
| |
Since we are sure that all files passed have a valid extension we can
use the OCaml function Filename.remove_extension and don't need to pass
the suffixes.
Bug 33218
|
|
|
|
|
|
|
| |
At some places the ".c" was hard coded as suffix for computing the
output filenames. This lead to problems if for example `-S`or `-c` is
used with preprocessed files.
Bug 33196
|
|
|
|
|
|
| |
- Emit the warning even for functions without parameters `int f() {...}`
- Show what the type is after prototyping
- Refactor this part of `elab_fundef` slightly
|
| |
|
|
|
|
| |
Entirely handled during elaboration. No impact on the verified part of CompCert.
|
|
|
|
|
| |
Before, in casts, `int (*)()` was parsed like `int (*)(void)`.
This caused expressions like `((int (*)()) &f)(42)` to be rejected.
Declarations were correctly parsed.
|