[llvm-bugs] [Bug 35362] New: clang crashes at -O3 and above with polly: cannot handle void expression

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 20 04:51:21 PST 2017


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

            Bug ID: 35362
           Summary: clang crashes at -O3 and above with polly: cannot
                    handle void expression
           Product: Polly
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Optimizer
          Assignee: polly-dev at googlegroups.com
          Reporter: helloqirun at gmail.com
                CC: llvm-bugs at lists.llvm.org

The hashtag for polly is c702e3805f3.

Clang compiles.


$ clang-trunk -v
clang version 6.0.0 (trunk 318641)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin


$ clang-trunk -O3 abc.c
abc.c:14:9: warning: expression result unused [-Wunused-value]
        *g ?: (d = b);
        ^~~~~~~~~~~~~
1 warning generated.

$ clang-trunk -O3 -mllvm -polly abc.c
abc.c:14:9: warning: expression result unused [-Wunused-value]
        *g ?: (d = b);
        ^~~~~~~~~~~~~
/home/absozero/trunk/llvm/tools/polly/lib/External/isl/isl_ast_build_expr.c:1653:
cannot handle void expression
#0 0x0000000002109b8a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x2109b8a)
#1 0x0000000002107a2e llvm::sys::RunSignalHandlers()
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x2107a2e)
#2 0x0000000002107b82 SignalHandler(int)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x2107b82)
#3 0x00007f8543efe330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007f8542a7bc37 gsignal
/build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007f8542a7f028 abort
/build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#6 0x0000000003d24f96 isl_handle_error
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x3d24f96)
#7 0x0000000003cfae6e isl_ast_build_expr_from_pw_aff_internal
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x3cfae6e)
#8 0x0000000003cfb040 isl_ast_build_from_multi_pw_aff_internal
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x3cfb040)
#9 0x0000000002810d68 IslNodeBuilder::createNewAccesses(polly::ScopStmt*,
isl_ast_node*) (/home/absozero/trunk/root-clang/bin/clang-6.0+0x2810d68)
#10 0x0000000002814060 IslNodeBuilder::createUser(isl_ast_node*)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x2814060)
#11 0x0000000002812cb8 IslNodeBuilder::createIf(isl_ast_node*)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x2812cb8)
#12 0x00000000028111b8 IslNodeBuilder::createBlock(isl_ast_node*)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x28111b8)
#13 0x00000000027b2dc6 CodeGen(polly::Scop&, polly::IslAstInfo&,
llvm::LoopInfo&, llvm::DominatorTree&, llvm::ScalarEvolution&,
llvm::RegionInfo&) [clone .constprop.277]
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x27b2dc6)
#14 0x000000000176b323 llvm::RGPassManager::runOnFunction(llvm::Function&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x176b323)
#15 0x0000000001c28903 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x1c28903)
#16 0x0000000001c289cc llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x1c289cc)
#17 0x0000000001c2849d llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x1c2849d)
#18 0x00000000022bff36 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x22bff36)
#19 0x0000000002aeb0c7
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x2aeb0c7)
#20 0x0000000002ccbc18 clang::ParseAST(clang::Sema&, bool, bool)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x2ccbc18)
#21 0x0000000002aea47c clang::CodeGenAction::ExecuteAction()
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x2aea47c)
#22 0x000000000267681e clang::FrontendAction::Execute()
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x267681e)
#23 0x0000000002645b66
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x2645b66)
#24 0x00000000027097a3
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x27097a3)
#25 0x0000000000a593e8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/absozero/trunk/root-clang/bin/clang-6.0+0xa593e8)
#26 0x00000000009d4d15 main
(/home/absozero/trunk/root-clang/bin/clang-6.0+0x9d4d15)
#27 0x00007f8542a66f45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#28 0x0000000000a558f9 _start
(/home/absozero/trunk/root-clang/bin/clang-6.0+0xa558f9)
Stack dump:
0.      Program arguments: /home/absozero/trunk/root-clang/bin/clang-6.0 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name abc.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -resource-dir
/home/absozero/trunk/root-clang/lib/clang/6.0.0 -internal-isystem
/usr/local/include -internal-isystem
/home/absozero/trunk/root-clang/lib/clang/6.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-fdebug-compilation-dir /home/absozero/projects/reduction/crash -ferror-limit
19 -fmessage-length 130 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -vectorize-slp -mllvm -polly -o
/tmp/abc-8594f3.o -x c abc.c
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'Function Pass Manager' on module 'abc.c'.
4.      Running pass 'Region Pass Manager' on function '@fn1'
5.      Running pass 'Polly - Create LLVM-IR from SCoPs' on basic block
'%if.end'
clang-6.0: error: unable to execute command: Aborted (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (trunk 318641)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-6.0: 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-6.0: note: diagnostic msg:
********************

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

********************


$ cat abc.c
unsigned short a;
char b, c, d;
long e;
char **f;
void fn1() {
  char *g = &c;
  for (;;)
    for (; d;) {
      unsigned h = 4008264728;
      h /= a;
      if (*f)
        *g = 0;
      for (; a; a++) {
        *g ?: (d = b);
        h == 1 || (e = 9);
        c = 4;
      }
    }
}
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/20171120/9fd2c321/attachment-0001.html>


More information about the llvm-bugs mailing list