flang icon indicating copy to clipboard operation
flang copied to clipboard

Do not dump debug location if debug info is not available

Open dmikushin opened this issue 2 years ago • 4 comments

This works around the crash due to the NULL value of module->debug_info.

dmikushin avatar Jun 28 '23 17:06 dmikushin

Can you provide a test case or a simple reproducer? I suspect that we haven't seen this problem previously, thanks to the short-circuit evaluation of LL_MDREF_IS_NULL(instrs->dbg_line_op). I'm curious how instrs->dbg_line_op is non-null when no -g flag is specified on the flang command line.

bryanpkc avatar Jul 11 '23 22:07 bryanpkc

I'll try to remember the details. For now I can tell that the crash occurred when testing openmp target offloading. Maybe code generation for offloading goes with some different options?

dmikushin avatar Jul 11 '23 23:07 dmikushin

@dmikushin gentle ping

bryanpkc avatar Oct 18 '23 11:10 bryanpkc

I will try to reproduce it again. This happens when I try to perform openmp offloading. It has some code extraction mechanics that the loop goes into a separate compilation unit, but the debug info remains attached to the main object, so the offloaded object does not inherit it, hence is the unexpectedly missing pointer value.

So for the current state of Flang, this scenario is purely theoretical, as long as openmp offload support is not officially endorsed.

dmikushin avatar Oct 18 '23 12:10 dmikushin