aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Added new module for checks on elaborated C codeBernhard Schommer2017-02-173-2/+114
| | | | | | | The new module adds a function which is called during parse after all C transformation have taken place for adding additional checks. Currently only unknown attribute are checked. Bug 19872
* Do not optimize away the 'return 0' at end of 'main'Xavier Leroy2017-02-171-7/+5
| | | | | | As a cosmetic optimization enabled by the static analysis in Cflow, we used to not insert a 'return 0' at end of 'main' if the body of 'main' cannot fall through. Since this optimization is cosmetic (the back-end will remove the 'return 0' if unused) and since we don't fully trust this static analysis, revert this optimization and always insert 'return 0'.
* Control-flow analysis: bug in switch without defaultXavier Leroy2017-02-171-1/+30
| | | | If no 'default' case appears in a 'switch', one is implicit at the end of the switch body, making possible to have a fall-through behavior.
* Merge pull request #172 from AbsInt/std_noreturn_funXavier Leroy2017-02-173-3/+14
|\ | | | | | | Treat as _Noreturn the standard C11 functions that are _Noreturn but not always declared as such in header files.
| * Added _exit.Bernhard Schommer2017-02-171-1/+1
| |
| * Add longjmp. Bug 21009Bernhard Schommer2017-02-171-1/+1
| |
| * Added handling for noreturn std functions.Bernhard Schommer2017-02-163-3/+14
|/ | | | | | | | | | The C11 standard declares exit,abort,_Exit,quick_exit and thrd_exit as _Noreturn however this is not included in older C libs and leads to false negatives in reporting _Noreturn and return type warnings. This can be avoided by enhancing the noreturn check of the Cflow analysis to also test if one of the above functions is called. Bug 21009
* Reverted changes in Cutil and catch in Cflow.Bernhard Schommer2017-02-162-17/+5
| | | | | | Instead of changing the definition of sizeof we now ignore errors raise in the Cflow module. Bug 21005
* Fixed problem with local structs/unions in Cflow.Bernhard Schommer2017-02-161-4/+17
| | | | | | | | Since the function environment does not necessary contain structs and unions defined in sizeof expressions the evaluation should be not constant and the Environment excpetions should be catched. Fix 21005
* drop .cm support from man pageMichael Schmidt2017-02-151-4/+0
|
* Merge pull request #167 from AbsInt/pipe_prerequisiteXavier Leroy2017-02-158-35/+27
|\ | | | | Introduced configuration variable for gnu systems.
| * Introduced configuration variable for gnu systems.Bernhard Schommer2017-02-138-35/+27
| | | | | | | | | | | | | | The variable gnu_toolchain is true if a gnu toolchain is used and false in all other cases. The variable avoids the explicit test whether the system string is diab and should be easier to change. Bug 20521.
* | Merge pull request #162 from AbsInt/return-analysis-2Xavier Leroy2017-02-155-32/+290
|\ \ | | | | | | | | | Improved warnings related to function returns
| * | Cflow: analysis of "switch" was too impreciseXavier Leroy2017-02-071-2/+3
| | | | | | | | | | | | Plus: updated comments.
| * | Revised, more precise implementation of control-flow analysisXavier Leroy2017-02-071-48/+98
| | | | | | | | | | | | The new implementation keeps track of goto labels that are actually branched to. It is less optimized than the previous implementation (no bit vectors) but perhaps easier to read.
| * | Control-flow analysis: wrong flow for "case"/"default" statementsXavier Leroy2017-02-071-4/+6
| | | | | | | | | | | | Those labeled statements can be entered either by fall-through or by the enclosing switch.
| * | More precise warnings about function returnsXavier Leroy2017-02-075-32/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a control-flow static analysis over C abstract syntax (file cparser/Cflow.ml) and uses it to - warn for non-void functions that can return by falling through the body - warn more precisely for _Noreturn functions that can return - introduce the "return 0" in "main" functions less often (cosmetic). For the control-flow analysis, the following conservative approximations are made: - any "goto" label is reachable - all cases of a "switch" statement are reachable as soon as the "switch" is reachable (i.e. the switch expression takes all values needed to reach every case) - the boolean expressions in "if", "while", "do"-"while" and "for" can take true and false values, unless they are compile-time constants.
* | | Remove tests involving Cminor concrete syntax. Update ChangelogXavier Leroy2017-02-1529-3336/+3
| | | | | | | | | | | | Follow-up to [29653ba]
* | | Merge pull request #170 from AbsInt/remove_cminorXavier Leroy2017-02-159-1379/+3
|\ \ \ | | | | | | | | | | | | | | | | | | | | Remove CompCert's ability to parse and compile source files written in Cminor This facility is no longer used (as far as we know) and is painful to maintain.
| * | | Removed CMinor import. Bug 20992Bernhard Schommer2017-02-149-1379/+3
| | | |
* | | | Removed superfluous semicolon.Bernhard Schommer2017-02-141-1/+1
|/ / /
* | | Remove Optionsprinter. Bug 20993Bernhard Schommer2017-02-142-155/+1
| | |
* | | Release 3.0.1 here we comev3.0.1Xavier Leroy2017-02-142-1/+7
| | |
* | | Give explicit scopes to notations a#b and a##b and a#b<-cXavier Leroy2017-02-134-13/+21
| | | | | | | | | | | | Without scopes Coq 8.6 warns, probably rightly so.
* | | Turn warning "deprecated-implicit-arguments" off while compiling FlocqXavier Leroy2017-02-131-1/+4
| | | | | | | | | | | | Perhaps for reasons of backward compatibility with Coq 8.4, Flocq 2.5.2 still uses the "Implicit Arguments foo" idiom, which is deprecated in Coq 8.6.
* | | Replace "Implicit Arguments" with "Arguments"Xavier Leroy2017-02-138-19/+17
| | | | | | | | | | | | | | | This silences a warning of Coq 8.6. Some "Implicit Arguments" remain in flocq/ but I'd rather not diverge from the released version of flocq if at all possible.
* | | Use "Local" as prefixXavier Leroy2017-02-1322-38/+36
| | | | | | | | | | | | | | | Open Local becomes Local Open. This silences Coq 8.6's warning. Also: remove one useless Require-inside-a-module that caused another warning.
* | | ARM, PowerPC: update Asmgenproof for Coq 8.6Xavier Leroy2017-02-132-14/+21
| | |
* | | Update Flocq to version 2.5.2Xavier Leroy2017-02-138-132/+91
| | | | | | | | | | | | This version of Flocq is compatible with Coq 8.6
* | | Merge branch 'coq-8.6' of https://github.com/maximedenes/CompCert into ↵Xavier Leroy2017-02-139-19/+22
|\ \ \ | |_|/ |/| | | | | maximedenes-coq-8.6
| * | Bump required version of Menhir to 20161201.Maxime Dénès2017-01-091-1/+1
| | | | | | | | | | | | Menhir's Coq backend has been updated to support Coq 8.6.
| * | Some backward compatible Ltac fixes, necessary for 8.6.Maxime Dénès2017-01-091-5/+7
| | |
| * | Fix broken fragile automation.Maxime Dénès2017-01-091-1/+2
| | |
| * | Configure now expects to find Coq 8.6.0.Maxime Dénès2017-01-091-3/+3
| | |
| * | Subst's behavior on let-ins has changed.Maxime Dénès2017-01-091-2/+2
| | |
| * | An hypothesis has changed name.Maxime Dénès2017-01-091-1/+1
| | | | | | | | | | | | Not sure why, but it would be safer not to rely on automatic naming.
| * | The contradiction tactic has become more powerful.Maxime Dénès2017-01-091-2/+1
| | |
| * | Intro patterns have changed semantics...Maxime Dénès2017-01-091-0/+1
| | |
| * | The subst tactic has become more powerful.Maxime Dénès2017-01-093-4/+4
| | |
* | | Release 3.0 here we comev3.0Xavier Leroy2017-02-102-2/+3
| | |
* | | OS X: emit jumptables in .text segment, not .const segmentXavier Leroy2017-02-101-1/+1
| | | | | | | | | | | | | | | | | | In 64-bit mode jumptables contain differences of labels Lx-Ly. The OS X assembler and linker have problems with those differences if the labels are from a given section (here, .text) and the difference is to be put in another section (previously, .const). Putting the jumptables in .text fixes this issue, and is consistent with what is done for ELF.
* | | Use Printf.sprintf instead of Format.sprintf when possibleXavier Leroy2017-02-091-4/+4
| | | | | | | | | | | | Minor performance tweak. Printf is more efficient for plain formats involving no boxes.
* | | More tweaking of module 'open'Xavier Leroy2017-02-091-8/+10
| | | | | | | | | | | | I really like to have Floats and Values opened. The other opens I can live without, but Floats.Float.zero is just wrong.
* | | Merge branch 'master' of github.com:AbsInt/CompCertBernhard Schommer2017-02-081-0/+7
|\ \ \
| * | | Changelog update concerning attribute handlingXavier Leroy2017-02-071-0/+7
| | |/ | |/|
* / | Revert broken change to Cutil.Bernhard Schommer2017-02-083-10/+10
|/ / | | | | | | | | | | The optional hex parameter only worked if the intconstant was also of unsigned kind. Hence it is better to have one function in Bitfields for this.
* | Merge branch 'master' of ssh://github.com/AbsInt/CompCertXavier Leroy2017-02-063-83/+36
|\ \
| * | Simplified DebugInformation interface.Bernhard Schommer2017-02-063-83/+36
| | | | | | | | | | | | | | | Instead of exporting and setting all functions we just fill the struct already in DebugInformation with the correct functions.
* | | Merge branch 'elaboration-of-attributes'Xavier Leroy2017-02-0611-47/+148
|\ \ \ | |/ / |/| |
| * | Preliminary support for the "noreturn" attributeXavier Leroy2017-02-062-12/+17
| | | | | | | | | | | | | | | - Mark the "noreturn" attribute as related to function types, so that it is correctly attached to the nearest enclosing function type. - Add this attribute on functions declared / defined _Noreturn (with the C2011 keyword). The information is not used presently but could be useful later.