[llvm-bugs] [Bug 27278] New: crash with "-O3 -m32" on x86_64-linux-gnu (Assertion `!Traits::stopLess(b, a) && "Invalid interval"' failed.)

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 8 03:05:14 PDT 2016


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

            Bug ID: 27278
           Summary: crash with "-O3 -m32" on x86_64-linux-gnu (Assertion
                    `!Traits::stopLess(b, a) && "Invalid interval"'
                    failed.)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: chengniansun at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The following code crashes the clang trunk at -O3 in 32-bit mode (not 64-bit
mode) on x86_64-linux-gnu.


$: clang-trunk -v
clang version 3.9.0 (trunk 265644)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.3
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.4
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.2
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$: 
$: clang-trunk small.c -w -m32 -O3
clang-3.9:
/tmp/llvm-builder/llvm-source-trunk/include/llvm/ADT/IntervalMap.h:627:
unsigned int llvm::IntervalMapImpl::LeafNode< <template-parameter-1-1>,
<template-parameter-1-2>, <anonymous>, <template-parameter-1-4>
>::insertFrom(unsigned int&, unsigned int, KeyT, KeyT, ValT) [with KeyT =
llvm::SlotIndex; ValT = unsigned int; unsigned int N = 9u; Traits =
llvm::IntervalMapInfo<llvm::SlotIndex>]: Assertion `!Traits::stopLess(b, a) &&
"Invalid interval"' failed.
0  clang-3.9       0x0000000001d6bbf5
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  clang-3.9       0x0000000001d69b86 llvm::sys::RunSignalHandlers() + 54
2  clang-3.9       0x0000000001d69da4
3  libpthread.so.0 0x00007f226d888340
4  libc.so.6       0x00007f226caa6cc9 gsignal + 57
5  libc.so.6       0x00007f226caaa0d8 abort + 328
6  libc.so.6       0x00007f226ca9fb86
7  libc.so.6       0x00007f226ca9fc32
8  clang-3.9       0x000000000186dd13
llvm::IntervalMapImpl::LeafNode<llvm::SlotIndex, unsigned int, 9u,
llvm::IntervalMapInfo<llvm::SlotIndex> >::insertFrom(unsigned int&, unsigned
int, llvm::SlotIndex, llvm::SlotIndex, unsigned int) + 1779
9  clang-3.9       0x0000000001879fbc
10 clang-3.9       0x000000000187a94f
11 clang-3.9       0x000000000187c19d
12 clang-3.9       0x0000000001811288
13 clang-3.9       0x0000000001811ccb
14 clang-3.9       0x00000000019434e2 llvm::RegAllocBase::allocatePhysRegs() +
306
15 clang-3.9       0x000000000180dba2
16 clang-3.9       0x0000000001774e45
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 357
17 clang-3.9       0x00000000019f4163
llvm::FPPassManager::runOnFunction(llvm::Function&) + 643
18 clang-3.9       0x00000000019f47ab
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 619
19 clang-3.9       0x0000000001eb2bd2
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::DataLayout const&, llvm::Module*, clang::BackendAction,
llvm::raw_pwrite_stream*) + 3266
20 clang-3.9       0x00000000024ce80a
21 clang-3.9       0x000000000280ed6d clang::ParseAST(clang::Sema&, bool, bool)
+ 845
22 clang-3.9       0x00000000024ceb6e clang::CodeGenAction::ExecuteAction() +
78
23 clang-3.9       0x00000000021b7a8e clang::FrontendAction::Execute() + 286
24 clang-3.9       0x000000000219083e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 318
25 clang-3.9       0x0000000002241d22
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2370
26 clang-3.9       0x0000000000ac4dd8 cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 3288
27 clang-3.9       0x0000000000a808ad main + 6125
28 libc.so.6       0x00007f226ca91ec5 __libc_start_main + 245
29 clang-3.9       0x0000000000ac0e24
Stack dump:
0.    Program arguments: /usr/local/clang-trunk/bin/clang-3.9 -cc1 -triple
i386-unknown-linux-gnu -emit-obj -disable-free -main-file-name small.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -fuse-init-array -target-cpu pentium4
-momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -resource-dir
/usr/local/clang-trunk/bin/../lib/clang/3.9.0 -internal-isystem
/usr/local/include -internal-isystem
/usr/local/clang-trunk/bin/../lib/clang/3.9.0/include -internal-externc-isystem
/include -internal-externc-isystem /usr/include -O3 -w -fdebug-compilation-dir
/data2/c-hunter-results/C/instrument-bugs/REDUCED/20160406-clang-trunk-m32-g-O3-build-135108/delta
-ferror-limit 19 -fmessage-length 261 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/small-4be074.o -x c small.c 
1.    <eof> parser at end of file
2.    Code generation
3.    Running pass 'Function Pass Manager' on module 'small.c'.
4.    Running pass 'Greedy Register Allocator' on function '@fn1'
clang-3.9: error: unable to execute command: Aborted (core dumped)
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (trunk 265644)
Target: i386-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/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: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.9: note: diagnostic msg: /tmp/small-acc623.c
clang-3.9: note: diagnostic msg: /tmp/small-acc623.sh
clang-3.9: note: diagnostic msg: 

********************
$: 
$: cat small.c
char a;
long long b, e, g;
unsigned c;
int d;
volatile short f;
short h;
volatile char i;
long j;
void fn1() {
  long long k;
  unsigned l = b & (c | 7594888613);
  int m = d || i;
  char n = e || c % l;
  k = b;
LABEL_mSmSDb:
  if (h)
    a = h;
LABEL_BRBRN:
  g = ~(~(b ^ e > g * ~d * ~k) & m % c);
  b = ~(e - l || b & (n >> j & f) * k);
  c = ~((~g - c) * d);
  if (i)
    goto LABEL_BRBRN;
  if (k) {
    printf("g_671=%lld\n", (long long)d);
    d = ~g;
    goto LABEL_BRBRN;
  }
  goto LABEL_mSmSDb;
}

int main() {}

-- 
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/20160408/8c5694c7/attachment-0001.html>


More information about the llvm-bugs mailing list