[llvm-bugs] [Bug 27233] New: Segfault when compiling with -O2

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 5 18:03:40 PDT 2016


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

            Bug ID: 27233
           Summary: Segfault when compiling with -O2
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Interprocedural Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: rtrieu at google.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

$ cat test.c
static void* vptr[1];

void run(int *ptr) {

  if (!ptr) {
    vptr[0] = &&point;
    return;
  }

  while (1) {
    point:
    continue;
  }
}

void init() {
  run(0); 
}
$ clang -cc1 -emit-obj -O2 test.c
#0 0x0000000001967118 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/bin/clang-3.5+0x1967118)
#1 0x00000000019656b6 llvm::sys::RunSignalHandlers()
(/usr/local/bin/clang-3.5+0x19656b6)
#2 0x000000000196782e SignalHandler(int) (/usr/local/bin/clang-3.5+0x196782e)
#3 0x00007f35c934d340 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10340)
#4 0x000000000075899e llvm::DataLayout::getTypeSizeInBits(llvm::Type*) const
(/usr/local/bin/clang-3.5+0x75899e)
#5 0x00000000011e130f llvm::MemoryLocation::get(llvm::StoreInst const*)
(/usr/local/bin/clang-3.5+0x11e130f)
#6 0x00000000015fcb93 checkFunctionMemoryAccess(llvm::Function&,
llvm::AAResults&, llvm::SmallSetVector<llvm::Function*, 8u> const&)
(/usr/local/bin/clang-3.5+0x15fcb93)
#7 0x00000000015fc205 (anonymous
namespace)::PostOrderFunctionAttrsLegacyPass::runOnSCC(llvm::CallGraphSCC&)
(/usr/local/bin/clang-3.5+0x15fc205)
#8 0x00000000022ee69b (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&)
(/usr/local/bin/clang-3.5+0x22ee69b)
#9 0x00000000015750f5 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/local/bin/clang-3.5+0x15750f5)
#10 0x0000000001ab9b63 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions
const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction,
llvm::raw_pwrite_stream*) (/usr/local/bin/clang-3.5+0x1ab9b63)
#11 0x00000000021c22bb
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/bin/clang-3.5+0x21c22bb)
#12 0x000000000256eb76 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/bin/clang-3.5+0x256eb76)
#13 0x0000000001e7c235 clang::FrontendAction::Execute()
(/usr/local/bin/clang-3.5+0x1e7c235)
#14 0x0000000001e470d1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/bin/clang-3.5+0x1e470d1)
#15 0x0000000001f11e4b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/bin/clang-3.5+0x1f11e4b)
#16 0x0000000000749d3c cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/bin/clang-3.5+0x749d3c)
#17 0x00000000007487e6 main (/usr/local/bin/clang-3.5+0x7487e6)
#18 0x00007f35c8864ec5 __libc_start_main
/build/eglibc-3GlaMS/eglibc-2.19/csu/libc-start.c:321:0
#19 0x0000000000745722 _start (/usr/local/bin/clang-3.5+0x745722)
Stack dump:
0.    Program arguments: clang -cc1 -emit-obj -O2 test.c 
1.    <eof> parser at end of file
2.    Per-module optimization passes
3.    Running pass 'CallGraph Pass Manager' on module 'test.c'.
Segmentation fault (core dumped)

This first appears at revision 265273.

-- 
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/20160406/6c5edccc/attachment-0001.html>


More information about the llvm-bugs mailing list