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/33248] The execution gives wrong results when compiled with mingw32-gcc 3.4.2



------- Comment #2 from alduc1 at free dot fr  2007-08-30 15:22 -------
I do not think it is the same bug 11751.

For example:

  *p++ = *p + 1.0;
  *p++ = *p + 1.0;

works. But

  *p++ = (float) floor((double) *p + 0.5);
  *p++ = (float) floor((double) *p + 0.5);

does not work (with float). It is not only the ++ operator that cause the
problem.
Why when it is compiled with gcc 3.2.3 there is no problem ?
Why the equivalent code

  *p = (float) floor((double) *p + 0.5);
  p++;
  *p = (float) floor((double) *p + 0.5);
  p++;

works ?
I do not understand "no sequence point between *p++ and *p" ?


-- 

alduc1 at free dot fr changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |


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


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