From 0b077eace85e5b6b6bc311b0f6800e0324de6d59 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sat, 15 Feb 2003 16:58:29 -0800 Subject: Makefile.in (cfglayout.o): Depend on TARGET_H. * Makefile.in (cfglayout.o): Depend on TARGET_H. * cfglayout.c: Include target.h. (cfg_layout_can_duplicate_bb_p): Check targetm.cannot_copy_insn_p. * target-def.h (TARGET_CANNOT_COPY_INSN_P): New. * target.h (struct gcc_target): Add cannot_copy_insn_p. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): New. (TARGET_CANNOT_COPY_INSN_P): New. (override_options): Revert 2003-02-08 hack. From-SVN: r62955 --- gcc/cfglayout.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'gcc/cfglayout.c') diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c index 7ac9cb6..04ba2ec 100644 --- a/gcc/cfglayout.c +++ b/gcc/cfglayout.c @@ -32,6 +32,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "obstack.h" #include "cfglayout.h" #include "cfgloop.h" +#include "target.h" /* The contents of the current function definition are allocated in this obstack, and all are freed at the end of the function. */ @@ -748,6 +749,21 @@ cfg_layout_can_duplicate_bb_p (bb) && (GET_CODE (PATTERN (next)) == ADDR_VEC || GET_CODE (PATTERN (next)) == ADDR_DIFF_VEC)) return false; + + /* Do not duplicate blocks containing insns that can't be copied. */ + if (targetm.cannot_copy_insn_p) + { + rtx insn = bb->head; + while (1) + { + if (INSN_P (insn) && (*targetm.cannot_copy_insn_p) (insn)) + return false; + if (insn == bb->end) + break; + insn = NEXT_INSN (insn); + } + } + return true; } -- cgit v1.1