Good evening,

This patch removes the following static variables from 'final.cc':
  override_filename, override_linenum,
  override_columnnum, override_discriminator

You will note by browsing the trunk's code that override_filename is
never set, and therefore the only usage of those variables is never
triggered. They can therefore be safely removed.

For context, they were added in [1,2] to track code location for
some inline functions. It's the same patch which implemented
tree_nonartificial_location. These variables specifically were only
needed for DBX debugging info. Notice that their last (non-null) use
was removed on 7e0db0cdf (2022), when -gstabs and -gxcoff functionality
were removed.

I have successfully bootstrapped the compiler with the changes below.

[1] Commit in which override_filename was added: d752cfdb, Sep 2007
https://gcc.gnu.org/pipermail/gcc-patches/2007-August/224337.html

[2] Commit in which override_columnnum was added: 497b7c47, Feb 2017
https://gcc.gnu.org/pipermail/gcc-patches/2017-February/469644.html
referencing patch https://gcc.gnu.org/pipermail/gcc-patches/2017-February/469643.html

gcc/ChangeLog:

        * final.cc (notice_source_line): Remove dead condition
        for override_filename.

Signed-off-by: Léo Hardt <[email protected]>
---
 gcc/final.cc | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/gcc/final.cc b/gcc/final.cc
index 0152be59fc8..a99b188d043 100644
--- a/gcc/final.cc
+++ b/gcc/final.cc
@@ -133,12 +133,6 @@ static int high_function_linenum;
 /* Filename of last NOTE.  */
 static const char *last_filename;

-/* Override filename, line and column number.  */
-static const char *override_filename;
-static int override_linenum;
-static int override_columnnum;
-static int override_discriminator;
-
 /* Whether to force emission of a line note before the next insn.  */
 static bool force_source_line = false;

@@ -3001,13 +2995,6 @@ notice_source_line (rtx_insn *insn, bool *is_stmt)
       discriminator = compute_discriminator (loc);
       force_source_line = true;
     }
-  else if (override_filename)
-    {
-      filename = override_filename;
-      linenum = override_linenum;
-      columnnum = override_columnnum;
-      discriminator = override_discriminator;
-    }
   else if (INSN_HAS_LOCATION (insn))
     {
       expanded_location xloc = insn_location (insn);
--
2.39.5


Reply via email to