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

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Sep 2 17:27:48 PDT 2017


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

            Bug ID: 34432
           Summary: clang crashes at -O1 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

$ ~/trunk/polly/polly-root/bin/clang -v
clang version 6.0.0 (http://llvm.org/git/clang.git
48231c128c697271508e83b487d436a071e62f09) (http://llvm.org/git/llvm.git
074e282b60af6fa3954381faba5b121df4f4ea99)
Target: x86_64-unknown-linux-gnu
Thread model: posix


$ ~/trunk/polly/polly-root/bin/clang -mllvm -polly  abc.c -O1
abc.c:14:9: warning: incompatible pointer types assigning to 'char *' from
'long *' [-Wincompatible-pointer-types]
      f = &i;
        ^ ~~
abc.c:18:7: warning: expression result unused [-Wunused-value]
      g ?: (i %= i);
      ^~~~~~~~~~~~~
abc.c:21:9: warning: incompatible pointer types assigning to 'int *' from 'void
()' [-Wincompatible-pointer-types]
      h = fn1;
        ^ ~~~
/home/absozero/trunk/polly/llvm_git/tools/polly/lib/External/isl/isl_ast_build_expr.c:1653:
cannot handle void expression
#0 0x000000000232e6ba llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x232e6ba)
#1 0x000000000232c84e llvm::sys::RunSignalHandlers()
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x232c84e)
#2 0x000000000232c9b0 SignalHandler(int)
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x232c9b0)
#3 0x00007fb5edff4340 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10340)
#4 0x00007fb5ecde5cc9 gsignal
/build/buildd/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007fb5ecde90d8 abort /build/buildd/eglibc-2.19/stdlib/abort.c:91:0
#6 0x0000000004010a3b isl_handle_error
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x4010a3b)
#7 0x0000000003fea066 isl_ast_build_expr_from_pw_aff_internal
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x3fea066)
#8 0x0000000003fea230 isl_ast_build_from_multi_pw_aff_internal
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x3fea230)
#9 0x00000000029b4234 buildCondition(isl_ast_build*,
std::pair<isl_pw_multi_aff*, isl_pw_multi_aff*> const*,
std::pair<isl_pw_multi_aff*, isl_pw_multi_aff*> const*)
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x29b4234)
#10 0x00000000029b4bde polly::IslAst::buildRunCondition(polly::Scop&,
isl_ast_build*) (/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x29b4bde)
#11 0x00000000029b5087 polly::IslAst::init(polly::Dependences const&)
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x29b5087)
#12 0x00000000029b527c polly::IslAst::create(polly::Scop&, polly::Dependences
const&) (/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x29b527c)
#13 0x00000000029b6301 polly::IslAstInfoWrapperPass::runOnScop(polly::Scop&)
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x29b6301)
#14 0x00000000019f9c3d llvm::RGPassManager::runOnFunction(llvm::Function&)
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x19f9c3d)
#15 0x0000000001eab8e3 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x1eab8e3)
#16 0x0000000001eab98c llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x1eab98c)
#17 0x0000000001eac1fa llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x1eac1fa)
#18 0x00000000024cdf95 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x24cdf95)
#19 0x00000000024cf373 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/polly/polly-root/bin/clang-6.0+0x24cf373)
#20 0x0000000002cf17bf
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x2cf17bf)
#21 0x0000000002f14d9c clang::ParseAST(clang::Sema&, bool, bool)
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x2f14d9c)
#22 0x0000000002cf0c60 clang::CodeGenAction::ExecuteAction()
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x2cf0c60)
#23 0x0000000002883796 clang::FrontendAction::Execute()
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x2883796)
#24 0x00000000028563f6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x28563f6)
#25 0x000000000291f352
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0x291f352)
#26 0x0000000000d47dc8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0xd47dc8)
#27 0x0000000000cd513c main
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0xcd513c)
#28 0x00007fb5ecdd0ec5 __libc_start_main
/build/buildd/eglibc-2.19/csu/libc-start.c:321:0
#29 0x0000000000d436e9 _start
(/home/absozero/trunk/polly/polly-root/bin/clang-6.0+0xd436e9)
Stack dump:
0.      Program arguments: /home/absozero/trunk/polly/polly-root/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
-momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -resource-dir
/home/absozero/trunk/polly/polly-root/lib/clang/6.0.0 -c-isystem
/usr/local/include/csmith-2.3.0 -c-isystem /usr/local/include/csmith-2.3.0
-c-isystem . -cxx-isystem /usr/local/include/csmith-2.3.0 -cxx-isystem
/usr/local/include/csmith-2.3.0 -cxx-isystem . -internal-isystem
/usr/local/include -internal-isystem
/home/absozero/trunk/polly/polly-root/lib/clang/6.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O1
-fdebug-compilation-dir /home/absozero/projects/reduction -ferror-limit 19
-fmessage-length 172 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -mllvm -polly -o /tmp/abc-57e38a.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 - Generate an AST from the SCoP (isl)' on basic
block '%for.body5'
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 (http://llvm.org/git/clang.git
48231c128c697271508e83b487d436a071e62f09) (http://llvm.org/git/llvm.git
074e282b60af6fa3954381faba5b121df4f4ea99)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/absozero/trunk/polly/polly-root/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-4b5373.c
clang-6.0: note: diagnostic msg: /tmp/abc-4b5373.sh
clang-6.0: note: diagnostic msg:

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




$ cat abc.c
int a, b;
char c = 0;
long d;
short e;
void fn1() {
  char *f = &c;
  unsigned g;
  int *h = &a;
  for (;;) {
    for (; g <= 4; g++)
      ;
    if (d) {
      long i;
      f = &i;
      c = 7;
      for (; c <= 71; c++)
        e = b = e ?: (*h = 2) && i;
      g ?: (i %= i);
    }
    for (; c;) {
      h = fn1;
      *f = 2;
    }
  }
}

-- 
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/20170903/3fba4ef9/attachment-0001.html>


More information about the llvm-bugs mailing list