diff options
author | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-05 17:45:32 +0000 |
---|---|---|
committer | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-05 17:45:32 +0000 |
commit | e60278e775f729018cbf4026c748617a48ddbc6b (patch) | |
tree | ec7814b11b96af884ce7c0f68b751a451bb0fa0f /gcc/c-decl.c | |
parent | 1cb8ea17a4f5f39fc75b2200ca4108760701ebdd (diff) | |
download | gcc-e60278e775f729018cbf4026c748617a48ddbc6b.tar.gz |
* c-decl.c (finish_function): If USE_MAPPED_LOCATION set the location
of the artification 'return 0' in main() to BUILTINS_LOCATION.
* tree-cfg.c (remove_bb): Check that location isn't BUILTINS_LOCATION
before warning.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97641 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 9d82b9a5b20..100f5a7ad46 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -6272,12 +6272,18 @@ finish_function (void) if (flag_isoc99) { tree stmt = c_finish_return (integer_zero_node); +#ifdef USE_MAPPED_LOCATION + /* Hack. We don't want the middle-end to warn that this return + is unreachable, so we mark its location as special. Using + UNKNOWN_LOCATION has the problem that it gets clobbered in + annotate_one_with_locus. A cleaner solution might be to + ensure ! should_carry_locus_p (stmt), but that needs a flag. + */ + SET_EXPR_LOCATION (stmt, BUILTINS_LOCATION); +#else /* Hack. We don't want the middle-end to warn that this return is unreachable, so put the statement on the special line 0. */ -#ifdef USE_MAPPED_LOCATION - SET_EXPR_LOCATION (stmt, UNKNOWN_LOCATION); -#else annotate_with_file_line (stmt, input_filename, 0); #endif } |