This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/13421] IA32 bigmem pointer subtraction and –ftrapv option causes unjustified program abort
- From: "zack at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Dec 2003 18:21:59 -0000
- Subject: [Bug c/13421] IA32 bigmem pointer subtraction and –ftrapv option causes unjustified program abort
- References: <20031217152930.13421.vik.heyndrickx@pandora.be>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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