This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[commit, spu] Fix ICEs with -fvar-tracking -O0
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 4 Jan 2011 00:18:38 +0100 (CET)
- Subject: [commit, spu] Fix ICEs with -fvar-tracking -O0
Hello,
when using -fvar-tracking with optimization disabled, the compiler
crashed on SPU. This is because the back-end disables the call to
the regular var-tracking pass (before machine-dependent reorg), and
manually calls it at the end of machine-dependent reorg instead.
However, if optimization is off, machine-dependent reorg is short-
circuited, and actually does *not* call var-tracking. This means
the pass is *never* called, and thus we get DEBUG_INSNs remaining
in the instruction stream, which crashes in final.
Fixed by just letting the regular var-tracking pass be invoked in
those cases where we don't call it in machine-dependent reorg.
Tested on spu-elf.
Committed to mainline.
Bye,
Ulrich
ChangeLog:
* config/spu/spu.c (asm_file_start): Only reset flag_var_tracking
if branch-hint optimization will be performed.
Index: gcc/config/spu/spu.c
===================================================================
*** gcc/config/spu/spu.c (revision 168294)
--- gcc/config/spu/spu.c (working copy)
*************** static void
*** 7014,7022 ****
asm_file_start (void)
{
/* Variable tracking should be run after all optimizations which
! change order of insns. It also needs a valid CFG. */
! spu_flag_var_tracking = flag_var_tracking;
! flag_var_tracking = 0;
default_file_start ();
}
--- 7014,7030 ----
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 ();
}
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com