https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108716

            Bug ID: 108716
           Summary: [10/11/12/13 Regression] Incorrect
                    DW_AT_decl_{line,column} in DW_TAG_imported_decl
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

On the following testcase we used to emit DW_TAG_imported_decl with correct
DW_AT_decl_line before r0-90102-gd19c0f4b4cdf4bdffa31 , the PR37410 fix
resulted
in no DW_TAG_imported_decl being emitted at all and since
r0-92015-g98381eb4870eb42b220822 we emit it with a wrong line - one with }
closing the main function rather than the line on which it actually appears.

// PR debug/1XXXXX
// { dg-options "-gdwarf-5 -dA -fno-merge-debug-strings" }
// { dg-final { scan-assembler "DIE \\(\[^\n\r\]*\\)
DW_TAG_imported_module\[^\n\r\]*\[\n\r]*\[^\n\r\]*
DW_AT_decl_file\[^\n\r\]*\[\n\r]*\[^\n\r\]*0xc\[^\n\r\]*
DW_AT_decl_line\[^\n\r\]*\[\n\r]*(\[^\n\r\]*0x13\[^\n\r\]*
DW_AT_decl_column\[^\n\r\]*\[\n\r]*)?" } }

namespace M {
  int x = 1;
}

int
main ()
{
  using namespace M;
  return 0;
}

Reply via email to