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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmalcolm at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
We really end up with the following bogus locations for test_t2:
xloc = expand_location (DECL_SOURCE_LOCATION (current_function_decl));
expanded_location endloc = expand_location (cfun->function_end_locus);

start location:
(gdb) p xloc
$2 = {
  file = 0x7fffffffe034 "/home/marxin/Programming/testcases/pr94029.c", 
  line = 3, 
  column = 3, 
  data = 0x0, 
  sysp = false
}

end location:
(gdb) p endloc
$3 = {
  file = 0x7fffffffe034 "/home/marxin/Programming/testcases/pr94029.c", 
  line = 2, 
  column = 1, 
  data = 0x0, 
  sysp = false
}

So it's probably a C error or linemap error? Here's where we set
cfun->function_end_locus = input_location:

#0  finish_function () at ../../gcc/c/c-decl.c:9931
#1  0x00000000009c6d1a in c_parser_declaration_or_fndef (parser=0x7ffff7fc6ab0,
fndef_ok=true, static_assert_ok=true, empty_ok=true, nested=false,
start_attr_ok=true, objc_foreach_object_declaration=0x0,
omp_declare_simd_clauses=..., have_attrs=false, attrs=<tree 0x0>,
    oacc_routine_data=0x0, fallthru_attr_p=0x0) at ../../gcc/c/c-parser.c:2523
#2  0x00000000009c5139 in c_parser_external_declaration (parser=0x7ffff7fc6ab0)
at ../../gcc/c/c-parser.c:1746
#3  0x00000000009c4c9b in c_parser_translation_unit (parser=0x7ffff7fc6ab0) at
../../gcc/c/c-parser.c:1619
#4  0x0000000000a02b56 in c_parse_file () at ../../gcc/c/c-parser.c:21710
#5  0x0000000000a8c47d in c_common_parse_file () at
../../gcc/c-family/c-opts.c:1186
#6  0x00000000012c2818 in compile_file () at ../../gcc/toplev.c:458
#7  0x00000000012c5a2e in do_compile () at ../../gcc/toplev.c:2273
#8  0x00000000012c5d27 in toplev::main (this=0x7fffffffd97e, argc=20,
argv=0x7fffffffda88) at ../../gcc/toplev.c:2412
#9  0x000000000235a260 in main (argc=20, argv=0x7fffffffda88) at
../../gcc/main.c:39

Reply via email to