[llvm-bugs] [Bug 50923] New: linking results in crash in remangleIntrinsicFunction

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 28 05:21:09 PDT 2021


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

            Bug ID: 50923
           Summary: linking results in crash in remangleIntrinsicFunction
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Bitcode Reader
          Assignee: unassignedbugs at nondot.org
          Reporter: jeroen.dobbelaere at synopsys.com
                CC: llvm-bugs at lists.llvm.org

The problem was triggered in a thinlto build of llvm with the full restrict
patches.

The description here shows the same problem with llvm.ssa.copy:

remangle1.ll: contains a struct type:
   %fum

remangle2.ll contains two versions of that type: (maybe because of template
instantiation ?)
   %fum
   %fum.1

and three declarations using those structs:

declare void @foo(%fum*)
declare %fum.1** @"llvm.ssa.copy.p0p0s_fum.1s"(%fum.1**)
declare %fum** @"llvm.ssa.copy.p0p0s_fums"(%fum**)

File 1 and 2 also contain some other clashing type %aab. Because of that, when
file2 is read,
   %fum    is mapped onto     %fum.1       (the unique id happens to be '1'
!!!)
But, somewhat later,    %fum.1  also clashes and is now mapped onto:   
%fum.1.2

So, the original declarations become:
  declare %fum.1.2** @"llvm.ssa.copy.p0p0s_fum.1s"(%fum.1.2**)
  declare %fum.1** @"llvm.ssa.copy.p0p0s_fums"(%fum.1**)

After remangling, these will become:
  declare %fum.1.2** @"llvm.ssa.copy.p0p0s_fum.1.2s"(%fum.1.2**)
  declare %fum.1** @"llvm.ssa.copy.p0p0s_fum.1s"(%fum.1**)

But, as the bitcodereader keeps all declarations alive, there now is a
conflicting type for '@"llvm.ssa.copy.p0p0s_fum.1s"'
which triggers the crash.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210628/cc47e831/attachment.html>


More information about the llvm-bugs mailing list