This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch RFA] Handle blockage insn in mode-switching.c/create_pre_exit
- From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 08 Jul 2007 21:22:11 +0900 (JST)
- Subject: [patch RFA] Handle blockage insn in mode-switching.c/create_pre_exit
Hi,
The mainline fails to build for sh-elf and sh4-unknown-linux-gnu
during the compilation of libgcc2.c:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32664
It started to fail after the patch
r126403 | uros | 2007-07-06 17:53:15 +0900 (Fri, 06 Jul 2007) | 13 lines
PR rtl_optimization/32450
* function.c (thread_prologue_and_epilogue_insns): Emit blockage insn
to ensure that instructions are not moved into the prologue when
profiling is on. Remove unused prologue_end variable.
(expand_function_end): Emit blockage insn instead of ASM_INPUT rtx
as a scheduling barrier.
The function mode-switching.c:create_pre_exit skipped the above
scheduling barrier when scanning the insns:
http://gcc.gnu.org/ml/gcc-patches/2007-03/msg00457.html
Now ASM_INPUT rtx is replaced with a real blockage insn, we
should skip this blockage insn. The attached patch fixes
the build failure for sh-elf and sh4-unknown-linux-gnu.
It's tested with bootstrap and regtested with the top level
"make -k check" on i686-pc-linux-gnu with no new failures.
Regards,
kaz
--
:ADDPATCH rtl-optimization:
2007-07-08 Kaz Kojima <kkojima@gcc.gnu.org>
PR target/32664
* mode-switching.c: Skip blockage insn instead of ASM_INPUT rtx.
--- ORIG/trunk/gcc/mode-switching.c 2007-06-12 09:34:43.000000000 +0900
+++ LOCAL/trunk/gcc/mode-switching.c 2007-07-07 18:31:46.000000000 +0900
@@ -209,6 +209,7 @@ create_pre_exit (int n_entities, int *en
edge eg;
edge_iterator ei;
basic_block pre_exit;
+ rtx blockage_insn = gen_blockage ();
/* The only non-call predecessor at this stage is a block with a
fallthrough edge; there can be at most one, but there could be
@@ -255,8 +256,7 @@ create_pre_exit (int n_entities, int *en
last_insn = return_copy;
continue;
}
- if (GET_CODE (PATTERN (return_copy)) == ASM_INPUT
- && strcmp (XSTR (PATTERN (return_copy), 0), "") == 0)
+ if (rtx_equal_p (PATTERN (return_copy), blockage_insn))
{
last_insn = return_copy;
continue;