From 7cfea2ef26a3aab320c90d71c35c69a8c78404d7 Mon Sep 17 00:00:00 2001 From: Gabriel Charette Date: Fri, 5 Aug 2011 21:28:11 +0000 Subject: [PATCH] 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 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/decl.c | 13 ++----------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ea66fa1dbce..9fe645003ea 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2011-08-05 Gabriel Charette + + * decl.c (finish_function): Remove unecessary line 0 hack. + 2011-08-05 Jason Merrill PR c++/47453 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index f0d1a1a3262..265ca982680 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)) -- 2.30.2