mirror of
https://gcc.gnu.org/git/gcc.git
synced 2025-01-09 20:44:07 +08:00
final: accept markers at line 0
Back when I introduced debug markers, I seem to have been under the impression that location line 0 would only ever occur for unknown and builtin locations. Though line 0 never comes up in normal processing of source files, and debug info formats often cannot represent them, I suppose there's no need to preemptively discard them during final. for gcc/ChangeLog PR debug/97714 * final.c (notice_source_line): Narrow down the condition to skip a line-0 marker. for gcc/testsuite/ChangeLog PR debug/97714 * gcc.dg/debug/pr97714.c: New.
This commit is contained in:
parent
bf5cbb9edf
commit
57450da2fe
11
gcc/final.c
11
gcc/final.c
@ -3250,12 +3250,11 @@ notice_source_line (rtx_insn *insn, bool *is_stmt)
|
|||||||
{
|
{
|
||||||
location_t loc = NOTE_MARKER_LOCATION (insn);
|
location_t loc = NOTE_MARKER_LOCATION (insn);
|
||||||
expanded_location xloc = expand_location (loc);
|
expanded_location xloc = expand_location (loc);
|
||||||
if (xloc.line == 0)
|
if (xloc.line == 0
|
||||||
{
|
&& (LOCATION_LOCUS (loc) == UNKNOWN_LOCATION
|
||||||
gcc_checking_assert (LOCATION_LOCUS (loc) == UNKNOWN_LOCATION
|
|| LOCATION_LOCUS (loc) == BUILTINS_LOCATION))
|
||||||
|| LOCATION_LOCUS (loc) == BUILTINS_LOCATION);
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
filename = xloc.file;
|
filename = xloc.file;
|
||||||
linenum = xloc.line;
|
linenum = xloc.line;
|
||||||
columnnum = xloc.column;
|
columnnum = xloc.column;
|
||||||
|
11
gcc/testsuite/gcc.dg/debug/pr97714.c
Normal file
11
gcc/testsuite/gcc.dg/debug/pr97714.c
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
/* { dg-do compile } */
|
||||||
|
/* { dg-options "-O -g" } */
|
||||||
|
|
||||||
|
void
|
||||||
|
function ()
|
||||||
|
{
|
||||||
|
if (0)
|
||||||
|
{
|
||||||
|
#line 0 "whatever"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user