From 4a69cf7914102d0438d0d628007049b7ac95b46f Mon Sep 17 00:00:00 2001 From: Josef Zlomek Date: Thu, 9 Jan 2003 12:47:35 +0100 Subject: 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 --- gcc/optabs.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'gcc/optabs.c') 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)); + } } } -- cgit v1.2.1