[llvm-bugs] [Bug 42115] New: Risc-V C compiler assert #2

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 3 08:41:24 PDT 2019


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

            Bug ID: 42115
           Summary: Risc-V C compiler assert #2
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: grogers at micron.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Created attachment 22067
  --> https://bugs.llvm.org/attachment.cgi?id=22067&action=edit
source for the assert

risc-v clang assert on the following code:

void 
test(int n, complex double s[], complex double a[], complex double b[])
{   
    int i;
    for (i=0;i<n;i++) 
        s[i] = a[i] * b[i];
}

with the following back-trace:
mfed03: grogers: complex $ ./dcmplx5.compile dcmplx5
fatal error: error in backend: Cannot select: 0x563c18a9c8e0: f64 = bitcast
      0x563c18a9ba40
  0x563c18a9ba40: i64,ch,glue = CopyFromReg 0x563c18a9bd18:1, Register:i64
$x11, 0x563c18a9bd18:2
    0x563c18a9baa8: i64 = Register $x11
    0x563c18a9bd18: i64,ch,glue = CopyFromReg 0x563c18a9bd80, Register:i64
$x10, 0x563c18a9bd80:1
      0x563c18a9b9d8: i64 = Register $x10
      0x563c18a9bd80: ch,glue = callseq_end 0x563c18a9c400,
TargetConstant:i64<0>, TargetConstant:i64<0>, 0x563c18a9c400:1
        0x563c18a9e870: i64 = TargetConstant<0>
        0x563c18a9e870: i64 = TargetConstant<0>
        0x563c18a9c400: ch,glue = RISCVISD::CALL 0x563c18a9bf88,
TargetGlobalAddress:i64<[2 x i64] (double, double, double, double)* @__muldc3>
0, Register:f64 $x10, Register:f64 $x11, Register:f64 $x12, Register:f64 $x13,
RegisterMask:Untyped, 0x563c18a9bf88:1
          0x563c18a9bc48: i64 = TargetGlobalAddress<[2 x i64] (double, double,
double, double)* @__muldc3> 0
          0x563c18a9c058: f64 = Register $x10
          0x563c18a9eae0: f64 = Register $x11
          0x563c18a9c4d0: f64 = Register $x12
          0x563c18a9c0c0: f64 = Register $x13
          0x563c18a9bcb0: Untyped = RegisterMask
          0x563c18a9bf88: ch,glue = CopyToReg 0x563c18a9bf20, Register:f64
$x13, 0x563c18a9c7a8, 0x563c18a9bf20:1
            0x563c18a9c0c0: f64 = Register $x13
            0x563c18a9c7a8: f64,ch = CopyFromReg 0x563c18a31698, Register:f64
%11
              0x563c18a9bb10: f64 = Register %11
            0x563c18a9bf20: ch,glue = CopyToReg 0x563c18a9c1f8, Register:f64
$x12, 0x563c18a9c6d8, 0x563c18a9c1f8:1
              0x563c18a9c4d0: f64 = Register $x12
              0x563c18a9c6d8: f64,ch = CopyFromReg 0x563c18a31698, Register:f64
%10
                0x563c18a9c5a0: f64 = Register %10
              0x563c18a9c1f8: ch,glue = CopyToReg 0x563c18a9c810, Register:f64
$x11, 0x563c18a9c608, 0x563c18a9c810:1
                0x563c18a9eae0: f64 = Register $x11
                0x563c18a9c608: f64,ch = CopyFromReg 0x563c18a31698,
Register:f64 %9
                  0x563c18a9c468: f64 = Register %9
                0x563c18a9c810: ch,glue = CopyToReg 0x563c18a9e9a8,
Register:f64 $x10, 0x563c18a9c670
                  0x563c18a9c058: f64 = Register $x10
                  0x563c18a9c670: f64,ch = CopyFromReg 0x563c18a31698,
Register:f64 %8

Here is the shell commands:
# Crash reproducer for clang version 8.0.0 
# Driver args: "-O2" "-I" "/nethome/grogers/scratch/emd/emd/simlib/include"
"dcmplx5.r5.c" "-L/nethome/grogers/scratch/emd/emd/emd-clang/simlib/lib"
"-Wl,-static" "-lhtp_runtime" "-o" "dcmplx5.r5.exe"
# Original command:  "/work/grogers/llvm-project/riscv-build/riscv/bin/clang-8"
"-cc1" "-triple" "riscv64-unknown-unknown-elf" "-emit-obj" "-disable-free"
"-disable-llvm-verifier" "-discard-value-names" "-main-file-name"
"dcmplx5.r5.c" "-mrelocation-model" "static" "-mthread-model" "posix"
"-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-nostdsysteminc"
"-fuse-init-array" "-target-abi" "lp64" "-dwarf-column-info"
"-debugger-tuning=gdb" "-momit-leaf-frame-pointer" "-resource-dir"
"/work/grogers/llvm-project/riscv-build/riscv/lib/clang/8.0.0" "-I"
"/nethome/grogers/scratch/emd/emd/simlib/include" "-isysroot"
"/nethome/grogers/scratch/emd/llvm-riscv-tools/riscv-build/riscv/riscv64-unknown-elf"
"-internal-isystem"
"/nethome/grogers/scratch/emd/llvm-riscv-tools/riscv-build/riscv/riscv64-unknown-elf/include"
"-O2" "-fdebug-compilation-dir"
"/nethome/grogers/scratch/emd/emd/htp-tests/apps/complex" "-ferror-limit" "19"
"-fmessage-length" "80" "-fno-signed-char" "-fobjc-runtime=gcc"
"-fdiagnostics-show-option" "-fcolor-diagnostics" "-vectorize-loops"
"-vectorize-slp" "-o" "/tmp/dcmplx5-153342.o" "-x" "c" "dcmplx5.r5.c"
"-faddrsig"
 "/work/grogers/llvm-project/riscv-build/riscv/bin/clang-8" "-cc1" "-triple"
"riscv64-unknown-unknown-elf" "-emit-obj" "-disable-free"
"-disable-llvm-verifier" "-discard-value-names" "-main-file-name"
"dcmplx5.r5.c" "-mrelocation-model" "static" "-mthread-model" "posix"
"-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-nostdsysteminc"
"-fuse-init-array" "-target-abi" "lp64" "-dwarf-column-info"
"-debugger-tuning=gdb" "-momit-leaf-frame-pointer" "-O2" "-ferror-limit" "19"
"-fmessage-length" "80" "-fno-signed-char" "-fobjc-runtime=gcc"
"-fdiagnostics-show-option" "-fcolor-diagnostics" "-vectorize-loops"
"-vectorize-slp" "-x" "c" "dcmplx5-0b62f4.c" "-faddrsig"

-- 
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/20190603/83973281/attachment.html>


More information about the llvm-bugs mailing list