From 47b1e19b64b76712bd3cf26c39b46d0937347f19 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sun, 30 Jul 2000 18:13:10 +0000 Subject: [PATCH] simplify-rtx.c (simplify_relational_operation): Verify that mode == VOIDmode implies both operands to be VOIDmode. * simplify-rtx.c (simplify_relational_operation): Verify that mode == VOIDmode implies both operands to be VOIDmode. (simplify_ternary_operation): Compute properly the mode of comparison. * combine.c (combine_simplify_rtx): Likewise. From-SVN: r35343 --- gcc/ChangeLog | 7 +++++++ gcc/combine.c | 9 +++++++-- gcc/simplify-rtx.c | 10 +++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a90b9fc426f..84159f72d89 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +Sun Jul 30 20:08:37 MET DST 2000 Jan Hubicka + + * simplify-rtx.c (simplify_relational_operation): Verify that mode == + VOIDmode implies both operands to be VOIDmode. + (simplify_ternary_operation): Compute properly the mode of comparison. + * combine.c (combine_simplify_rtx): Likewise. + 2000-07-25 Michael Hayes * basic-block.h (struct loops): New field rc_order. diff --git a/gcc/combine.c b/gcc/combine.c index 6010cb7905c..627f4a18758 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -3639,8 +3639,13 @@ combine_simplify_rtx (x, op0_mode, last, in_dest) temp = simplify_unary_operation (code, mode, XEXP (x, 0), op0_mode); break; case '<': - temp = simplify_relational_operation (code, op0_mode, - XEXP (x, 0), XEXP (x, 1)); + { + enum machine_mode cmp_mode = GET_MODE (XEXP (x, 0)); + if (cmp_mode == VOIDmode) + cmp_mode = GET_MODE (XEXP (x, 1)); + temp = simplify_relational_operation (code, cmp_mode, + XEXP (x, 0), XEXP (x, 1)); + } #ifdef FLOAT_STORE_FLAG_VALUE if (temp != 0 && GET_MODE_CLASS (mode) == MODE_FLOAT) { diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 2e79a8a1eb8..02af1d002df 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -1691,6 +1691,11 @@ simplify_relational_operation (code, mode, op0, op1) int equal, op0lt, op0ltu, op1lt, op1ltu; rtx tem; + if (mode == VOIDmode + && (GET_MODE (op0) != VOIDmode + || GET_MODE (op1) != VOIDmode)) + abort(); + /* If op0 is a compare, extract the comparison arguments from it. */ if (GET_CODE (op0) == COMPARE && op1 == const0_rtx) op1 = XEXP (op0, 1), op0 = XEXP (op0, 0); @@ -1980,8 +1985,11 @@ simplify_ternary_operation (code, mode, op0_mode, op0, op1, op2) return op2; else if (GET_RTX_CLASS (GET_CODE (op0)) == '<' && ! side_effects_p (op0)) { + enum machine_mode cmp_mode = (GET_MODE (XEXP (op0, 0)) == VOIDmode + ? GET_MODE (XEXP (op0, 1)) + : GET_MODE (XEXP (op0, 0))); rtx temp - = simplify_relational_operation (GET_CODE (op0), op0_mode, + = simplify_relational_operation (GET_CODE (op0), cmp_mode, XEXP (op0, 0), XEXP (op0, 1)); /* See if any simplifications were possible. */ -- 2.30.2