Re: GCC 4.3.2 bug (was: Illegal subtraction in tmp-dive_1.s)

2009-04-21 Thread Vincent Lefevre
On 2009-04-20 15:17:44 +0200, Vincent Lefevre wrote: On 2009-04-17 12:09:42 -0500, Gabriel Dos Reis wrote: At least, let's get it archived on GCC mailing lists. Is it a bug that has been identified? FYI, this has been fixed in the 4.3 branch in r143494. This was PR tree-optimization/36765.

Re: GCC 4.3.2 bug (was: Illegal subtraction in tmp-dive_1.s)‏

2009-04-20 Thread James Dennett
2009/4/19 Jason Mancini jayrus...@hotmail.com: Vincent Lefevre  writes:    while ((*(q++))-- == 0) ; Is that defined and legal??  Is q incremented before or after *q is decremented?  They are both post operators! Jason Mancini It's defined and legal (so long as q != q, which might well be

Re: GCC 4.3.2 bug (was: Illegal subtraction in tmp-dive_1.s)

2009-04-20 Thread Vincent Lefevre
On 2009-04-17 12:09:42 -0500, Gabriel Dos Reis wrote: At least, let's get it archived on GCC mailing lists. Is it a bug that has been identified? If not, perhaps this should be added to the regression tests. The program without the quotes: /* With GCC 4.3.2 and -O2 option: output value is 1

Re: GCC 4.3.2 bug (was: Illegal subtraction in tmp-dive_1.s)?

2009-04-20 Thread Vincent Lefevre
On 2009-04-20 00:30:21 -0700, James Dennett wrote: 2009/4/19 Jason Mancini jayrus...@hotmail.com: Vincent Lefevre  writes:    while ((*(q++))-- == 0) ; Is that defined and legal??  Is q incremented before or after *q is decremented?  They are both post operators! It's defined and

Re: GCC 4.3.2 bug (was: Illegal subtraction in tmp-dive_1.s)?

2009-04-20 Thread Joern Rennecke
As the bug occurs only when malloc is in the tested function, Note that gcc 'knows' that memory obtained by malloc does not alias other memory. You can use a differently named wrapper function for malloc, or use the malloc attribute for another function, to experiment how this affects code

Re: GCC 4.3.2 bug (was: Illegal subtraction in tmp-dive_1.s)?

2009-04-20 Thread Vincent Lefevre
On 2009-04-20 10:04:00 -0400, Joern Rennecke wrote: As the bug occurs only when malloc is in the tested function, Note that gcc 'knows' that memory obtained by malloc does not alias other memory. Yes, in the case of GMP, this was a GMP internal function, not malloc, but this function is

Re: GCC 4.3.2 bug (was: Illegal subtraction in tmp-dive_1.s)‏

2009-04-19 Thread Jason Mancini
Vincent Lefevre writes: while ((*(q++))-- == 0) ; Is that defined and legal?? Is q incremented before or after *q is decremented? They are both post operators! Jason Mancini _ Rediscover Hotmail®: Get e-mail storage that

Re: GCC 4.3.2 bug (was: Illegal subtraction in tmp-dive_1.s)

2009-04-17 Thread Gabriel Dos Reis
At least, let's get it archived on GCC mailing lists. On Fri, Apr 17, 2009 at 11:25 AM, Torbjorn Granlund t...@gmplib.org wrote: Vincent Lefevre vinc...@vinc17.org writes: FYI, here's a simple testcase: /* With GCC 4.3.2 and -O2 option: output value is 1 instead of 0. * If