We have a buildbot setup to uncover such cases of non-determinism:
http://lab.llvm.org:8011/builders/reverse-iteration
The idea is to iterate unordered containers in reverse to weed out
pointer ordering issues.
Another instance of non-determinism is relative ordering of elements
with the
dcoughlin added a comment.
For clang itself I think we also use a stage-2 clang to build the same version
of clang and make sure that it matches the stage-2 clang. This doesn't help for
the analyzer though.
Repository:
rL LLVM
https://reviews.llvm.org/D40073
NoQ added a comment.
Thank you for the patch!~
In https://reviews.llvm.org/D40073#930470, @a.sidorin wrote:
> By the way, is there a common way to write tests for non-determinism for LLVM
> test suite?
I guess the most recent update on this subject is in this thread:
This revision was automatically updated to reflect the committed changes.
Closed by commit rL318750: [Analyzer] Non-determinism: stable iteration on
indirect goto LabelDecl's (authored by a.sidorin).
Changed prior to commit:
https://reviews.llvm.org/D40073?vs=123558=123750#toc
Repository:
a.sidorin added a comment.
Thank you, Devin!
Ilya doesn't have commit access so please commit the patch (or leave it for me,
I'm going to commit some patches tomorrow).
By the way, is there a common way to write tests for non-determinism for LLVM
test suite?
https://reviews.llvm.org/D40073
dcoughlin added a comment.
Thanks! Do you have commit access, or do you need someone to commit this for
you?
https://reviews.llvm.org/D40073
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
ilya-palachev updated this revision to Diff 123558.
ilya-palachev added a comment.
Ok, I agree, this test file is rather better.
https://reviews.llvm.org/D40073
Files:
lib/Analysis/CFG.cpp
test/Analysis/cfg-indirect-goto-determinism.cpp
Index:
dcoughlin accepted this revision.
dcoughlin added a comment.
This revision is now accepted and ready to land.
Thanks for finding and fixing this!
This looks good, but since the nondeterminism is in CFG construction, I think
it makes sense to create and dump the CFG rather than running the whole
ilya-palachev updated this revision to Diff 123016.
ilya-palachev added a comment.
Slightly changed the number of max-nodes, since previous one was maximum
possible on my local branch, and it doesn't work for upstream. The behavior
with number 500 seems more stable. With it, we have 4 different
a.sidorin added inline comments.
Comment at: test/Analysis/diagnostics/goto-label-determinism.cpp:2
+// RUN: %clang_analyze_cc1 -triple arm-unknown-linux-gnueabi -w
-analyzer-checker=debug.ExprInspection %s -verify
+// RUN: for i in {1..100}; do %clang_analyze_cc1 -triple
ilya-palachev created this revision.
Herald added subscribers: szepet, xazax.hun.
Current CFG is built in non-deterministic order due to the fact that indirect
goto labels' declarations (LabelDecl's) are stored in the llvm::SmallSet
container. LabelDecl's are pointers, whose order is not
11 matches
Mail list logo