summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorzlomek <zlomek@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-09 11:47:35 +0000
committerzlomek <zlomek@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-09 11:47:35 +0000
commitd16f9b9d264a60dc8f6ddcb96438adc2cc68bf9d (patch)
treed8d508dde209e151447df06687304535b5ecc081 /gcc
parent6604fdab52d58ddf87c5b8109a3d423f337b39dc (diff)
downloadgcc-d16f9b9d264a60dc8f6ddcb96438adc2cc68bf9d.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61101 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/Makefile.in4
-rw-r--r--gcc/basic-block.h3
-rw-r--r--gcc/cfgbuild.c5
-rw-r--r--gcc/optabs.c27
5 files changed, 36 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 96ca06396ff..c0689759663 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2003-01-09 Josef Zlomek <zlomj9am@artax.karlin.mff.cuni.cz>
+
+ * 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.
+
2003-01-09 Eric Botcazou <ebotcazou@libertysurf.fr>
PR inline-asm/8832
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 01b3f4b6edc..5ffdce2a9fb 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1,6 +1,6 @@
# Makefile for GNU C compiler.
# Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
-# 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+# 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
#This file is part of GCC.
@@ -1463,7 +1463,7 @@ explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_
toplev.h function.h ggc.h $(TM_P_H) gt-explow.h
optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
flags.h insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(RECOG_H) reload.h \
- toplev.h $(GGC_H) real.h $(TM_P_H) except.h gt-optabs.h
+ toplev.h $(GGC_H) real.h $(TM_P_H) except.h gt-optabs.h $(BASIC_BLOCK_H)
dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
flags.h $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) function.h langhooks.h \
insn-config.h reload.h gstab.h xcoffout.h output.h dbxout.h toplev.h
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index 47b5063124a..78b7ac6b3f4 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -1,5 +1,5 @@
/* Define control and data flow tables, and regsets.
- Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
This file is part of GCC.
@@ -806,6 +806,7 @@ extern void fixup_abnormal_edges PARAMS ((void));
extern bool can_hoist_insn_p PARAMS ((rtx, rtx, regset));
extern rtx hoist_insn_after PARAMS ((rtx, rtx, rtx, rtx));
extern rtx hoist_insn_to_edge PARAMS ((rtx, edge, rtx, rtx));
+extern bool control_flow_insn_p PARAMS ((rtx));
/* In dominance.c */
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index 43acb9076ec..7bc33f248d0 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -1,6 +1,6 @@
/* Control flow graph building code for GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -59,7 +59,6 @@ static void make_eh_edge PARAMS ((sbitmap *, basic_block, rtx));
static void find_bb_boundaries PARAMS ((basic_block));
static void compute_outgoing_frequencies PARAMS ((basic_block));
static bool inside_basic_block_p PARAMS ((rtx));
-static bool control_flow_insn_p PARAMS ((rtx));
/* Return true if insn is something that should be contained inside basic
block. */
@@ -97,7 +96,7 @@ inside_basic_block_p (insn)
/* Return true if INSN may cause control flow transfer, so it should be last in
the basic block. */
-static bool
+bool
control_flow_insn_p (insn)
rtx insn;
{
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));
+ }
}
}