[Bug c/22485] pointer +- integer is never NULL

2005-09-24 Thread falk at debian dot org
--- Additional Comments From falk at debian dot org 2005-09-24 09:39 --- (In reply to comment #21) > There have been lots of messages exchanged on this topic. It was just > pointed to me that the C++ standard -- unlike the C99 standard -- has the > following wording 5.7/7: Hmm, I miss

[Bug c/22485] pointer +- integer is never NULL

2005-09-23 Thread gdr at gcc dot gnu dot org
--- Additional Comments From gdr at gcc dot gnu dot org 2005-09-24 05:37 --- (In reply to comment #0) > The code > > void stuff(void); > void f(int *p, int x) > { > int *q = p + x; > if (!q) > stuff(); > } > > should never call stuff() - the test is unne

[Bug c/22485] pointer +- integer is never NULL

2005-07-15 Thread mattias at virtutech dot se
--- Additional Comments From mattias at virtutech dot se 2005-07-15 15:29 --- (In reply to comment #18) > The "side" notes were written by people who know what they > intend. Therefore their inputs are completely relevant here. Even if you could show that these optimisations would contr

[Bug c/22485] pointer +- integer is never NULL

2005-07-15 Thread falk at debian dot org
--- Additional Comments From falk at debian dot org 2005-07-15 15:05 --- (In reply to comment #18) > The "side" notes were written by people who know what they > intend. Therefore their inputs are completely relevant here. This is going nowhere. I give up. -- http://gcc.gnu.org/bu

[Bug c/22485] pointer +- integer is never NULL

2005-07-15 Thread gdr at integrable-solutions dot net
--- Additional Comments From gdr at integrable-solutions dot net 2005-07-15 14:43 --- Subject: Re: pointer +- integer is never NULL "falk at debian dot org" <[EMAIL PROTECTED]> writes: | (In reply to comment #13) | > Subject: Re: pointer +- integer is never NULL | > | > "falk at deb

[Bug c/22485] pointer +- integer is never NULL

2005-07-15 Thread falk at debian dot org
--- Additional Comments From falk at debian dot org 2005-07-15 14:22 --- (In reply to comment #13) > Subject: Re: pointer +- integer is never NULL > > "falk at debian dot org" <[EMAIL PROTECTED]> writes: > | Sorry, I cannot follow you. I'd find it massively unsurprising if > | reinterp

[Bug c/22485] pointer +- integer is never NULL

2005-07-15 Thread pluto at agmk dot net
--- Additional Comments From pluto at agmk dot net 2005-07-15 10:35 --- minor comment: e.g. on ARM7 i can read data from address 0x (-> exception vector table). int* p = (int*)0x0004; int d = -1; int *m = *p + d;// it's valid for ARM arch. -- http://gcc.gnu.org/bugz

[Bug c/22485] pointer +- integer is never NULL

2005-07-15 Thread gdr at integrable-solutions dot net
--- Additional Comments From gdr at integrable-solutions dot net 2005-07-15 10:26 --- Subject: Re: pointer +- integer is never NULL "mattias at virtutech dot se" <[EMAIL PROTECTED]> writes: | --- Additional Comments From mattias at virtutech dot se 2005-07-15 09:12 --- | It

[Bug c/22485] pointer +- integer is never NULL

2005-07-15 Thread mattias at virtutech dot se
--- Additional Comments From mattias at virtutech dot se 2005-07-15 09:12 --- It could be made an option so the user can tell GCC whether to make standard-conforming code go as fast as possible or if arithmetic on null pointers (as a gcc extension, say) is needed. -fnull-pointer-arith?

[Bug c/22485] pointer +- integer is never NULL

2005-07-15 Thread gdr at integrable-solutions dot net
--- Additional Comments From gdr at integrable-solutions dot net 2005-07-15 08:10 --- Subject: Re: pointer +- integer is never NULL "falk at debian dot org" <[EMAIL PROTECTED]> writes: | --- Additional Comments From falk at debian dot org 2005-07-15 06:41 --- | Subject: Re:

[Bug c/22485] pointer +- integer is never NULL

2005-07-14 Thread falk at debian dot org
--- Additional Comments From falk at debian dot org 2005-07-15 06:41 --- Subject: Re: pointer +- integer is never NULL "gdr at integrable-solutions dot net" <[EMAIL PROTECTED]> writes: > My indirect observation was that reinterpret_cast is intended for > specific needs that cannot ade

[Bug c/22485] pointer +- integer is never NULL

2005-07-14 Thread gdr at integrable-solutions dot net
--- Additional Comments From gdr at integrable-solutions dot net 2005-07-14 23:03 --- Subject: Re: pointer +- integer is never NULL "falk at debian dot org" <[EMAIL PROTECTED]> writes: [...] | > | (In reply to comment #7) | > | | > | > I'm failing to find anything in the C++ standar

[Bug c/22485] pointer +- integer is never NULL

2005-07-14 Thread falk at debian dot org
--- Additional Comments From falk at debian dot org 2005-07-14 21:47 --- Subject: Re: pointer +- integer is never NULL Gabriel Dos Reis <[EMAIL PROTECTED]> writes: > "falk at debian dot org" <[EMAIL PROTECTED]> writes: > > | --- Additional Comments From falk at debian dot org 200

Re: [Bug c/22485] pointer +- integer is never NULL

2005-07-14 Thread Falk Hueffner
Gabriel Dos Reis <[EMAIL PROTECTED]> writes: > "falk at debian dot org" <[EMAIL PROTECTED]> writes: > > | --- Additional Comments From falk at debian dot org 2005-07-14 15:37 > --- > | (In reply to comment #7) > | > | > I'm failing to find anything in the C++ standard that suggests that

[Bug c/22485] pointer +- integer is never NULL

2005-07-14 Thread gdr at integrable-solutions dot net
--- Additional Comments From gdr at integrable-solutions dot net 2005-07-14 19:38 --- Subject: Re: pointer +- integer is never NULL "falk at debian dot org" <[EMAIL PROTECTED]> writes: | --- Additional Comments From falk at debian dot org 2005-07-14 15:37 --- | (In reply to

Re: [Bug c/22485] pointer +- integer is never NULL

2005-07-14 Thread Gabriel Dos Reis
"falk at debian dot org" <[EMAIL PROTECTED]> writes: | --- Additional Comments From falk at debian dot org 2005-07-14 15:37 --- | (In reply to comment #7) | | > I'm failing to find anything in the C++ standard that suggests that the | > following shall be undefined | > | >(reinterp

[Bug c/22485] pointer +- integer is never NULL

2005-07-14 Thread falk at debian dot org
--- Additional Comments From falk at debian dot org 2005-07-14 15:37 --- (In reply to comment #7) > I'm failing to find anything in the C++ standard that suggests that the > following shall be undefined > >(reinterpret_cast(0) + 5) - 5 If (reinterpret_cast(0) + 5) - 5 is not undef

[Bug c/22485] pointer +- integer is never NULL

2005-07-14 Thread gdr at integrable-solutions dot net
--- Additional Comments From gdr at integrable-solutions dot net 2005-07-14 15:19 --- Subject: Re: pointer +- integer is never NULL "falk at debian dot org" <[EMAIL PROTECTED]> writes: | (In reply to comment #4) | > H. | > I swear we just had this discussion for VRP purposes, and

[Bug c/22485] pointer +- integer is never NULL

2005-07-14 Thread gdr at integrable-solutions dot net
--- Additional Comments From gdr at integrable-solutions dot net 2005-07-14 15:17 --- Subject: Re: pointer +- integer is never NULL "dberlin at gcc dot gnu dot org" <[EMAIL PROTECTED]> writes: | H. | I swear we just had this discussion for VRP purposes, and that a bug was | recent

[Bug c/22485] pointer +- integer is never NULL

2005-07-14 Thread falk at debian dot org
--- Additional Comments From falk at debian dot org 2005-07-14 13:45 --- (In reply to comment #4) > H. > I swear we just had this discussion for VRP purposes, and that a bug was > recently fixed so that we don't assume that pointer + - integer is NULL. Well, I checked C99 and C++,

[Bug c/22485] pointer +- integer is never NULL

2005-07-14 Thread dberlin at gcc dot gnu dot org
--- Additional Comments From dberlin at gcc dot gnu dot org 2005-07-14 13:38 --- H. I swear we just had this discussion for VRP purposes, and that a bug was recently fixed so that we don't assume that pointer + - integer is NULL. But if it's really undefined, maybe we should optimi

[Bug c/22485] pointer +- integer is never NULL

2005-07-14 Thread falk at debian dot org
--- Additional Comments From falk at debian dot org 2005-07-14 13:19 --- (In reply to comment #2) > This is invalid and here is why, if both p and x are NULL/0, then p+x will always be NULL so in this is > invalid optimization. Huh? nullpointer + 0 is undefined, it doesn't matter what

[Bug c/22485] pointer +- integer is never NULL

2005-07-14 Thread pinskia at gcc dot gnu dot org
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-14 13:14 --- This is invalid and here is why, if both p and x are NULL/0, then p+x will always be NULL so in this is invalid optimization. -- What|Removed |Added ---

[Bug c/22485] pointer +- integer is never NULL

2005-07-14 Thread mattias at virtutech dot se
--- Additional Comments From mattias at virtutech dot se 2005-07-14 13:13 --- I forgot to state the version (4.0.0), but I have not seen any gcc version optimising this case. -- What|Removed |Added