This hack, has described in more details in the email labeled "Line 0 Hack??", 
was now causing problem when serializing the line_table in pph.

According to the revision history: this was introduced by steven in 2005:
    commit ba821eb102fc1a654c0542fcba73898340a9a02d
    Author: steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>
    Date:   Sat Jan 1 16:15:23 2005 +0000

            * emit-rtl.c (add_insn_before): Fix comment typo.
        
            PR middle-end/17544
            * c-decl.c (finish_function): If compiling C99, annotate the
            compiler generated return with the current file name and line 0.
            * tree-cfg.c (remove_useless_stmts_warn_notreached): Only warn if
            the source line is greater than 0.

            git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92784 
138bc75d-0d04-0410-961f-82ee72b054a4

The function remove_useless_stmts_warn_notreached refered to by steven in his 
2005 commit has been removed on 2009-10-08 by m...@suse.de according to 
ChangeLog-2009.

This patch removes this hack which appears to be no longer necessary.

Tested with a full bootstrap build and regression testing on x64.

Gabriel

2011-08-01  Gabriel Charette  <gch...@google.com>

        * decl.c (finish_function): Remove unecessary line 0 hack.

diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 2000bd4..9ee3c6d 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -13220,22 +13220,13 @@ finish_function (int flags)
     {
       if (DECL_MAIN_P (current_function_decl))
        {
-         tree stmt;
-
          /* Make it so that `main' always returns 0 by default (or
             1 for VMS).  */
 #if VMS_TARGET
-         stmt = finish_return_stmt (integer_one_node);
+         finish_return_stmt (integer_one_node);
 #else
-         stmt = finish_return_stmt (integer_zero_node);
+         finish_return_stmt (integer_zero_node);
 #endif
-         /* Hack.  We don't want the middle-end to warn that this
-            return is unreachable, so put the statement on the
-            special line 0.  */
-         {
-           location_t linezero = linemap_line_start (line_table, 0, 1);
-           SET_EXPR_LOCATION (stmt, linezero);
-         }
        }
 
       if (use_eh_spec_block (current_function_decl))

--
This patch is available for review at http://codereview.appspot.com/4835047

Reply via email to