<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 - Compiler assert on Risc-V code"
   href="https://bugs.llvm.org/show_bug.cgi?id=42076">42076</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Compiler assert on Risc-V code
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>8.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>release blocker
          </td>
        </tr>

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

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

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

        <tr>
          <th>Reporter</th>
          <td>grogers@micron.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>Created <span class=""><a href="attachment.cgi?id=22054" name="attach_22054" title="C source file">attachment 22054</a> <a href="attachment.cgi?id=22054&action=edit" title="C source file">[details]</a></span>
C source file

risc-v clang assert on the following code:

float foobar(float x1, float x2, float x3)
{
    //return (x1+x2)/x3;
    return x1+x2;
}

Here is the trace back:
mfed04: grogers: r5float $ ~/scratch/llvm-project/riscv-build/bin/clang -c
float.c 
Stack dump:
0.      Program arguments: /work/grogers/llvm-project/riscv-build/bin/clang-8
-cc1 -triple riscv64-unknown-unknown-elf -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -discard-value-names -main-file-name float.c
-mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -nostdsysteminc -fuse-init-array
-target-abi lp64 -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file
/nethome/grogers/scratch/tmp/r5float/float.gcno -resource-dir
/work/grogers/llvm-project/riscv-build/lib/clang/8.0.0 -isysroot
/nethome/grogers/scratch/llvm-project/riscv-build -internal-isystem
/nethome/grogers/scratch/llvm-project/riscv-build/include
-fdebug-compilation-dir /nethome/grogers/scratch/tmp/r5float -ferror-limit 19
-fmessage-length 80 -fno-signed-char -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -o float.o -x c float.c -faddrsig 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'float.c'.
4.      Running pass 'RISCV DAG->DAG Pattern Instruction Selection' on function
'@foobar'
#0 0x00007f258470903a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/nethome/grogers/scratch/llvm-project/llvm/lib/Support/Unix/Signals.inc:499:0
#1 0x00007f2584706fd4 llvm::sys::RunSignalHandlers()
/nethome/grogers/scratch/llvm-project/llvm/lib/Support/Signals.cpp:69:0
#2 0x00007f2584707112 SignalHandler(int)
/nethome/grogers/scratch/llvm-project/llvm/lib/Support/Unix/Signals.inc:358:0
#3 0x00007f2581f34f20 (/lib/x86_64-linux-gnu/libc.so.6+0x3ef20)
#4 0x00007f258148f2da _ZN4llvm13TrackingMDRefC4ERKS0_
/nethome/grogers/scratch/llvm-project/llvm/include/llvm/IR/TrackingMDRef.h:34:0
#5 0x00007f258148f2da _ZN4llvm18TypedTrackingMDRefINS_6MDNodeEEC4ERKS2_
/nethome/grogers/scratch/llvm-project/llvm/include/llvm/IR/TrackingMDRef.h:115:0
#6 0x00007f258148f2da _ZN4llvm8DebugLocC4ERKS0_
/nethome/grogers/scratch/llvm-project/llvm/include/llvm/IR/DebugLoc.h:34:0
#7 0x00007f258148f2da _ZN4llvm5SDLocC4EPKNS_6SDNodeE
/nethome/grogers/scratch/llvm-project/llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1087:0
#8 0x00007f258148f2da
llvm::DAGTypeLegalizer::ExpandIntRes_FP_TO_SINT(llvm::SDNode*, llvm::SDValue&,
llvm::SDValue&)
/nethome/grogers/scratch/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:2336:0
#9 0x000055cd18acf910 
clang-8: error: unable to execute command: Segmentation fault (core dumped)
clang-8: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 8.0.0 
Target: riscv64-unknown-unknown-elf
Thread model: posix
InstalledDir: /nethome/grogers/scratch/llvm-project/riscv-build/bin
clang-8: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash backtrace, preprocessed source,
and associated run script.
clang-8: note: diagnostic msg:</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>