| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
The check `Int.ltu x Int.zero` is always false, we replace this by using
signed integer comparisons.
We cannot use `Int.sign_ext` because the offsets are not signed
integers but rather unsigned integers plus an additional sign bit.
|
|
|
|
| |
Closes: #467
|
|
|
|
|
|
|
|
| |
If the Coq version used supports native compilation, `.coq-native`
directories are generated during the build, and they need to be
installed along the `.vo` files.
Fixes: #476
|
|
|
|
|
|
|
|
| |
A self assign `x = x` can be classified as a skip in `classify_stmt`.
This helps with the if-conversion of some code that the previous passes
generates, e.g. for nested C conditional expressions.
Closes: #466
|
| |
|
|
|
|
|
|
| |
However, it is signed int for aarch64_apple.
Fixes: #475
|
|
|
|
|
|
| |
Since the wchar_t type depends on the architecture and the system we are
compiling for we replace the typedef to a fixed type by a typedef to a
define which is predefined by the compiler itself.
|
| |
|
|
|
|
|
|
| |
This replaces `sizeof_wchar` and `wchar_signed`, and makes it possible
to request that `wchar_t` is `long` instead of `int`, something that
seems needed for PowerPC.
|
|
|
|
|
|
| |
Instead, evaluate it for the side effects it may contain.
Fixes: #474
|
|
|
|
|
|
|
|
|
| |
Variadic functions can use the stack frame to store values of registers.
Hence, a pointer within the stack frame can be put in a va_list, and
the stack frame should not be deallocated before a function call that
may use this va_list.
Fixes: #473
|
|
|
|
|
|
| |
So as to respect dependency order when compound initializers are nested.
Fixes: #471
|
|
|
|
| |
Fixes: #472
|
|
|
|
| |
Adapt w.r.t. coq/coq#16904.
|
|
|
|
|
| |
Cygwin 32 bits has reached end of life, and Cygwin >= 3.4 will be 64-bit only.
(https://cygwin.com/pipermail/cygwin-announce/2022-November/010777.html)
|
| |
|
|
|
|
| |
Adaptation to https://github.com/coq/coq/pull/16743
|
| |
|
|
|
|
| |
Fixes: #461
|
|
|
|
|
|
| |
Make sure that it's one of the three locations where the ccomp executable
looks for compcert.ini.
Closes: #450
|
|
|
|
|
|
|
| |
Use of `char` instead of `int` caused nontermination on platforms where
`char` is unsigned.
Fixes: #462
|
|\
| |
| | |
Handle Duff's device and other unstructured `switch` statements
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This can occur in debug mode if there are declarations before the
first case, as in
```
switch (x) {
int x;
case 0:
...
}
```
Without this commit, the code above is a structured switch if -g is not given,
and a non-structured switch if -g is given.
Co-authored-by: Michael Schmidt <github@mschmidt.me>
|
| |
| |
| |
| | |
`-finput-charset` and other small fixes)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- New elaboration pass: SwitchNorm
- recognizes structured 'switch' statements and puts them in a
normalized form;
- if selected, transforms unstructured 'switch' statements into a
structured switch with goto actions + the original switch body
with appropriate labels and gotos.
- C2C treatment of 'switch' statements is simplified accordingly.
- New language support option `-funstructured-switch`.
- Some tests were added (test/regression/switch3.c).
|
| |
| |
| |
| |
| |
| |
| | |
This ensures that normalized switch statements remain normalized.
However, if the label and the labeled statement are on different lines,
add an extra line directive corresponding to the label before the labeled
statement.
|
| |
| |
| |
| |
| |
| | |
Instead of passing a string that encodes the optional source-to-source
transformations to perform, just pass one optional, named argument for
each transformation. It is clearer and easier to extend this way.
|
| |
| |
| |
| |
| |
| |
| |
| | |
We use Printlines to copy C code fragments to assembly comments.
While CR, FF and VT are treated like whitespace by C, they could
possibly mess up the assembly comments if copied verbatim.
Moreover, this avoids generating CR CR LF end-of-lines under Windows.
Bug 34075
|
| |
| |
| |
| |
| |
| |
| | |
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.
|