diff options
author | Josef Zlomek <zlomj9am@artax.karlin.mff.cuni.cz> | 2003-01-09 12:47:35 +0100 |
---|---|---|
committer | Josef Zlomek <zlomek@gcc.gnu.org> | 2003-01-09 11:47:35 +0000 |
commit | 4a69cf7914102d0438d0d628007049b7ac95b46f (patch) | |
tree | d8d508dde209e151447df06687304535b5ecc081 /gcc/optabs.c | |
parent | 8cb1a818e9417874729357e6456ffd1f86b235e8 (diff) | |
download | gcc-4a69cf7914102d0438d0d628007049b7ac95b46f.tar.gz |
Makefile.in (optabs.o): Add dependency on basic-block.h.
* Makefile.in (optabs.o): Add dependency on basic-block.h.
* basic-block.h (control_flow_insn_p): Fuction was exported.
* cfgbuild.c (control_flow_insn_p): Fuction was made non-static.
* optabs.c (emit_libcall_block): Emit REG_LIBCALL and REG_RETVAL
notes only when the region is contained in a single basic block.
From-SVN: r61101
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index 3956299e4ea..d8c058e4330 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -1,6 +1,6 @@ /* Expand the basic unary and binary arithmetic operations, for GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001 Free Software Foundation, Inc. + 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GCC. @@ -42,6 +42,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "reload.h" #include "ggc.h" #include "real.h" +#include "basic-block.h" /* Each optab contains info on how this target machine can perform a particular operation @@ -3309,10 +3310,26 @@ emit_libcall_block (insns, target, result, equiv) /* Encapsulate the block so it gets manipulated as a unit. */ if (!flag_non_call_exceptions || !may_trap_p (equiv)) { - REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last, - REG_NOTES (first)); - REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first, - REG_NOTES (last)); + /* We can't attach the REG_LIBCALL and REG_RETVAL notes + when the encapsulated region would not be in one basic block, + i.e. when there is a control_flow_insn_p insn between FIRST and LAST. + */ + bool attach_libcall_retval_notes = true; + next = NEXT_INSN (last); + for (insn = first; insn != next; insn = NEXT_INSN (insn)) + if (control_flow_insn_p (insn)) + { + attach_libcall_retval_notes = false; + break; + } + + if (attach_libcall_retval_notes) + { + REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last, + REG_NOTES (first)); + REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first, + REG_NOTES (last)); + } } } |