https://llvm.org/bugs/show_bug.cgi?id=31257
Bug ID: 31257 Summary: -Oz miscompilation? Product: new-bugs Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: new bugs Assignee: unassignedb...@nondot.org Reporter: matthias.krue...@famsik.de CC: llvm-bugs@lists.llvm.org Classification: Unclassified cppcheck testrunner fails under -Oz with clang/llvm dev. Source: https://github.com/danmar/cppcheck (tested with 9c69546 of this repo) To compile and run just execute make CXX=clang++ CXXFLAGS="-Oz -std=c++0x" testrunner; ./testrunner With clang 3.8.0 (fedora 24) there are no problems, testrunner succeeds. With 4.0-dev however there are assertion failures and internal errors which makes be believe that there is a miscompilation of the compiler. test failures: TestType TestSymbolDatabase TestOther TestNullPointer TestMathLib TestCondition TestCharVar internal errors: TestBufferOverrun TestValueFlow TestTokenizer TestSimplifyTokens you can run tests one by one via ./testrunner TestValueFlow or ./testrunner TestValueFlow::valueFlowCalculations My rough assumption is that there are differences in how -Oz handles data types or related checks since in the test suit, some values that were ints became floats unexpectedly ( ./testrunner TestMathLib ) If you want to know how cppcheck interprets code, run cppcheck file --debug --verbose My knowledge of c/c++ is very limited so unfortunately I can't come up with a reduced example of miscompiled code. -O0, -O1, -O2, -O3, -Og -Os all show no sign of failures. llvm @ r288619 clang @ r288614 -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs