ABataev added a comment. In D58463#1410900 <https://reviews.llvm.org/D58463#1410900>, @tra wrote:
> There's a new quirk we've ran into after this patch landed. Consider this > code: > > int foo() { > int prev; > __asm__ __volatile__("mov %0, 0" : "=a" (prev)::); > return prev; > } > > > When we compile for device, asm constraint is not valid for NVPTX, we emit > delayed diag and move on. The function is never code-gen'ed so the diag never > shows up. So far so good. > > Now we add `-Werror -Wininitialized` and things break -- because we bail out > early, `prev` is left uninitialized and is reported as such. > > $ bin/clang++ -c --cuda-gpu-arch=sm_35 asm.cu -nocudainc --cuda-device-only > -Wuninitialized -Werror > asm.cu:4:10: error: variable 'prev' is uninitialized when used here > [-Werror,-Wuninitialized] > return prev; > ^~~~ > asm.cu:2:11: note: initialize the variable 'prev' to silence this warning > int prev; > ^ > = 0 > 1 error generated when compiling for sm_35. > > > > I think this should also show up in the test case in this patch, too, if you > add -Wuninitialized Hi Artem, I think we can just delay emission of this warning to solve this problem. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58463/new/ https://reviews.llvm.org/D58463 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits