[Openmp-commits] [PATCH] D96893: [OpenMP] libomp minor cleanup

Di Mo via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Mar 1 23:35:11 PST 2021


modimo added a comment.

Hi @AndreyChurbanov I'm seeing a test failure (openmp/runtime/test/ompt/tasks/task_if0-depend.c) with this change under a `-DCMAKE_BUILD_TYPE=debug` build setup with our internal branch based off of the newly added `KMP_DEBUG_ASSERT(n >= 0);`. This doesn't seem to reproduce directly under trunk but looking into it I think the bug is optimization dependent but still present.

I added print code to the value of `n` before the assert and on 9fac8496eae809c288096037d7a3f5a1a3d04c7a <https://reviews.llvm.org/rG9fac8496eae809c288096037d7a3f5a1a3d04c7a> I get the following values when running the test:
`-DCMAKE_BUILD_TYPE=debug`
n: 3
n: 1
n: 32763
n: 0
`-DCMAKE_BUILD_TYPE=release`
n: 3
n: 1
n: -1
n: 0

So on the debug build it passes because 32763>0 but that number only makes sense as an underflow given the test is only spawning 2 threads. In release mode the test passes because the assert is debug only but the -1 makes more sense as a real value. In our testing we get the -1 in the debug build which causes the assert to fire. Let me know if you need more information and also if my analysis here is correct. Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96893/new/

https://reviews.llvm.org/D96893



More information about the Openmp-commits mailing list