diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-16 00:58:29 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-16 00:58:29 +0000 |
commit | 2f58af60e0ed0e52e1df5b768ab63f743af49c6f (patch) | |
tree | 35ca2b5dd89aac0a688da30150746834c7713a87 /gcc/cfglayout.c | |
parent | c846b328cc596ca300858351d5f79d2f167a4c23 (diff) | |
download | gcc-2f58af60e0ed0e52e1df5b768ab63f743af49c6f.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62955 138bc75d-0d04-0410-961f-82ee72b054a4
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 7ac9cb6a9d8..04ba2ec21e0 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; } |