[PATCH] D18172: [CUDA][OpenMP] Add a generic offload action builder

Samuel Antao via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 26 18:21:55 PDT 2016


sfantao added a comment.

In https://reviews.llvm.org/D18172#580276, @jlebar wrote:

> Hi, Samuel.
>
> This change introduced a new crash / assertion failure in the driver.
>
>   $ echo | llvm-run clang -emit-llvm -c -x cuda - -o /dev/null
>   
>
> Before this patch, we get an error (perhaps not as helpful as we might want, but still):
>
>   clang-3.8: error: cannot specify -o when generating multiple output files
>   
>
> After this patch, we get an assertion failure:
>
>   clang: ../clang/lib/Driver/Driver.cpp:1610: virtual (anonymous namespace)::OffloadingActionBuilder::DeviceActionBuilder::ActionBuilderReturnCode (anonymous namespace)::OffloadingActionBuilder::CudaActionBuilder::getDeviceDepences(OffloadAction::DeviceDependences &, phases::ID, phases::ID, PhasesTy &): Assertion `CurPhase < phases::Backend && "Generating single CUDA " "instructions should only occur " "before the backend phase!"' failed.
>   #0 0x0000000001b07e28 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/local/google/home/jlebar/llvm/release/bin/clang+0x1b07e28)
>   #1 0x0000000001b08566 SignalHandler(int) (/usr/local/google/home/jlebar/llvm/release/bin/clang+0x1b08566)
>   #2 0x00007f4bb7f89330 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
>   #3 0x00007f4bb6b7cc37 gsignal /build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
>   #4 0x00007f4bb6b80028 abort /build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
>   #5 0x00007f4bb6b75bf6 __assert_fail_base /build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0
>   #6 0x00007f4bb6b75ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
>   #7 0x0000000001fa809b (/usr/local/google/home/jlebar/llvm/release/bin/clang+0x1fa809b)
>   #8 0x0000000001f99981 clang::driver::Driver::BuildActions(clang::driver::Compilation&, llvm::opt::DerivedArgList&, llvm::SmallVector<std::pair<clang::driver::types::ID, llvm::opt::Arg const*>, 16u> const&, llvm::SmallVector<clang::driver::Action*, 3u>&) const (/usr/local/google/home/jlebar/llvm/release/bin/clang+0x1f99981)
>   #9 0x0000000001f9431c clang::driver::Driver::BuildCompilation(llvm::ArrayRef<char const*>) (/usr/local/google/home/jlebar/llvm/release/bin/clang+0x1f9431c)
>   #10 0x00000000007c0254 main (/usr/local/google/home/jlebar/llvm/release/bin/clang+0x7c0254)
>   #11 0x00007f4bb6b67f45 __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
>   #12 0x00000000007bd9a2 _start (/usr/local/google/home/jlebar/llvm/release/bin/clang+0x7bd9a2)
>   Stack dump:
>   0.	Program arguments: /usr/local/google/home/jlebar/llvm/release/bin/clang -emit-llvm -c -x cuda - -o /dev/null 
>   1.	Compilation construction
>   2.	Building compilation actions
>   Aborted (core dumped)
>
>
> This was reported two weeks ago by Gurunath Kadam on cfe-dev, but I just got around to bisecting it.
>
> Would you mind spinning a fix for this?


This should be fixed in r285263.

You should now get the same error message as before.


Repository:
  rL LLVM

https://reviews.llvm.org/D18172





More information about the cfe-commits mailing list