summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-07 21:14:12 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-07 21:14:12 +0000
commit47e69468f19a280502935718ecdfba033426de2e (patch)
tree413d97c6eb6d9cb6750a5233f116bf870414d6b7 /gcc
parent2e18d182dfcb13eb14b09a9dd8fea8f7d7bffd2b (diff)
downloadgcc-47e69468f19a280502935718ecdfba033426de2e.tar.gz
Various fixes to allow us to again build if --enable-mapped-location:
* c-decl.c (finish_function): Use SET_EXPR_LOCATION instead of unavailable annotate_with_file_line, if USE_MAPPED_LOCATION. * tree-cfg.c (remove_bb): If USE_MAPPED_LOCATION, change type of local variable loc. Change logic appropriately. * tree-vect-transform.c (vect_finish_stmt_generation): Use EXPR_LOCATION rather than EXPR_LOCUS if USE_MAPPED_LOCATION. * c-parser.c (c_parser_for_statement): Initialize loc variable. * tree.h (DECL_IS_BUILTIN): Temporarily revert definition of DECL_IS_BUILTIN in the USE_MAPPED_LOCATION because of jc1 issues. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96045 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/c-decl.c4
-rw-r--r--gcc/c-parser.c2
-rw-r--r--gcc/tree-cfg.c15
-rw-r--r--gcc/tree-vect-transform.c2
-rw-r--r--gcc/tree.h6
6 files changed, 34 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 86bc853c1c0..dc3a09efc84 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+2005-03-07 Per Bothner <per@bothner.com>
+
+ Various fixes to allow us to again build if --enable-mapped-location:
+ * c-decl.c (finish_function): Use SET_EXPR_LOCATION instead of
+ unavailable annotate_with_file_line, if USE_MAPPED_LOCATION.
+ * tree-cfg.c (remove_bb): If USE_MAPPED_LOCATION, change type of
+ local variable loc. Change logic appropriately.
+ * tree-vect-transform.c (vect_finish_stmt_generation): Use
+ EXPR_LOCATION rather than EXPR_LOCUS if USE_MAPPED_LOCATION.
+ * c-parser.c (c_parser_for_statement): Initialize loc variable.
+ * tree.h (DECL_IS_BUILTIN): Temporarily revert definition of
+ DECL_IS_BUILTIN in the USE_MAPPED_LOCATION because of jc1 issues.
+
2005-03-07 Richard Sandiford <rsandifo@redhat.com>
PR rtl-optimization/19683
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 5cad16ee69f..42f8bad4254 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -6335,7 +6335,11 @@ finish_function (void)
/* 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
}
}
}
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index e08f436b46e..94874226514 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -3760,7 +3760,7 @@ static void
c_parser_for_statement (c_parser *parser)
{
tree block, cond, incr, save_break, save_cont, body;
- location_t loc;
+ location_t loc = UNKNOWN_LOCATION;
gcc_assert (c_parser_next_token_is_keyword (parser, RID_FOR));
c_parser_consume_token (parser);
block = c_begin_compound_stmt (flag_isoc99);
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index b87ce54c291..205b5c0e82e 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -2013,7 +2013,11 @@ static void
remove_bb (basic_block bb)
{
block_stmt_iterator i;
+#ifdef USE_MAPPED_LOCATION
+ source_location loc = UNKNOWN_LOCATION;
+#else
source_locus loc = 0;
+#endif
if (dump_file)
{
@@ -2052,15 +2056,15 @@ remove_bb (basic_block bb)
program that are indeed unreachable. */
if (TREE_CODE (stmt) != GOTO_EXPR && EXPR_HAS_LOCATION (stmt) && !loc)
{
- source_locus t;
-
#ifdef USE_MAPPED_LOCATION
- t = EXPR_LOCATION (stmt);
+ if (EXPR_HAS_LOCATION (stmt))
+ loc = EXPR_LOCATION (stmt);
#else
+ source_locus t;
t = EXPR_LOCUS (stmt);
-#endif
if (t && LOCATION_LINE (*t) > 0)
loc = t;
+#endif
}
}
@@ -2068,10 +2072,11 @@ remove_bb (basic_block bb)
block is unreachable. We walk statements backwards in the
loop above, so the last statement we process is the first statement
in the block. */
- if (warn_notreached && loc)
#ifdef USE_MAPPED_LOCATION
+ if (warn_notreached && loc != UNKNOWN_LOCATION)
warning ("%Hwill never be executed", &loc);
#else
+ if (warn_notreached && loc)
warning ("%Hwill never be executed", loc);
#endif
diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c
index 1935a738f71..891387a37a2 100644
--- a/gcc/tree-vect-transform.c
+++ b/gcc/tree-vect-transform.c
@@ -661,7 +661,7 @@ vect_finish_stmt_generation (tree stmt, tree vec_stmt, block_stmt_iterator *bsi)
#endif
#ifdef USE_MAPPED_LOCATION
- SET_EXPR_LOCATION (vec_stmt, EXPR_LOCUS (stmt));
+ SET_EXPR_LOCATION (vec_stmt, EXPR_LOCATION (stmt));
#else
SET_EXPR_LOCUS (vec_stmt, EXPR_LOCUS (stmt));
#endif
diff --git a/gcc/tree.h b/gcc/tree.h
index acbfc93eaa6..34394f13eeb 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1952,7 +1952,11 @@ struct tree_binfo GTY (())
#define DECL_SOURCE_LOCATION(NODE) (DECL_CHECK (NODE)->decl.locus)
#define DECL_SOURCE_FILE(NODE) LOCATION_FILE (DECL_SOURCE_LOCATION (NODE))
#define DECL_SOURCE_LINE(NODE) LOCATION_LINE (DECL_SOURCE_LOCATION (NODE))
-#ifdef USE_MAPPED_LOCATION
+#if 0
+/* Should be: #ifdef USE_MAPPED_LOCATION
+ However, there appears to be a jc1 bug that this would expose.
+ (It prevents bookstrapping because dwarf2out tries to emit a
+ non-found class.) FIXME. */
#define DECL_IS_BUILTIN(DECL) \
(DECL_SOURCE_LOCATION (DECL) <= BUILTINS_LOCATION)
#else