[PATCH] D49754: Add -m(no-)spe, and e500 CPU definitions and support to clang

vit9696 via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 16 01:42:31 PST 2018


vit9696 added a comment.

Thanks for the fix. I made a quick check of the mentioned patch, and it looks like it does solve the issue. However, besides the previous crash, which remains unfixed as of 7.0.1rc2, there is another instruction selection failure crash that may be caused by the change. I have not yet had a chance to properly research it, but here is an example if you feel interested: http://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_701/rc2/lib/builtins/divdc3.c

  clang -O3 -std=c11  -target powerpc-gnu-linux-eabi -ffreestanding -nostdlib -g -mcpu=e500 -mspe -femulated-tls -c divdc3.c -o divdc3.o
  fatal error: error in backend: Cannot select: 0x7fcb8184c270: i64 = build_pair 0x7fcb8184c208, 0x7fcb8184c1a0, divdc3.c:24:22
    0x7fcb8184c208: i32,ch,glue = CopyFromReg 0x7fcb8184c1a0:1, Register:i32 $r4, 0x7fcb8184c1a0:2, divdc3.c:24:22
      0x7fcb81846678: i32 = Register $r4
      0x7fcb8184c1a0: i32,ch,glue = CopyFromReg 0x7fcb8184c138, Register:i32 $r3, 0x7fcb8184c138:1, divdc3.c:24:22
        0x7fcb818465a8: i32 = Register $r3
        0x7fcb8184c138: ch,glue = callseq_end 0x7fcb8184c0d0, TargetConstant:i32<8>, TargetConstant:i32<0>, 0x7fcb8184c0d0:1, divdc3.c:24:22
          0x7fcb81846408: i32 = TargetConstant<8>
          0x7fcb81846470: i32 = TargetConstant<0>
          0x7fcb8184c0d0: ch,glue = PPCISD::CALL 0x7fcb8184c000, TargetExternalSymbol:i32'fmax' [TF=1], Register:i32 $r3, Register:i32 $r4, Register:i32 $r5, Register:i32 $r6, RegisterMask:Untyped, 0x7fcb8184c000:1, divdc3.c:24:22
            0x7fcb8184c068: i32 = TargetExternalSymbol'fmax' [TF=1]
            0x7fcb818465a8: i32 = Register $r3
            0x7fcb81846678: i32 = Register $r4
            0x7fcb81849f48: i32 = Register $r5
            0x7fcb8184a768: i32 = Register $r6
            0x7fcb818467b0: Untyped = RegisterMask
            0x7fcb8184c000: ch,glue = CopyToReg 0x7fcb8184a220, Register:i32 $r6, 0x7fcb81842200, 0x7fcb8184a220:1, divdc3.c:24:22
              0x7fcb8184a768: i32 = Register $r6
              0x7fcb81842200: i32 = truncate 0x7fcb8184c680, divdc3.c:24:22
                0x7fcb8184c680: i64,ch = load<(load 8 from %stack.7)> 0x7fcb8184c618, FrameIndex:i32<7>, undef:i32, divdc3.c:24:22
                  0x7fcb81846c28: i32 = FrameIndex<7>
                  0x7fcb81842818: i32 = undef
              0x7fcb8184a220: ch,glue = CopyToReg 0x7fcb81849c70, Register:i32 $r5, 0x7fcb8184c5b0, 0x7fcb81849c70:1, divdc3.c:24:22
                0x7fcb81849f48: i32 = Register $r5
                0x7fcb8184c5b0: i32 = truncate 0x7fcb8184c2d8, divdc3.c:24:22
                  0x7fcb8184c2d8: i64 = srl 0x7fcb8184c680, Constant:i32<32>, divdc3.c:24:22
                    0x7fcb8184c680: i64,ch = load<(load 8 from %stack.7)> 0x7fcb8184c618, FrameIndex:i32<7>, undef:i32, divdc3.c:24:22
  
  
                    0x7fcb81846fd0: i32 = Constant<32>
                0x7fcb81849c70: ch,glue = CopyToReg 0x7fcb81846540, Register:i32 $r4, 0x7fcb818469b8, 0x7fcb81846540:1, divdc3.c:24:22
                  0x7fcb81846678: i32 = Register $r4
                  0x7fcb818469b8: i32 = truncate 0x7fcb8184c750, divdc3.c:24:22
                    0x7fcb8184c750: i64,ch = load<(load 8 from %stack.8)> 0x7fcb818462d0, FrameIndex:i32<8>, undef:i32, divdc3.c:24:22
  
  
                  0x7fcb81846540: ch,glue = CopyToReg 0x7fcb818470a0, Register:i32 $r3, 0x7fcb8184c6e8, divdc3.c:24:22
                    0x7fcb818465a8: i32 = Register $r3
                    0x7fcb8184c6e8: i32 = truncate 0x7fcb818463a0, divdc3.c:24:22
  
    0x7fcb8184c1a0: i32,ch,glue = CopyFromReg 0x7fcb8184c138, Register:i32 $r3, 0x7fcb8184c138:1, divdc3.c:24:22
      0x7fcb818465a8: i32 = Register $r3
      0x7fcb8184c138: ch,glue = callseq_end 0x7fcb8184c0d0, TargetConstant:i32<8>, TargetConstant:i32<0>, 0x7fcb8184c0d0:1, divdc3.c:24:22
        0x7fcb81846408: i32 = TargetConstant<8>
        0x7fcb81846470: i32 = TargetConstant<0>
        0x7fcb8184c0d0: ch,glue = PPCISD::CALL 0x7fcb8184c000, TargetExternalSymbol:i32'fmax' [TF=1], Register:i32 $r3, Register:i32 $r4, Register:i32 $r5, Register:i32 $r6, RegisterMask:Untyped, 0x7fcb8184c000:1, divdc3.c:24:22
          0x7fcb8184c068: i32 = TargetExternalSymbol'fmax' [TF=1]
          0x7fcb818465a8: i32 = Register $r3
          0x7fcb81846678: i32 = Register $r4
          0x7fcb81849f48: i32 = Register $r5
          0x7fcb8184a768: i32 = Register $r6
          0x7fcb818467b0: Untyped = RegisterMask
          0x7fcb8184c000: ch,glue = CopyToReg 0x7fcb8184a220, Register:i32 $r6, 0x7fcb81842200, 0x7fcb8184a220:1, divdc3.c:24:22
            0x7fcb8184a768: i32 = Register $r6
            0x7fcb81842200: i32 = truncate 0x7fcb8184c680, divdc3.c:24:22
              0x7fcb8184c680: i64,ch = load<(load 8 from %stack.7)> 0x7fcb8184c618, FrameIndex:i32<7>, undef:i32, divdc3.c:24:22
                0x7fcb81846c28: i32 = FrameIndex<7>
                0x7fcb81842818: i32 = undef
            0x7fcb8184a220: ch,glue = CopyToReg 0x7fcb81849c70, Register:i32 $r5, 0x7fcb8184c5b0, 0x7fcb81849c70:1, divdc3.c:24:22
              0x7fcb81849f48: i32 = Register $r5
              0x7fcb8184c5b0: i32 = truncate 0x7fcb8184c2d8, divdc3.c:24:22
                0x7fcb8184c2d8: i64 = srl 0x7fcb8184c680, Constant:i32<32>, divdc3.c:24:22
                  0x7fcb8184c680: i64,ch = load<(load 8 from %stack.7)> 0x7fcb8184c618, FrameIndex:i32<7>, undef:i32, divdc3.c:24:22
                    0x7fcb81846c28: i32 = FrameIndex<7>
                    0x7fcb81842818: i32 = undef
                  0x7fcb81846fd0: i32 = Constant<32>
              0x7fcb81849c70: ch,glue = CopyToReg 0x7fcb81846540, Register:i32 $r4, 0x7fcb818469b8, 0x7fcb81846540:1, divdc3.c:24:22
                0x7fcb81846678: i32 = Register $r4
                0x7fcb818469b8: i32 = truncate 0x7fcb8184c750, divdc3.c:24:22
                  0x7fcb8184c750: i64,ch = load<(load 8 from %stack.8)> 0x7fcb818462d0, FrameIndex:i32<8>, undef:i32, divdc3.c:24:22
                    0x7fcb81846268: i32 = FrameIndex<8>
                    0x7fcb81842818: i32 = undef
                0x7fcb81846540: ch,glue = CopyToReg 0x7fcb818470a0, Register:i32 $r3, 0x7fcb8184c6e8, divdc3.c:24:22
                  0x7fcb818465a8: i32 = Register $r3
                  0x7fcb8184c6e8: i32 = truncate 0x7fcb818463a0, divdc3.c:24:22
                    0x7fcb818463a0: i64 = srl 0x7fcb8184c750, Constant:i32<32>, divdc3.c:24:22
  
  
  In function: __divdc3
  clang-7: error: clang frontend command failed with exit code 70 (use -v to see invocation)
  clang version 7.0.1 (tags/RELEASE_701/rc2 347035)
  Target: powerpc-gnu-linux-eabi
  Thread model: posix
  InstalledDir: /llvm/bin
  clang-7: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
  clang-7: note: diagnostic msg: 
  ********************
  
  PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
  Preprocessed source(s) and associated run script(s) are located at:
  clang-7: note: diagnostic msg: /var/folders/9y/zl96m3v94kgcc6wxx0tvqhsc0000gn/T/divdc3-042ad6.c
  clang-7: note: diagnostic msg: /var/folders/9y/zl96m3v94kgcc6wxx0tvqhsc0000gn/T/divdc3-042ad6.sh
  clang-7: note: diagnostic msg: Crash backtrace is located in
  clang-7: note: diagnostic msg: /Library/Logs/DiagnosticReports/clang-7_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
  clang-7: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
  clang-7: note: diagnostic msg: 
  
  ********************


Repository:
  rC Clang

https://reviews.llvm.org/D49754





More information about the cfe-commits mailing list