This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Puzzled by a recent patch
- To: rth at redhat dot com
- Subject: Puzzled by a recent patch
- From: Bernd Schmidt <bernds at redhat dot co dot uk>
- Date: Wed, 6 Sep 2000 16:46:13 +0100 (BST)
- cc: gcc at gcc dot gnu dot org
Richard,
I'm puzzled by the change below which you made in June. More specifically,
I don't quite follow what you are trying to do by calling
smallest_mode_for_size.
This is causing a compiler abort for some vector code. The abort is due to
another bug (we don't list MODE_COMPLEX_INT or MODE_COMPLEX_FLOAT in the
class_narrowest_mode arry), but even if we add that, I don't see how this
code could possibly be correct. In the case where I'm running into an abort,
MODE is V64SImode (256 bytes). However, with this change, we try to find a 4
byte mode in class MODE_VECTOR_INT, which seems really odd.
Bernd
Index: reload1.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/reload1.c,v
retrieving revision 1.216
retrieving revision 1.217
diff -u -p -r1.216 -r1.217
--- reload1.c 2000/06/06 02:40:14 1.216
+++ reload1.c 2000/06/13 21:47:39 1.217
@@ -5305,20 +5305,25 @@ choose_reload_regs (chain)
{
enum reg_class class = rld[r].class, last_class;
rtx last_reg = reg_last_reload_reg[regno];
+ enum machine_mode need_mode;
i = REGNO (last_reg) + word;
last_class = REGNO_REG_CLASS (i);
+
+ need_mode = smallest_mode_for_size ((word+1) * UNITS_PER_WORD,
+ GET_MODE_CLASS (mode));
+
if (
-#ifdef CLASS_CANNOT_CHANGE_SIZE
+#ifdef CLASS_CANNOT_CHANGE_MODE
(TEST_HARD_REG_BIT
- (reg_class_contents[CLASS_CANNOT_CHANGE_SIZE], i)
- ? (GET_MODE_SIZE (GET_MODE (last_reg))
- == GET_MODE_SIZE (mode) + word * UNITS_PER_WORD)
+ (reg_class_contents[(int) CLASS_CANNOT_CHANGE_MODE], i)
+ ? ! CLASS_CANNOT_CHANGE_MODE_P (GET_MODE (last_reg),
+ need_mode)
: (GET_MODE_SIZE (GET_MODE (last_reg))
- >= GET_MODE_SIZE (mode) + word * UNITS_PER_WORD))
+ >= GET_MODE_SIZE (need_mode)))
#else
(GET_MODE_SIZE (GET_MODE (last_reg))
- >= GET_MODE_SIZE (mode) + word * UNITS_PER_WORD)
+ >= GET_MODE_SIZE (need_mode))
#endif
&& reg_reloaded_contents[i] == regno
&& TEST_HARD_REG_BIT (reg_reloaded_valid, i)