<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Binary inconsistency problems with occasional precedence"
   href="https://bugs.llvm.org/show_bug.cgi?id=50618">50618</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Binary inconsistency problems with occasional precedence
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++11
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>2077213809@qq.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When I compile llvm10.0.1 with clang 8.0.1, there is a probability that binary
inconsistency occurs, and only clang is inconsistent, with assembly differences
generated by several .o files, and sometimes extra functions. Sometimes it
doesn't.
I ran the build in exactly the same environment, and there was no change in the
build parameters or code location.Repeated builds about 20 times will make a
difference.


I recorded a difference in .o, which adds some smart pointer functions.
InterfaceStubFunctionsConsumer.cpp.o

I don't have any good ideas. Is this a known problem?

-../../../ok_2/obj/build-llvm/tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/InterfaceStubFunctionsConsumer.cpp.o:
    file format elf64-x86-64
+./tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/InterfaceStubFunctionsConsumer.cpp.o:
    file format elf64-x86-64


 Disassembly of section
.text._ZN5clang31GenerateInterfaceIfsExpV1Action17CreateASTConsumerERNS_16CompilerInstanceEN4llvm9StringRefE:

 0000000000000000
<clang::GenerateInterfaceIfsExpV1Action::CreateASTConsumer(clang::CompilerInstance&,
llvm::StringRef)>:
+   0:  41 56                 push   %r14
+   2:  53                    push   %rbx
+   3:  48 83 ec 18           sub    $0x18,%rsp
+   7:  48 89 fb              mov    %rdi,%rbx
+   a:  64 48 8b 04 25 28 00  mov    %fs:0x28,%rax
+  11:  00 00
+  13:  48 89 44 24 10        mov    %rax,0x10(%rsp)
+  18:  4c 8d 74 24 08        lea    0x8(%rsp),%r14
+  1d:  4c 89 f7              mov    %r14,%rdi
+  20:  48 89 d6              mov    %rdx,%rsi
+  23:  48 89 ca              mov    %rcx,%rdx
+  26:  4c 89 c1              mov    %r8,%rcx
+  29:  e8 00 00 00 00        callq  2e
<clang::GenerateInterfaceIfsExpV1Action::CreateASTConsumer(clang::CompilerInstance&,
llvm::StringRef)+0x2e>
+  2e:  48 89 df              mov    %rbx,%rdi
+  31:  4c 89 f6              mov    %r14,%rsi
+  34:  e8 00 00 00 00        callq  39
<clang::GenerateInterfaceIfsExpV1Action::CreateASTConsumer(clang::CompilerInstance&,
llvm::StringRef)+0x39>
+  39:  4c 89 f7              mov    %r14,%rdi
+  3c:  e8 00 00 00 00        callq  41
<clang::GenerateInterfaceIfsExpV1Action::CreateASTConsumer(clang::CompilerInstance&,
llvm::StringRef)+0x41>
+  41:  64 48 8b 04 25 28 00  mov    %fs:0x28,%rax
+  48:  00 00
+  4a:  48 3b 44 24 10        cmp    0x10(%rsp),%rax
+  4f:  75 0b                 jne    5c
<clang::GenerateInterfaceIfsExpV1Action::CreateASTConsumer(clang::CompilerInstance&,
llvm::StringRef)+0x5c>
+  51:  48 89 d8              mov    %rbx,%rax
+  54:  48 83 c4 18           add    $0x18,%rsp
+  58:  5b                    pop    %rbx
+  59:  41 5e                 pop    %r14
+  5b:  c3                    retq
+  5c:  e8 00 00 00 00        callq  61 <.L.str.4+0x7>
+
+Disassembly of section
.text._ZSt11make_uniqueIN12_GLOBAL__N_130InterfaceStubFunctionsConsumerEJRN5clang16CompilerInstanceERN4llvm9StringRefERA20_KcEENSt9_MakeUniqIT_E15__single_objectEDpOT0_:
+
+0000000000000000 <std::_MakeUniq<(anonymous
namespace)::InterfaceStubFunctionsConsumer>::__single_object
std::make_unique<(anonymous namespace)::InterfaceStubFunctionsConsumer,
clang::CompilerInstance&, llvm::StringRef&, char const (&)
[20]>(clang::CompilerInstance&, llvm::StringRef&, char const (&) [20])>:
    0:  41 57                 push   %r15
    2:  41 56                 push   %r14
    4:  41 54                 push   %r12
    6:  53                    push   %rbx
    7:  50                    push   %rax
-   8:  4d 89 c6              mov    %r8,%r14
-   b:  49 89 cf              mov    %rcx,%r15
-   e:  49 89 d4              mov    %rdx,%r12
-  11:  48 89 fb              mov    %rdi,%rbx
+   8:  49 89 ce              mov    %rcx,%r14
+   b:  49 89 d7              mov    %rdx,%r15
+   e:  48 89 f3              mov    %rsi,%rbx
+  11:  49 89 fc              mov    %rdi,%r12


