Page MenuHomePhabricator

Initialize variables before assignment in asm
Needs RevisionPublic

Authored by protze.joachim on Oct 19 2018, 10:11 AM.

Details

Reviewers
jlpeyton
Summary

When applying MemorySanitizer to an OpenMP application, msan complains about uninitialized access for these variables, which are assigned in assembler code. With these changes, I could successfully apply MemorySanitizer to an OpenMP application.

If the initialization is considered harmful, an alternative would be to wrap the initialization in

#if defined(__has_feature)
#  if __has_feature(memory_sanitizer)
// code that builds only under MemorySanitizer
#  endif
#endif

Diff Detail

Repository
rOMP OpenMP

Event Timeline

Can you put a constructor in the kmp_cpuid structure inside kmp.h which initializes eax, ebx, ecx & edx to 0?

jlpeyton requested changes to this revision.Nov 2 2018, 3:34 PM

Changing the state to request changes

This revision now requires changes to proceed.Nov 2 2018, 3:34 PM