summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/optabs.c
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2003-02-10 05:41:50 +0000
committerkan <kan@FreeBSD.org>2003-02-10 05:41:50 +0000
commit793833d7a78bb624965885760593495e7079d705 (patch)
treef843ff90d71b900271088361ed96ff82eb2a365d /contrib/gcc/optabs.c
parent1b04fed26051ebc88f26a7bb93c63c270970e773 (diff)
downloadFreeBSD-src-793833d7a78bb624965885760593495e7079d705.zip
FreeBSD-src-793833d7a78bb624965885760593495e7079d705.tar.gz
Gcc 3.2.2-release.
Diffstat (limited to 'contrib/gcc/optabs.c')
-rw-r--r--contrib/gcc/optabs.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/contrib/gcc/optabs.c b/contrib/gcc/optabs.c
index 1cf2803..7e14ceb 100644
--- a/contrib/gcc/optabs.c
+++ b/contrib/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.
@@ -40,6 +40,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "reload.h"
#include "ggc.h"
#include "real.h"
+#include "hard-reg-set.h"
+#include "basic-block.h"
/* Each optab contains info on how this target machine
can perform a particular operation
@@ -754,9 +756,8 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
/* In case the insn wants input operands in modes different from
those of the actual operands, convert the operands. It would
seem that we don't need to convert CONST_INTs, but we do, so
- that they're properly zero-extended or sign-extended for their
- modes; shift operations are an exception, because the second
- operand needs not be extended to the mode of the result. */
+ that they're properly zero-extended, sign-extended or truncated
+ for their mode. */
if (GET_MODE (op0) != mode0
&& mode0 != VOIDmode)
@@ -771,9 +772,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
xop1 = convert_modes (mode1,
GET_MODE (op1) != VOIDmode
? GET_MODE (op1)
- : ! shift_op
- ? mode
- : mode1,
+ : mode,
xop1, unsignedp);
/* Now, if insn's predicates don't allow our operands, put them into
@@ -2981,10 +2980,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));
+ }
}
}
OpenPOWER on IntegriCloud