-  79:  41 5c                 pop    %r12
-  7b:  41 5e                 pop    %r14
-  7d:  41 5f                 pop    %r15
-  7f:  c3                    retq
+  6e:  49 89 04 24           mov    %rax,(%r12)
+  72:  48 83 c4 08           add    $0x8,%rsp
+  76:  5b                    pop    %rbx
+  77:  41 5c                 pop    %r12
+  79:  41 5e                 pop    %r14
+  7b:  41 5f                 pop    %r15
+  7d:  c3                    retq
+
+Disassembly of section
.text._ZNSt10unique_ptrIN5clang11ASTConsumerESt14default_deleteIS1_EEC2IN12_GLOBAL__N_130InterfaceStubFunctionsConsumerES2_IS7_EvEEOS_IT_T0_E:
+
+0000000000000000 <std::unique_ptr<clang::ASTConsumer,
std::default_delete<clang::ASTConsumer> >::unique_ptr<(anonymous
namespace)::InterfaceStubFunctionsConsumer, std::default_delete<(anonymous
namespace)::InterfaceStubFunctionsConsumer>, void>(std::unique_ptr<(anonymous
namespace)::InterfaceStubFunctionsConsumer, std::default_delete<(anonymous
namespace)::InterfaceStubFunctionsConsumer> >&&)>:
+   0:  48 8b 06              mov    (%rsi),%rax
+   3:  48 c7 06 00 00 00 00  movq   $0x0,(%rsi)
+   a:  48 89 07              mov    %rax,(%rdi)
+   d:  c3                    retq
+
+Disassembly of section
.text._ZNSt10unique_ptrIN12_GLOBAL__N_130InterfaceStubFunctionsConsumerESt14default_deleteIS1_EED2Ev:
+
+0000000000000000 <std::unique_ptr<(anonymous
namespace)::InterfaceStubFunctionsConsumer, std::default_delete<(anonymous
namespace)::InterfaceStubFunctionsConsumer> >::~unique_ptr()>:
+   0:  53                    push   %rbx
+   1:  e8 00 00 00 00        callq  6 <std::unique_ptr<(anonymous
namespace)::InterfaceStubFunctionsConsumer, std::default_delete<(anonymous
namespace)::InterfaceStubFunctionsConsumer> >::~unique_ptr()+0x6>
+   6:  48 89 c3              mov    %rax,%rbx
+   9:  48 83 38 00           cmpq   $0x0,(%rax)
+   d:  74 08                 je     17 <std::unique_ptr<(anonymous
namespace)::InterfaceStubFunctionsConsumer, std::default_delete<(anonymous
namespace)::InterfaceStubFunctionsConsumer> >::~unique_ptr()+0x17>
+   f:  48 8b 3b              mov    (%rbx),%rdi
+  12:  e8 00 00 00 00        callq  17 <std::unique_ptr<(anonymous
namespace)::InterfaceStubFunctionsConsumer, std::default_delete<(anonymous
namespace)::InterfaceStubFunctionsConsumer> >::~unique_ptr()+0x17>
+  17:  48 c7 03 00 00 00 00  movq   $0x0,(%rbx)
+  1e:  5b                    pop    %rbx
+  1f:  c3                    retq

 Disassembly of section
.text._ZN5clang14FrontendAction22PrepareToExecuteActionERNS_16CompilerInstanceE:

@@ -25384,3 +25437,18 @@ Disassembly of section
.text._ZNSt8_Rb_treeIPKN5clang9NamedDeclES3_St9_IdentityI
   31:  41 5e                 pop    %r14
   33:  41 5f                 pop    %r15
   35:  c3                    retq
+
+Disassembly of section
.text._ZNSt15__uniq_ptr_implIN12_GLOBAL__N_130InterfaceStubFunctionsConsumerESt14default_deleteIS1_EE6_M_ptrEv:
+
+0000000000000000 <std::__uniq_ptr_impl<(anonymous
namespace)::InterfaceStubFunctionsConsumer, std::default_delete<(anonymous
namespace)::InterfaceStubFunctionsConsumer> >::_M_ptr()>:
+   0:  48 89 f8              mov    %rdi,%rax
+   3:  c3                    retq
+
+Disassembly of section
.text._ZNKSt14default_deleteIN12_GLOBAL__N_130InterfaceStubFunctionsConsumerEEclEPS1_:
+
+0000000000000000 <std::default_delete<(anonymous
namespace)::InterfaceStubFunctionsConsumer>::operator()((anonymous
namespace)::InterfaceStubFunctionsConsumer*) const>:
+   0:  48 85 ff              test   %rdi,%rdi
+   3:  74 06                 je     b <std::default_delete<(anonymous
namespace)::InterfaceStubFunctionsConsumer>::operator()((anonymous
namespace)::InterfaceStubFunctionsConsumer*) const+0xb>
+   5:  48 8b 07              mov    (%rdi),%rax
+   8:  ff 60 08              jmpq   *0x8(%rax)
+   b:  c3                    retq</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>