RFA: Tweak documentation of POINTERS_EXTEND_UNSIGNED
Richard Sandiford
rsandifo@nildram.co.uk
Sun Sep 16 13:28:00 GMT 2007
Richard Sandiford <rsandifo@nildram.co.uk> writes:
> 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.
Here's the documentation patch. It will probably need to be tweaked
slightly once Andreas's elimination of attribute((word)) is complete,
but I think it's accurate as things stand.
Tested with "make info", "make pdf" and "make html". OK to install?
Richard
gcc/
* doc/tm.texi (POINTERS_EXTEND_UNSIGNED): Document extensions to
word_mode as well as Pmode.
Index: gcc/doc/tm.texi
===================================================================
--- gcc/doc/tm.texi (revision 128522)
+++ gcc/doc/tm.texi (working copy)
@@ -1004,14 +1004,15 @@ a value the default is @code{BITS_PER_WO
@end defmac
@defmac POINTERS_EXTEND_UNSIGNED
-A C expression whose value is greater than zero if pointers that need to be
-extended from being @code{POINTER_SIZE} bits wide to @code{Pmode} are to
-be zero-extended and zero if they are to be sign-extended. If the value
-is less then zero then there must be an "ptr_extend" instruction that
-extends a pointer from @code{POINTER_SIZE} to @code{Pmode}.
+A C expression that determines how pointers should be extended from
+@code{ptr_mode} to either @code{Pmode} or @code{word_mode}. It is
+greater than zero if pointers should be zero-extended, zero if they
+should be sign-extended, and negative if some other sort of conversion
+is needed. In the last case, the extension is done by the target's
+@code{ptr_extend} instruction.
-You need not define this macro if the @code{POINTER_SIZE} is equal
-to the width of @code{Pmode}.
+You need not define this macro if the @code{ptr_mode}, @code{Pmode}
+and @code{word_mode} are all the same width.
@end defmac
@defmac PROMOTE_MODE (@var{m}, @var{unsignedp}, @var{type})
More information about the Gcc-patches
mailing list