aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Charette <gchare@google.com>2011-08-05 21:28:11 +0000
committerGabriel Charette <gchare@gcc.gnu.org>2011-08-05 21:28:11 +0000
commit7cfea2ef26a3aab320c90d71c35c69a8c78404d7 (patch)
treef664e2ae1f8f628fb85690ed1dd5b513ef258fac
parent9911e25a2745e1d523257ace9207d4d85146b8ed (diff)
downloadgcc-7cfea2ef26a3aab320c90d71c35c69a8c78404d7.zip
gcc-7cfea2ef26a3aab320c90d71c35c69a8c78404d7.tar.gz
gcc-7cfea2ef26a3aab320c90d71c35c69a8c78404d7.tar.bz2
This hack to attach a line 0 source_location to the return statement of main...
This hack to attach a line 0 source_location to the return statement of main, after parsing is over, was creating a bug in the line_table, creating an extra entry, which was creating problems now that we are trying to serialize the line_table in pph. * decl.c (finish_function): Remove unecessary line 0 hack. From-SVN: r177485
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/decl.c13
2 files changed, 6 insertions, 11 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ea66fa1d..9fe6450 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2011-08-05 Gabriel Charette <gchare@google.com>
+
+ * decl.c (finish_function): Remove unecessary line 0 hack.
+
2011-08-05 Jason Merrill <jason@redhat.com>
PR c++/47453
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index f0d1a1a..265ca98 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -13227,22 +13227,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))