```NVCCFLAGS_OPTIONS_DBG = $(NVCCFLAGS_OPTIONS_ALL) -g -G -O0``` does not prevent variables from being optimized out

I used -G for debug build of our code, but as I used cuda-gdb to print values, I still saw them optimized out. The optimization is of a depth such that cuda-gdb cannot be used at all. Honestly, I have to use a lot of printf in CUDA kernels, and due to multithreading of kernels, it is very difficult to read messages printed this way. Is it a known bug of NVCC? BTW, we are using CUDA 11.7.