[llvm-bugs] [Bug 26690] New: PowerPC64: SEGV in llvm::PPCInstPrinter::getRegisterName

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 22 04:21:17 PST 2016


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

            Bug ID: 26690
           Summary: PowerPC64: SEGV in
                    llvm::PPCInstPrinter::getRegisterName
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: PowerPC
          Assignee: unassignedbugs at nondot.org
          Reporter: anton at samba.org
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

I'm seeing issues with the fix for PR 26500. The following testcase:

struct {
  struct {
    int len_usable
  } video;
  struct {
    int cross4MB
  } capable
} f;
a, c, d, e, g, h, i, j;
*b;
fn1(*p1, p2, *p3) {
  switch (i)
  case 8:
  return 2;
  while (*b)
    switch (c) {
    case 0:
    case 8:
    case 6:
      a = 2;
    case 24:
      a = 4;
    }
  j = h * i * g;
  if (f.video.len_usable)
    g = f.video.len_usable / (h * i);
  if (f.capable.cross4MB && j)
    if (i) {
      d = h;
      *p3 = e;
    }
  if (g)
    *p1 = p2;
}

When built with:

# clang -O2 -no-integrated-as testcase.c

Gives:

0  clang-3.9 0x0000000010df15c0 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
+ 128
1  clang-3.9 0x0000000010df1a00
2  clang-3.9 0x0000000010def32c llvm::sys::RunSignalHandlers() + 124
3  clang-3.9 0x0000000010def564
4            0x00003fffb2a904d8 __kernel_sigtramp_rt64 + 0
5  clang-3.9 0x0000000010558a9c llvm::PPCInstPrinter::getRegisterName(unsigned
int) + 28
6  clang-3.9 0x0000000000034d8a llvm::PPCInstPrinter::getRegisterName(unsigned
int) + 4021142282
7  clang-3.9 0x00000000105656d4
llvm::PPCInstPrinter::printInstruction(llvm::MCInst const*, llvm::raw_ostream&)
+ 1604
8  clang-3.9 0x0000000010566ad0 llvm::PPCInstPrinter::printInst(llvm::MCInst
const*, llvm::raw_ostream&, llvm::StringRef, llvm::MCSubtargetInfo const&) +
1072
9  clang-3.9 0x0000000010c08a60
llvm::MCTargetStreamer::prettyPrintAsm(llvm::MCInstPrinter&,
llvm::raw_ostream&, llvm::MCInst const&, llvm::MCSubtargetInfo const&) + 64
10 clang-3.9 0x0000000010bccc98
11 clang-3.9 0x00000000112f24f4
llvm::AsmPrinter::EmitToStreamer(llvm::MCStreamer&, llvm::MCInst const&) + 84
12 clang-3.9 0x00000000104a12e8
13 clang-3.9 0x00000000112f5150 llvm::AsmPrinter::EmitFunctionBody() + 1568
14 clang-3.9 0x000000001049ad44
15 clang-3.9 0x00000000107a6a38
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 216
16 clang-3.9 0x0000000010a44c8c
llvm::FPPassManager::runOnFunction(llvm::Function&) + 620
17 clang-3.9 0x0000000010a451cc llvm::FPPassManager::runOnModule(llvm::Module&)
+ 76
18 clang-3.9 0x0000000010a44774
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1012
19 clang-3.9 0x0000000010a449fc llvm::legacy::PassManager::run(llvm::Module&) +
28
20 clang-3.9 0x0000000010f421ec
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_pwrite_stream*)
+ 4076
21 clang-3.9 0x0000000011520094
22 clang-3.9 0x000000001183afc8 clang::ParseAST(clang::Sema&, bool, bool) +
1224
23 clang-3.9 0x000000001125c3b8 clang::ASTFrontendAction::ExecuteAction() + 104
24 clang-3.9 0x0000000011521014 clang::CodeGenAction::ExecuteAction() + 36
25 clang-3.9 0x000000001125dc98 clang::FrontendAction::Execute() + 472
26 clang-3.9 0x0000000011230b40
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 336 
27 clang-3.9 0x00000000112ee2e8
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2184
28 clang-3.9 0x00000000104960c8 cc1_main(llvm::ArrayRef<char const*>, char
const*, void*) + 2472
29 clang-3.9 0x000000001046ac78 main + 1304
30 libc.so.6 0x00003fffb2473500
31 libc.so.6 0x00003fffb2473734 __libc_start_main + 180
Stack dump:
0.      Program arguments: /home/anton/llvm.install/bin/clang-3.9 -cc1 -triple
powerpc64le-unknown-linux-gnu -S -disable-free -disable-llvm-verifier
-main-file-name testcase.c -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -fmath-errno -masm-verbose -no-integrated-as
-mconstructor-aliases -fuse-init-array -target-cpu ppc64le -mfloat-abi hard
-target-abi elfv2 -dwarf-column-info -debugger-tuning=gdb -resource-dir
/home/anton/llvm.install/bin/../lib/clang/3.9.0 -O2 -fno-dwarf-directory-asm
-fdebug-compilation-dir /home/anton/linux.junk -ferror-limit 19
-fmessage-length 212 -fno-signed-char -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/x-df7ccf.s -x cpp-output testcase.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'testcase.c'.
4.      Running pass 'Linux PPC Assembly Printer' on function '@fn1'
clang-3.9: error: unable to execute command: Segmentation fault
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (git://github.com/llvm-mirror/clang.git
9013c06fb18e0618a264a4c63c75193b086be6e9)
(git://github.com/llvm-mirror/llvm.git
8659296d0e4507bd1c1051f4780216856144729f)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/anton/llvm.install/bin
clang-3.9: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.9: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.

-- 
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/20160222/4a110874/attachment-0001.html>


More information about the llvm-bugs mailing list