aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-07-18 17:28:05 -0700
committerDavid S. Miller <davem@gcc.gnu.org>2003-07-18 17:28:05 -0700
commitd893ccde91cbbc366e42f31605b303f0a67d8d2b (patch)
treea81053762e9b4e7c6fb7d1ab13e1eb46a8703d7e /gcc
parent3b1eae7b3b4eae1a82c854fb5b5483f0bde4f7ac (diff)
downloadgcc-d893ccde91cbbc366e42f31605b303f0a67d8d2b.zip
gcc-d893ccde91cbbc366e42f31605b303f0a67d8d2b.tar.gz
gcc-d893ccde91cbbc366e42f31605b303f0a67d8d2b.tar.bz2
optabs.c (prepare_operand): Fail gracefully instead of abort if the predicate doesn't satisfy.
2003-07-18 Richard Henderson <rth@redhat.com> * optabs.c (prepare_operand): Fail gracefully instead of abort if the predicate doesn't satisfy. (gen_cond_trap): Allow prepare_operand to fail. From-SVN: r69578
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/optabs.c12
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8bd54a9..9f365c7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2003-07-18 Richard Henderson <rth@redhat.com>
+
+ * optabs.c (prepare_operand): Fail gracefully instead of abort
+ if the predicate doesn't satisfy.
+ (gen_cond_trap): Allow prepare_operand to fail.
+
2003-07-19 Gabriel Dos Reis <gdr@integrable-solutions.net>
* c-common.c: Don't undefine GCC_DIAG_STYLE.
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 3085b85..f8ae543 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -3725,7 +3725,12 @@ prepare_operand (int icode, rtx x, int opnum, enum machine_mode mode,
if (! (*insn_data[icode].operand[opnum].predicate)
(x, insn_data[icode].operand[opnum].mode))
- x = copy_to_mode_reg (insn_data[icode].operand[opnum].mode, x);
+ {
+ if (no_new_pseudos)
+ return NULL_RTX;
+ x = copy_to_mode_reg (insn_data[icode].operand[opnum].mode, x);
+ }
+
return x;
}
@@ -5736,6 +5741,11 @@ gen_cond_trap (enum rtx_code code ATTRIBUTE_UNUSED, rtx op1,
start_sequence ();
op1 = prepare_operand (icode, op1, 0, mode, mode, 0);
op2 = prepare_operand (icode, op2, 1, mode, mode, 0);
+ if (!op1 || !op2)
+ {
+ end_sequence ();
+ return 0;
+ }
emit_insn (GEN_FCN (icode) (op1, op2));
PUT_CODE (trap_rtx, code);