From 1cac878554696003a686e97187dac03147c1b3a0 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Wed, 24 Jan 2001 16:10:06 -0500 Subject: [PATCH] combine.c (combine_simplify_rtx): If the modes are all VOIDmode, check the original operand's mode also. * combine.c (combine_simplify_rtx): If the modes are all VOIDmode, check the original operand's mode also. * simplify-rtx.c (simplify_ternary_operation): Ditto. From-SVN: r39247 --- gcc/ChangeLog | 6 ++++++ gcc/combine.c | 6 +++++- gcc/simplify-rtx.c | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9f8b613c773..8dc545edda7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2001-01-24 DJ Delorie + + * combine.c (combine_simplify_rtx): If the modes are all VOIDmode, + check the original operand's mode also. + * simplify-rtx.c (simplify_ternary_operation): Ditto. + 2001-01-24 Joseph S. Myers * c-parse.in (cast_expr): Move compound literals from here ... diff --git a/gcc/combine.c b/gcc/combine.c index 6028f6ae8d1..8d7c9ccd65c 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -3654,7 +3654,11 @@ combine_simplify_rtx (x, op0_mode, last, in_dest) { enum machine_mode cmp_mode = GET_MODE (XEXP (x, 0)); if (cmp_mode == VOIDmode) - cmp_mode = GET_MODE (XEXP (x, 1)); + { + cmp_mode = GET_MODE (XEXP (x, 1)); + if (cmp_mode == VOIDmode) + cmp_mode = op0_mode; + } temp = simplify_relational_operation (code, cmp_mode, XEXP (x, 0), XEXP (x, 1)); } diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 9b0f79876dd..82bb8e40024 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -2057,6 +2057,8 @@ simplify_ternary_operation (code, mode, op0_mode, op0, op1, op2) enum machine_mode cmp_mode = (GET_MODE (XEXP (op0, 0)) == VOIDmode ? GET_MODE (XEXP (op0, 1)) : GET_MODE (XEXP (op0, 0))); + if (cmp_mode == VOIDmode) + cmp_mode = op0_mode; rtx temp = simplify_relational_operation (GET_CODE (op0), cmp_mode, XEXP (op0, 0), XEXP (op0, 1)); -- 2.30.2