Repository: pytorch
Issue: Can not compile GridSamplerKernel.cpp with gcc-9.3
Labels: module: build,triaged

Attempt to compile abovementioned source using gcc-9.3 from pytorch-linux-bionic-py3.8-gcc9 fails with:
```
cd /var/lib/jenkins/workspace/build/caffe2 && /opt/cache/bin/sccache /opt/cache/bin/c++  -DAT_PARALLEL_OPENMP=1 -DCPUINFO_SUPPORTED_PLATFORM=1 -DFMT_HEADER_ONLY=1 -DFXDIV_USE_INLINE_ASSEMBLY=0 -DHAVE_MALLOC_USABLE_SIZE=1 -DHAVE_MMAP=1 -DHAVE_SHM_OPEN=1 -DHAVE_SHM_UNLINK=1 -DIDEEP_USE_MKL -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DNNP_CONVOLUTION_ONLY=0 -DNNP_INFERENCE_ONLY=0 -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DTH_BLAS_MKL -DTORCH_ENABLE_LLVM -DUSE_DISTRIBUTED -D_FILE_OFFSET_BITS=64 -Dtorch_cpu_EXPORTS -I/var/lib/jenkins/workspace/build/aten/src -I/var/lib/jenkins/workspace/aten/src -I/var/lib/jenkins/workspace/build -I/var/lib/jenkins/workspace -I/var/lib/jenkins/workspace/cmake/../third_party/benchmark/include -I/opt/llvm/include -I/var/lib/jenkins/workspace/build/caffe2/contrib/aten -I/var/lib/jenkins/workspace/third_party/onnx -I/var/lib/jenkins/workspace/build/third_party/onnx -I/var/lib/jenkins/workspace/third_party/foxi -I/var/lib/jenkins/workspace/build/third_party/foxi -I/var/lib/jenkins/workspace/caffe2/../torch/csrc/api -I/var/lib/jenkins/workspace/caffe2/../torch/csrc/api/include -I/var/lib/jenkins/workspace/caffe2/aten/src/TH -I/var/lib/jenkins/workspace/build/caffe2/aten/src/TH -I/var/lib/jenkins/workspace/caffe2/../torch/../aten/src -I/var/lib/jenkins/workspace/build/caffe2/aten/src -I/var/lib/jenkins/workspace/build/caffe2/../aten/src -I/var/lib/jenkins/workspace/build/caffe2/../aten/src/ATen -I/var/lib/jenkins/workspace/caffe2/../torch/csrc -I/var/lib/jenkins/workspace/caffe2/../torch/../third_party/miniz-2.0.8 -I/var/lib/jenkins/workspace/aten/src/TH -I/var/lib/jenkins/workspace/aten/../third_party/catch/single_include -I/var/lib/jenkins/workspace/aten/src/ATen/.. -I/var/lib/jenkins/workspace/build/caffe2/aten/src/ATen -I/var/lib/jenkins/workspace/third_party/miniz-2.0.8 -I/var/lib/jenkins/workspace/caffe2/core/nomnigraph/include -I/var/lib/jenkins/workspace/third_party/FXdiv/include -I/var/lib/jenkins/workspace/c10/.. -I/var/lib/jenkins/workspace/build/third_party/ideep/mkl-dnn/include -I/var/lib/jenkins/workspace/third_party/ideep/mkl-dnn/src/../include -I/var/lib/jenkins/workspace/third_party/cpuinfo/include -I/var/lib/jenkins/workspace/third_party/QNNPACK/include -I/var/lib/jenkins/workspace/third_party/pthreadpool/include -I/var/lib/jenkins/workspace/aten/src/ATen/native/quantized/cpu/qnnpack/include -I/var/lib/jenkins/workspace/aten/src/ATen/native/quantized/cpu/qnnpack/src -I/var/lib/jenkins/workspace/third_party/cpuinfo/deps/clog/include -I/var/lib/jenkins/workspace/third_party/NNPACK/include -I/var/lib/jenkins/workspace/third_party/fbgemm/include -I/var/lib/jenkins/workspace/third_party/fbgemm -I/var/lib/jenkins/workspace/third_party/fbgemm/third_party/asmjit/src -I/var/lib/jenkins/workspace/third_party/FP16/include -I/var/lib/jenkins/workspace/third_party/tensorpipe -I/var/lib/jenkins/workspace/third_party/fmt/include -isystem /var/lib/jenkins/workspace/build/third_party/gloo -isystem /var/lib/jenkins/workspace/cmake/../third_party/gloo -isystem /var/lib/jenkins/workspace/cmake/../third_party/googletest/googlemock/include -isystem /var/lib/jenkins/workspace/cmake/../third_party/googletest/googletest/include -isystem /var/lib/jenkins/workspace/third_party/protobuf/src -isystem /opt/conda/include -isystem /var/lib/jenkins/workspace/third_party/gemmlowp -isystem /var/lib/jenkins/workspace/third_party/neon2sse -isystem /var/lib/jenkins/workspace/third_party/XNNPACK/include -isystem /var/lib/jenkins/workspace/third_party -isystem /var/lib/jenkins/workspace/cmake/../third_party/eigen -isystem /opt/conda/include/python3.8 -isystem /opt/conda/lib/python3.8/site-packages/numpy/core/include -isystem /var/lib/jenkins/workspace/cmake/../third_party/pybind11/include -isystem /var/lib/jenkins/workspace/third_party/ideep/mkl-dnn/include -isystem /var/lib/jenkins/workspace/third_party/ideep/include -isystem /var/lib/jenkins/workspace/build/include  -Wno-deprecated -fvisibility-inlines-hidden -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_INTERNAL_THREADPOOL_IMPL -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Werror -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow -DHAVE_AVX_CPU_DEFINITION -DHAVE_AVX2_CPU_DEFINITION -O3 -DNDEBUG -DNDEBUG -fPIC   -DCAFFE2_USE_GLOO -DHAVE_GCC_GET_CPUID -DUSE_AVX -DUSE_AVX2 -DTH_HAVE_THREAD -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-write-strings -Wno-unknown-pragmas -Wno-missing-braces -Wno-maybe-uninitialized -Werror -Wno-strict-overflow -fvisibility=hidden -O2 -DCAFFE2_BUILD_MAIN_LIB -pthread -DASMJIT_STATIC -std=gnu++14 -O3  -DCPU_CAPABILITY=DEFAULT -DCPU_CAPABILITY_DEFAULT -o CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/cpu/GridSamplerKernel.cpp.DEFAULT.cpp.o -c /var/lib/jenkins/workspace/build/aten/src/ATen/native/cpu/GridSamplerKernel.cpp.DEFAULT.cpp

/var/lib/jenkins/workspace/aten/src/ATen/cpu/vec256/vec256_base.h:696:19: error: '*((void*)& grad_clip +8)' is used uninitialized in this function [-Werror=uninitialized]
/var/lib/jenkins/workspace/aten/src/ATen/cpu/vec256/vec256_base.h:696:19: error: '*((void*)& grad_clip +16)' is used uninitialized in this function [-Werror=uninitialized]
/var/lib/jenkins/workspace/aten/src/ATen/cpu/vec256/vec256_base.h:696:19: error: '*((void*)& grad_clip +24)' is used uninitialized in this function [-Werror=uninitialized]
/var/lib/jenkins/workspace/aten/src/ATen/cpu/vec256/vec256_base.h: In member function 'std::pair<at::vec256::{anonymous}::Vec256<T>, at::vec256::{anonymous}::Vec256<T> > at::native::{anonymous}::ComputeLocation<scalar_t, at::native::detail::GridSamplerPadding::Reflection, align_corners>::apply_get_grad(const Vec&) const [with scalar_t = float; bool align_corners = false]':
/var/lib/jenkins/workspace/aten/src/ATen/cpu/vec256/vec256_base.h:696:19: error: 'grad_clip' is used uninitialized in this function [-Werror=uninitialized]
  696 |     buffer[i] = op(a_ptr[i], b_ptr[i]);
      |                 ~~^~~~~~~~~~~~~~~~~~~~
/var/lib/jenkins/workspace/aten/src/ATen/cpu/vec256/vec256_base.h:696:19: error: '*((void*)& grad_clip +16)' is used uninitialized in this function [-Werror=uninitialized]
/var/lib/jenkins/workspace/aten/src/ATen/cpu/vec256/vec256_base.h: In function 'void at::native::{anonymous}::ApplyGridSample<scalar_t, 2, at::native::detail::GridSamplerInterpolation::Bilinear, padding, align_corners>::backward(at::TensorAccessor<scalar_t, 3>&, at::TensorAccessor<scalar_t, 3>&, const at::TensorAccessor<scalar_t, 3>&, const at::TensorAccessor<scalar_t, 3>&, int64_t, const Vec&, const Vec&, int64_t) const [with scalar_t = double; at::native::detail::GridSamplerPadding padding = at::native::detail::GridSamplerPadding::Border; bool align_corners = false]':
/var/lib/jenkins/workspace/aten/src/ATen/cpu/vec256/vec256_base.h:696:19: error: 'grad_clip' is used uninitialized in this function [-Werror=uninitialized]
  696 |     buffer[i] = op(a_ptr[i], b_ptr[i]);

```

cc @malfet