Patchwork [2/8] Make more insns unique

login
register
mail settings
Submitter Alexander Monakov
Date Aug. 3, 2011, 3:30 p.m.
Message ID <1312385438-6273-3-git-send-email-amonakov@ispras.ru>
Download mbox | patch
Permalink /patch/108282/
State New
Headers show

Comments

Alexander Monakov - Aug. 3, 2011, 3:30 p.m.
From: Dmitry Melnik <dm@ispras.ru>

This patch prevents duplicating (as bookkeeping code) instructions that are
either volatile or recognized by cannot_copy_insn_p target hook (in addition
to already present restrictions).  This avoids generating incorrect assembler
with duplicate labels on ARM.

2011-08-04  Dmitry Melnik  <dm@ispras.ru>

	* sel-sched-ir.c (init_global_and_expr_for_insn): Forbid copying of
	recognized by cannot_copy_insn_p hook and volatile instructions.
Vladimir Makarov - Aug. 10, 2011, 7:46 p.m.
On 08/03/2011 11:30 AM, Alexander Monakov wrote:
> From: Dmitry Melnik<dm@ispras.ru>
>
> This patch prevents duplicating (as bookkeeping code) instructions that are
> either volatile or recognized by cannot_copy_insn_p target hook (in addition
> to already present restrictions).  This avoids generating incorrect assembler
> with duplicate labels on ARM.
>
> 2011-08-04  Dmitry Melnik<dm@ispras.ru>
>
> 	* sel-sched-ir.c (init_global_and_expr_for_insn): Forbid copying of
> 	recognized by cannot_copy_insn_p hook and volatile instructions.
OK, thanks.

Patch

diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index 5a287d0..8f5cd3f 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -2956,7 +2956,10 @@  init_global_and_expr_for_insn (insn_t insn)
           /* Exception handling insns are always unique.  */
           || (cfun->can_throw_non_call_exceptions && can_throw_internal (insn))
           /* TRAP_IF though have an INSN code is control_flow_insn_p ().  */
-          || control_flow_insn_p (insn))
+          || control_flow_insn_p (insn)
+          || volatile_insn_p (PATTERN (insn))
+          || (targetm.cannot_copy_insn_p
+              && targetm.cannot_copy_insn_p (insn)))
         force_unique_p = true;
       else
         force_unique_p = false;