This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Redefine POINTERS_EXTEND_UNSIGNED for MIPS


In:

    http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01517.html

I removed the definition of POINTERS_EXTEND_UNSIGNED to fix some
MIPS fallout from an expr.c change.  Eric originally added the
definition during the 3.4 rewrite, during an experiment to make
Pmode == DImode for n32 and o64.  As I said in the message above,
it should no longer be needed, because POINTERS_EXTEND_UNSIGNED
is only documented as applying to ptr_mode->Pmode extensions,
and we have no such extensions any more.

What I'd failed to realise was that POINTERS_EXTEND_UNSIGNED had
in the meantime become used for extensions to word_mode too,
via __builtin_extend_pointer.  Removing it therefore reintroduced
PR5625 (tsk), as mipsisa64-elfoabi results show.  RTH fixed the
expr.c problem here:

    http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02907.html

so the reason for removing the definition no longer applies.

Regression-tested on mipsisa64-elfoabi, where it fixes quite
a few C++ failures.  Applied to trunk.  I'll send a follow-up
patch to tweak the documentation.

Richard


gcc/
	* config/mips/mips.h (POINTERS_EXTEND_UNSIGNED): Define.

Index: gcc/config/mips/mips.h
===================================================================
--- gcc/config/mips/mips.h	2007-09-15 18:17:22.000000000 +0100
+++ gcc/config/mips/mips.h	2007-09-15 18:20:23.000000000 +0100
@@ -1350,6 +1350,10 @@ #define PROMOTE_MODE(MODE, UNSIGNEDP, TY
       (MODE) = Pmode;                           \
     }
 
+/* Pmode is always the same as ptr_mode, but not always the same as word_mode.
+   Extensions of pointers to word_mode must be signed.  */
+#define POINTERS_EXTEND_UNSIGNED false
+
 /* Define if loading short immediate values into registers sign extends.  */
 #define SHORT_IMMEDIATES_SIGN_EXTEND
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]