diff options
author | Richard Henderson <rth@redhat.com> | 2003-02-15 16:58:29 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2003-02-15 16:58:29 -0800 |
commit | 0b077eace85e5b6b6bc311b0f6800e0324de6d59 (patch) | |
tree | 35ca2b5dd89aac0a688da30150746834c7713a87 /gcc/cfglayout.c | |
parent | a7075aea5850feee4de2a5fec2c118aac7365790 (diff) | |
download | gcc-0b077eace85e5b6b6bc311b0f6800e0324de6d59.zip gcc-0b077eace85e5b6b6bc311b0f6800e0324de6d59.tar.gz gcc-0b077eace85e5b6b6bc311b0f6800e0324de6d59.tar.bz2 |
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
Diffstat (limited to 'gcc/cfglayout.c')
-rw-r--r-- | gcc/cfglayout.c | 16 |
1 files changed, 16 insertions, 0 deletions
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; } |