From 2d4f57f838cba245932d687efc3c690fe5a82644 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Wed, 19 May 1993 13:13:32 -0400 Subject: [PATCH] (operand_subword): Reject cases when BITS_PER_WORD is greater than HOST_BITS_PER_INT unless OP is const0_rtx. From-SVN: r4502 --- gcc/emit-rtl.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index f73a61c89ba..cec8f0ff8bf 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -1,5 +1,5 @@ /* Emit RTL for the GNU C-Compiler expander. - Copyright (C) 1987, 1988, 1992 Free Software Foundation, Inc. + Copyright (C) 1987, 1988, 1992, 1993 Free Software Foundation, Inc. This file is part of GNU CC. @@ -995,15 +995,16 @@ operand_subword (op, i, validate_address, mode) Convert to proper endianness now since these cases need it. At this point, i == 0 means the low-order word. - Note that it must be that BITS_PER_WORD <= HOST_BITS_PER_INT. - This is because if it were greater, it could only have been two - times greater since we do not support making wider constants. In - that case, it MODE would have already been the proper size and - it would have been handled above. This means we do not have to - worry about the case where we would be returning a CONST_DOUBLE. */ + We do not want to handle the case when BITS_PER_WORD <= HOST_BITS_PER_INT + in general. However, if OP is (const_int 0), we can just return + it for any word. */ + + if (op == const0_rtx) + return op; if (GET_MODE_CLASS (mode) != MODE_INT - || (GET_CODE (op) != CONST_INT && GET_CODE (op) != CONST_DOUBLE)) + || (GET_CODE (op) != CONST_INT && GET_CODE (op) != CONST_DOUBLE) + || BITS_PER_WORD > HOST_BITS_PER_INT) return 0; if (WORDS_BIG_ENDIAN) -- 2.30.2