diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2014-06-06 07:32:25 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2014-06-06 07:32:25 +0000 |
commit | ffa4602f4d54c80b978b3f6c8c376fbf75b72277 (patch) | |
tree | fc8f51ea70b82f892ac226dafb7defa86a52c93b /gcc | |
parent | 28a4a292fc1717544e68ed2f6107b3f0cbe10aed (diff) | |
download | gcc-ffa4602f4d54c80b978b3f6c8c376fbf75b72277.zip gcc-ffa4602f4d54c80b978b3f6c8c376fbf75b72277.tar.gz gcc-ffa4602f4d54c80b978b3f6c8c376fbf75b72277.tar.bz2 |
rtl.h (insn_location): Declare.
* rtl.h (insn_location): Declare.
* cfgcleanup.c (try_forward_edges): Compare the locus of locations
with UNKNOWN_LOCATION.
* emit-rtl.c (insn_location): New function.
* final.c (notice_source_line): Check that the instruction has a
location before retrieving it and use insn_location.
* modulo-sched.c (loop_single_full_bb_p): Likewise.
* print-rtl.c (print_rtx): Likewise.
From-SVN: r211305
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/cfgcleanup.c | 23 | ||||
-rw-r--r-- | gcc/emit-rtl.c | 7 | ||||
-rw-r--r-- | gcc/final.c | 10 | ||||
-rw-r--r-- | gcc/modulo-sched.c | 7 | ||||
-rw-r--r-- | gcc/print-rtl.c | 8 | ||||
-rw-r--r-- | gcc/rtl.h | 1 |
7 files changed, 46 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e71d68f..77ac416 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2014-06-06 Eric Botcazou <ebotcazou@adacore.com> + + * rtl.h (insn_location): Declare. + * cfgcleanup.c (try_forward_edges): Compare the locus of locations + with UNKNOWN_LOCATION. + * emit-rtl.c (insn_location): New function. + * final.c (notice_source_line): Check that the instruction has a + location before retrieving it and use insn_location. + * modulo-sched.c (loop_single_full_bb_p): Likewise. + * print-rtl.c (print_rtx): Likewise. + 2014-06-06 Richard Biener <rguenther@suse.de> * passes.def: Move 2nd VRP pass before phi-only-cprop. diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 7c24a6d..26dfbe6 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -482,31 +482,30 @@ try_forward_edges (int mode, basic_block b) location_t new_locus = single_succ_edge (target)->goto_locus; location_t locus = goto_locus; - if (new_locus != UNKNOWN_LOCATION - && locus != UNKNOWN_LOCATION + if (LOCATION_LOCUS (new_locus) != UNKNOWN_LOCATION + && LOCATION_LOCUS (locus) != UNKNOWN_LOCATION && new_locus != locus) new_target = NULL; else { - rtx last; - - if (new_locus != UNKNOWN_LOCATION) + if (LOCATION_LOCUS (new_locus) != UNKNOWN_LOCATION) locus = new_locus; - last = BB_END (target); + rtx last = BB_END (target); if (DEBUG_INSN_P (last)) last = prev_nondebug_insn (last); + if (last && INSN_P (last)) + new_locus = INSN_LOCATION (last); + else + new_locus = UNKNOWN_LOCATION; - new_locus = last && INSN_P (last) - ? INSN_LOCATION (last) : 0; - - if (new_locus != UNKNOWN_LOCATION - && locus != UNKNOWN_LOCATION + if (LOCATION_LOCUS (new_locus) != UNKNOWN_LOCATION + && LOCATION_LOCUS (locus) != UNKNOWN_LOCATION && new_locus != locus) new_target = NULL; else { - if (new_locus != UNKNOWN_LOCATION) + if (LOCATION_LOCUS (new_locus) != UNKNOWN_LOCATION) locus = new_locus; goto_locus = locus; diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index fe1da9e..ceb072a 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -6174,6 +6174,13 @@ insn_file (const_rtx insn) return LOCATION_FILE (INSN_LOCATION (insn)); } +/* Return expanded location of the statement that produced this insn. */ +expanded_location +insn_location (const_rtx insn) +{ + return expand_location (INSN_LOCATION (insn)); +} + /* Return true if memory model MODEL requires a pre-operation (release-style) barrier or a post-operation (acquire-style) barrier. While not universal, this function matches behavior of several targets. */ diff --git a/gcc/final.c b/gcc/final.c index c32e177..4f08073 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -3019,10 +3019,16 @@ notice_source_line (rtx insn, bool *is_stmt) filename = override_filename; linenum = override_linenum; } + else if (INSN_HAS_LOCATION (insn)) + { + expanded_location xloc = insn_location (insn); + filename = xloc.file; + linenum = xloc.line; + } else { - filename = insn_file (insn); - linenum = insn_line (insn); + filename = NULL; + linenum = 0; } if (filename == NULL) diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c index 16caa8f..6db1a21 100644 --- a/gcc/modulo-sched.c +++ b/gcc/modulo-sched.c @@ -1244,11 +1244,10 @@ loop_single_full_bb_p (struct loop *loop) static void dump_insn_location (rtx insn) { - if (dump_file && INSN_LOCATION (insn)) + if (dump_file && INSN_HAS_LOCATION (insn)) { - const char *file = insn_file (insn); - if (file) - fprintf (dump_file, " %s:%i", file, insn_line (insn)); + expanded_location xloc = insn_location (insn); + fprintf (dump_file, " %s:%i", xloc.file, xloc.line); } } diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index 2f9f547..5dc8e94 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -395,9 +395,11 @@ print_rtx (const_rtx in_rtx) /* Pretty-print insn locations. Ignore scoping as it is mostly redundant with line number information and do not print anything when there is no location information available. */ - if (INSN_LOCATION (in_rtx) && insn_file (in_rtx)) - fprintf (outfile, " %s:%i", insn_file (in_rtx), - insn_line (in_rtx)); + if (INSN_HAS_LOCATION (in_rtx)) + { + expanded_location xloc = insn_location (in_rtx); + fprintf (outfile, " %s:%i", xloc.file, xloc.line); + } #endif } else if (i == 6 && GET_CODE (in_rtx) == ASM_OPERANDS) @@ -2130,6 +2130,7 @@ extern rtx prev_cc0_setter (rtx); extern int insn_line (const_rtx); extern const char * insn_file (const_rtx); extern tree insn_scope (const_rtx); +extern expanded_location insn_location (const_rtx); extern location_t prologue_location, epilogue_location; /* In jump.c */ |