https://bugs.llvm.org/show_bug.cgi?id=42993

            Bug ID: 42993
           Summary: Type was merged incorrectly due to structure equality
                    during llvm-link
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: llvm-link
          Assignee: unassignedb...@nondot.org
          Reporter: yuant...@ict.ac.cn
                CC: llvm-bugs@lists.llvm.org

reproduce: (Sorry for exceeding the file size limit)

Download https://github.com/timmyyuan/LLVMBugReport/blob/master/b065_go_.o.bc
(765KB) and
https://github.com/timmyyuan/LLVMBugReport/blob/master/b069_go_.o.bc (2.43M)

llvm-link b065_go_.o.bc b069_go_.o.bc -o output.bc
llvm-dis b069_go_.o.bc
llvm-dis output.bc

In b069_go_.o.ll, the second parameter type of function
"google.golang.org..z2fgrpc..z2finternal..z2ftransport.inFlow.maybeAdjust" is
%".google.golang.org/grpc/internal/transport.inFlow.0"*, which declared as

%".google.golang.org/grpc/internal/transport.inFlow.0" = type { %Mutex.0, i32,
i32, i32, i32 }
%Mutex.0 = type { i32, i32 }

but in output.ll, the second parameter type of this function is %RWMutex.0*,
which declared as

%RWMutex.0 = type { %Linger.0, i32, i32, i32, i32 }
%Linger.0 = type { i32, i32 }

If we reverse the link order, i.e.

llvm-link b069_go_.o.bc b065_go_.o.bc -o output.bc

the phenomenon above will disappear.

llvm-dis -version:
LLVM (http://llvm.org/):
  LLVM version 10.0.0svn
  DEBUG build with assertions.
  Default target: x86_64-unknown-linux-gnu
  Host CPU: skylake

uname -a:
Linux yt 4.15.0-52-generic #56-Ubuntu SMP Tue Jun 4 22:49:08 UTC 2019 x86_64
x86_64 x86_64 GNU/Linux

llvm last commit id:
cc611e1756a8601fc377ebf854d419de9db7d783

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to