aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectProcess.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-06-13 17:54:52 +0000
committerSanjay Patel <spatel@rotateright.com>2018-06-13 17:54:52 +0000
commit1d7ed944398913c7c282ba086965b101bf0b0d54 (patch)
treef06c55d8bf3e0cd29a5dd418c46d859b93237690 /lldb/source/Commands/CommandObjectProcess.cpp
parent4d1c85488418e1b0516e22d8856d263cfadf7ad8 (diff)
downloadllvm-1d7ed944398913c7c282ba086965b101bf0b0d54.zip
llvm-1d7ed944398913c7c282ba086965b101bf0b0d54.tar.gz
llvm-1d7ed944398913c7c282ba086965b101bf0b0d54.tar.bz2
[CodeGen] make nan builtins pure rather than const (PR37778)
https://bugs.llvm.org/show_bug.cgi?id=37778 ...shows a miscompile resulting from marking nan builtins as 'const'. The nan libcalls/builtins take a pointer argument: http://www.cplusplus.com/reference/cmath/nan-function/ ...and the chars dereferenced by that arg are used to fill in the NaN constant payload bits. "const" means that the pointer argument isn't dereferenced. That's translated to "readnone" in LLVM. "pure" means that the pointer argument may be dereferenced. That's translated to "readonly" in LLVM. This change prevents the IR optimizer from killing the lead-up to the nan call here: double a() { char buf[4]; buf[0] = buf[1] = buf[2] = '9'; buf[3] = '\0'; return __builtin_nan(buf); } ...the optimizer isn't currently able to simplify this to a constant as we might hope, but this patch should solve the miscompile. Differential Revision: https://reviews.llvm.org/D48134 llvm-svn: 334628
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
0 files changed, 0 insertions, 0 deletions