This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFA: profile.c USE_MAPPED_LOCATION support
- From: "Frank Ch. Eigler" <fche at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 15 Sep 2004 14:06:58 -0400
- Subject: RFA: profile.c USE_MAPPED_LOCATION support
Hi -
Some recent patch broke USE_MAPPED_LOCATION support in profile.c.
This patch fixes it I believe, as tested by bootstraps and the
bprob.exp testsuite bits.
+ 2004-09-15 Frank Ch. Eigler <fche@redhat.com>
+
+ * profile.c (branch_prob): Restore support for USE_MAPPED_LOCATION.
+
Index: profile.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/profile.c,v
retrieving revision 1.141
diff -u -p -c -r1.141 profile.c
*** profile.c 14 Sep 2004 12:21:41 -0000 1.141
--- profile.c 15 Sep 2004 18:02:11 -0000
*************** branch_prob (void)
*** 1001,1007 ****
else
{
gcov_position_t offset;
- location_t *curr_location = NULL;
FOR_EACH_BB (bb)
{
--- 1001,1006 ----
*************** branch_prob (void)
*** 1011,1041 ****
if (bb == ENTRY_BLOCK_PTR->next_bb)
{
! curr_location = &DECL_SOURCE_LOCATION (current_function_decl);
! output_location (curr_location->file, curr_location->line,
&offset, bb);
}
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
{
tree stmt = bsi_stmt (bsi);
! #ifdef USE_MAPPED_LOCATION
! curr_location = EXPR_LOCATION (stmt);
! #else
! curr_location = EXPR_LOCUS (stmt);
! #endif
! if (curr_location)
! output_location (curr_location->file, curr_location->line,
&offset, bb);
}
/* Notice GOTO expressions we eliminated while constructing the
CFG. */
if (bb->succ && !bb->succ->succ_next && bb->succ->goto_locus)
! {
! curr_location = bb->succ->goto_locus;
! output_location (curr_location->file, curr_location->line, &offset, bb);
! }
if (offset)
{
--- 1010,1045 ----
if (bb == ENTRY_BLOCK_PTR->next_bb)
{
! output_location (EXPR_FILENAME (current_function_decl),
! EXPR_LINENO (current_function_decl),
&offset, bb);
}
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
{
tree stmt = bsi_stmt (bsi);
! if (EXPR_HAS_LOCATION (stmt))
! output_location (EXPR_FILENAME (stmt),
! EXPR_LINENO (stmt),
&offset, bb);
}
/* Notice GOTO expressions we eliminated while constructing the
CFG. */
if (bb->succ && !bb->succ->succ_next && bb->succ->goto_locus)
! {
! /* ??? source_locus type is marked deprecated in input.h. */
! source_locus curr_location = bb->succ->goto_locus;
! /* ??? The FILE/LINE API is inconsistent for these cases. */
! #ifdef USE_MAPPED_LOCATION
! output_location (LOCATION_FILE (curr_location),
! LOCATION_LINE (curr_location),
! &offset, bb);
! #else
! output_location (curr_location->file, curr_location->line,
! &offset, bb);
! #endif
! }
if (offset)
{