for gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
PR debug/47590
* config/bfin/bfin.c (output_file_start): Move flag_var_tracking
overriding...
(bfin_option_override): ... here.
* config/ia64/ia64.c (ia64_file_start): Likewise...
(ia64_option_override): ... ditto.
* config/spu/spu.c (asm_file_start): Likewise...
(spu_option_override): ... ditto.
* config/picochip/picochip.c (picochip_asm_file_start): Likewise...
(picochip_option_override): ... ditto. Split previous code into...
(picochip_override_options_after_change): ... this new function.
(TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): Use the latter.
===================================================================
@@ -343,13 +343,6 @@ output_file_start (void)
FILE *file = asm_out_file;
int i;
- /* Variable tracking should be run after all optimizations which change order
- of insns. It also needs a valid CFG. This can't be done in
- bfin_option_override, because flag_var_tracking is finalized after
- that. */
- bfin_flag_var_tracking = flag_var_tracking;
- flag_var_tracking = 0;
-
fprintf (file, ".file \"%s\";\n", input_filename);
for (i = 0; arg_regs[i] >= 0; i++)
@@ -2723,6 +2716,13 @@ bfin_option_override (void)
bfin_flag_schedule_insns2 = flag_schedule_insns_after_reload;
flag_schedule_insns_after_reload = 0;
+ /* Variable tracking should be run after all optimizations which change order
+ of insns. It also needs a valid CFG. This can't be done in
+ bfin_option_override, because flag_var_tracking is finalized after
+ that. */
+ bfin_flag_var_tracking = flag_var_tracking;
+ flag_var_tracking = 0;
+
init_machine_status = bfin_init_machine_status;
}
===================================================================
@@ -2391,13 +2391,6 @@ ia64_expand_atomic_op (enum rtx_code cod
static void
ia64_file_start (void)
{
- /* Variable tracking should be run after all optimizations which change order
- of insns. It also needs a valid CFG. This can't be done in
- ia64_option_override, because flag_var_tracking is finalized after
- that. */
- ia64_flag_var_tracking = flag_var_tracking;
- flag_var_tracking = 0;
-
default_file_start ();
emit_safe_across_calls ();
}
@@ -5722,6 +5715,13 @@ ia64_option_override (void)
if (TARGET_ABI_OPEN_VMS)
flag_no_common = 1;
+ /* Variable tracking should be run after all optimizations which change order
+ of insns. It also needs a valid CFG. This can't be done in
+ ia64_option_override, because flag_var_tracking is finalized after
+ that. */
+ ia64_flag_var_tracking = flag_var_tracking;
+ flag_var_tracking = 0;
+
ia64_override_options_after_change();
}
===================================================================
@@ -127,6 +127,7 @@ picochip_asm_named_section (const char *
static rtx picochip_static_chain (const_tree, bool);
static void picochip_option_override (void);
+static void picochip_override_options_after_change (void);
/* Lookup table mapping a register number to the earliest containing
class. Used by REGNO_REG_CLASS. */
@@ -335,7 +336,7 @@ static const struct default_options pico
#define TARGET_OPTION_OVERRIDE picochip_option_override
#undef TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE
-#define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE picochip_option_override
+#define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE picochip_override_options_after_change
#undef TARGET_OPTION_OPTIMIZATION_TABLE
#define TARGET_OPTION_OPTIMIZATION_TABLE picochip_option_optimization_table
@@ -356,14 +357,29 @@ picochip_return_in_memory(const_tree typ
return ((unsigned HOST_WIDE_INT) int_size_in_bytes (type) > 4);
}
-/* Allow some options to be overriden. In particular, the 2nd
- scheduling pass option is switched off, and a machine dependent
- reorganisation ensures that it is run later on, after the second
- jump optimisation. */
+/* Allow some options to be overriden. */
static void
picochip_option_override (void)
{
+ /* Variable tracking should be run after all optimizations which change order
+ of insns. It also needs a valid CFG. This can't be done in
+ picochip_option_override, because flag_var_tracking is finalized after
+ that. */
+ picochip_flag_var_tracking = flag_var_tracking;
+ flag_var_tracking = 0;
+
+ picochip_override_options_after_change ();
+}
+
+/* Allow some options to be overriden after a configuration change.
+ In particular, the 2nd scheduling pass option is switched off, and
+ a machine dependent reorganisation ensures that it is run later on,
+ after the second jump optimisation. */
+
+static void
+picochip_override_options_after_change (void)
+{
/* If we are optimizing for stack, dont let inliner to inline functions
that could potentially increase stack size.*/
if (flag_conserve_stack)
@@ -461,7 +477,6 @@ picochip_option_override (void)
error ("invalid mul type specified (%s) - expected mac, mul or none",
picochip_mul_type_string);
}
-
}
@@ -1813,13 +1828,6 @@ picochip_asm_file_start (void)
fprintf (asm_out_file, "// Has multiply: Yes (Mac unit)\n");
else
fprintf (asm_out_file, "// Has multiply: No\n");
-
- /* Variable tracking should be run after all optimizations which change order
- of insns. It also needs a valid CFG. This can't be done in
- picochip_option_override, because flag_var_tracking is finalized after
- that. */
- picochip_flag_var_tracking = flag_var_tracking;
- flag_var_tracking = 0;
}
/* Output the end of an ASM file. */
===================================================================
@@ -573,6 +573,19 @@ spu_option_override (void)
}
REAL_MODE_FORMAT (SFmode) = &spu_single_format;
+
+ /* Variable tracking should be run after all optimizations which
+ change order of insns. It also needs a valid CFG. Therefore,
+ *if* we make nontrivial changes in machine-dependent reorg,
+ run variable tracking after those. However, if we do not run
+ our machine-dependent reorg pass, we must still run the normal
+ variable tracking pass (or else we will ICE in final since
+ debug insns have not been removed). */
+ if (TARGET_BRANCH_HINTS && optimize)
+ {
+ spu_flag_var_tracking = flag_var_tracking;
+ flag_var_tracking = 0;
+ }
}
/* Handle an attribute requiring a FUNCTION_DECL; arguments as in
@@ -7052,19 +7065,6 @@ spu_libgcc_shift_count_mode (void)
static void
asm_file_start (void)
{
- /* Variable tracking should be run after all optimizations which
- change order of insns. It also needs a valid CFG. Therefore,
- *if* we make nontrivial changes in machine-dependent reorg,
- run variable tracking after those. However, if we do not run
- our machine-dependent reorg pass, we must still run the normal
- variable tracking pass (or else we will ICE in final since
- debug insns have not been removed). */
- if (TARGET_BRANCH_HINTS && optimize)
- {
- spu_flag_var_tracking = flag_var_tracking;
- flag_var_tracking = 0;
- }
-
default_file_start ();
}