<div dir="ltr">I'm forwarding this from the cfe-users list, thanks in advance.<br><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <b class="gmail_sendername" dir="auto">Leo Brugnara</b> <span dir="auto"><<a href="mailto:leobr6@gmail.com">leobr6@gmail.com</a>></span><br>Date: Wed, Jun 26, 2019 at 1:13 PM<br>Subject: clang-cl 8.0 (x86) - pdb<br>To: <<a href="mailto:cfe-users@lists.llvm.org">cfe-users@lists.llvm.org</a>><br></div><br><br><div dir="ltr"><div>Hi, <br></div><div><br></div><div>I've come across the following issue with Clang 8.0 under Windows 10 (Home - Version       10.0.17134 Build 17134) using clang's cl driver. I have the following snippet of code that uses <b>double</b>:<br><br><div style="margin-left:40px">#include <stdio.h><br><br>int main (int argc, char **argv)</div></div><div style="margin-left:40px">{<br>    int size = 60;<br>           printf("size=%d\n", size);</div><div style="margin-left:40px"><br></div><div style="margin-left:40px">    double d = 1.4;<br>     printf("double=%f\n", d);</div><div style="margin-left:40px"><br>
</div><div style="margin-left:40px">            int  ret = (size * d);<br>     printf("ret=%d\n", ret);</div><div style="margin-left:40px"><br>    return ret;<br>}</div><div style="margin-left:40px"><br></div><div>If I compile this with the <b>x64</b> version of Clang while debugging with lldb the variables have the expected value and the console's output looks good too. Instead, if I use the <b>x86</b> version, the debug session shows weird numbers for the variables, even though the console's output is correct (so is the program).</div><div><br></div><div>If I directly use <b>cl.exe</b> (x86) to compile the program, the debug session works as expected (and the program keeps working as expected). The same happens if I change "double d = 1.4" by "float d = 1.4", both the debug session and the program work as expected. Also, if I use the MSVC debugger the output for all the scenarios is the same.<br></div><div><br></div><div>Am I missing something here or is it a bug with the generated PDB file? These are the logs of each scenario:</div><div><br></div><div><b>clang-cl-x64.log</b>: <a href="https://gist.github.com/lbrugnara/1c644fc6fbbb1ee44d9848d7f3697a8b" target="_blank">https://gist.github.com/lbrugnara/1c644fc6fbbb1ee44d9848d7f3697a8b</a></div><div><b>clang-cl-x86.log</b>: <a href="https://gist.github.com/lbrugnara/415e89dbe5318b03a73a0d851be0961d" target="_blank">https://gist.github.com/lbrugnara/415e89dbe5318b03a73a0d851be0961d</a></div><div><b>cl-x86.log</b>: <a href="https://gist.github.com/lbrugnara/de9b54a896d995f8f5e712a064134d52" target="_blank">https://gist.github.com/lbrugnara/de9b54a896d995f8f5e712a064134d52</a></div><div><b>clang-cl-x86-float.log</b>: <a href="https://gist.github.com/lbrugnara/16fd3fcbf3876e6b829a5dfd0d46973c" target="_blank">https://gist.github.com/lbrugnara/16fd3fcbf3876e6b829a5dfd0d46973c</a></div><div><br></div><div>Thanks</div><div><br></div><div>-- Leo<br></div></div><div id="m_-6369630767087465876DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br></div>
</div></div></div>