This is the mail archive of the gcc-bugs@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]

[Bug c/13421] IA32 bigmem pointer subtraction and –ftrapv option causes unjustified program abort


------- Additional Comments From zack at gcc dot gnu dot org  2003-12-17 18:21 -------
1) Indeed, this subtraction operation should work fine whether or not pointers
are unsigned, and whether or not -ftrapv is in use.  This is not a documentation
bug.

2) POINTERS_EXTEND_UNSIGNED does not mean what you think it means.  From the manual:

  `POINTERS_EXTEND_UNSIGNED'
     A C expression whose value is greater than zero if pointers that
     need to be extended from being `POINTER_SIZE' bits wide to `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 `POINTER_SIZE' to `Pmode'.

     You need not define this macro if the `POINTER_SIZE' is equal to
     the width of `Pmode'.

In particular, this *only* affects extension of pointers from POINTER_SIZE to
Pmode.  It says *nothing* about whether address arithmetic should be treated as
signed.  I don't think we even have a way of talking about that.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |normal
           Keywords|documentation               |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13421


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