+2018-02-11 Alexandre Oliva <aoliva@redhat.com>
+
+ * final.c (final_scan_insn_1): Renamed from...
+ (final_scan_insn): ... this. New wrapper, to recover
+ seen from the outermost call in recursive ones.
+ * config/sparc/sparc.c (output_return): Drop seen from call.
+ (output_sibcall): Likewise.
+ * config/visium/visium.c (output_branch): Likewise.
+
2018-02-10 John David Anglin <danglin@gcc.gnu.org>
* config/pa/pa.c (hppa_profile_hook): Mark SYMBOL_REF for _mcount as
{
rtx_insn *delay;
rtx pat;
- int seen;
delay = NEXT_INSN (insn);
gcc_assert (delay);
Make sure to output its source location first. */
PATTERN (delay) = gen_blockage ();
INSN_CODE (delay) = -1;
- final_scan_insn (delay, asm_out_file, optimize, 0, &seen);
+ final_scan_insn (delay, asm_out_file, optimize, 0, NULL);
INSN_LOCATION (delay) = UNKNOWN_LOCATION;
output_restore (pat);
{
rtx_insn *delay;
rtx pat;
- int seen;
delay = NEXT_INSN (insn);
gcc_assert (delay);
Make sure to output its source location first. */
PATTERN (delay) = gen_blockage ();
INSN_CODE (delay) = -1;
- final_scan_insn (delay, asm_out_file, optimize, 0, &seen);
+ final_scan_insn (delay, asm_out_file, optimize, 0, NULL);
INSN_LOCATION (delay) = UNKNOWN_LOCATION;
output_restore (pat);
if (final_sequence)
{
rtx_insn *delay = NEXT_INSN (insn);
- int seen;
gcc_assert (delay);
- final_scan_insn (delay, asm_out_file, optimize, 0, &seen);
+ final_scan_insn (delay, asm_out_file, optimize, 0, NULL);
PATTERN (delay) = gen_blockage ();
INSN_CODE (delay) = -1;
}
debug information. We force the emission of a line note after
both NOTE_INSN_PROLOGUE_END and NOTE_INSN_FUNCTION_BEG. */
-rtx_insn *
-final_scan_insn (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
- int nopeepholes ATTRIBUTE_UNUSED, int *seen)
+static rtx_insn *
+final_scan_insn_1 (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
+ int nopeepholes ATTRIBUTE_UNUSED, int *seen)
{
#if HAVE_cc0
rtx set;
}
return NEXT_INSN (insn);
}
+
+/* This is a wrapper around final_scan_insn_1 that allows ports to
+ call it recursively without a known value for SEEN. The value is
+ saved at the outermost call, and recovered for recursive calls.
+ Recursive calls MUST pass NULL, or the same pointer if they can
+ otherwise get to it. */
+
+rtx_insn *
+final_scan_insn (rtx_insn *insn, FILE *file, int optimize_p,
+ int nopeepholes, int *seen)
+{
+ static int *enclosing_seen;
+ static int recursion_counter;
+
+ gcc_assert (seen || recursion_counter);
+ gcc_assert (!recursion_counter || !seen || seen == enclosing_seen);
+
+ if (!recursion_counter++)
+ enclosing_seen = seen;
+ else if (!seen)
+ seen = enclosing_seen;
+
+ rtx_insn *ret = final_scan_insn_1 (insn, file, optimize_p, nopeepholes, seen);
+
+ if (!--recursion_counter)
+ enclosing_seen = NULL;
+
+ return ret;
+}
+
\f
/* Return whether a source line note needs to be emitted before INSN.
Sets IS_STMT to TRUE if the line should be marked as a possible