This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/27344] associativity of * operator incorrect when compiled without optimization
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Apr 2006 00:00:42 -0000
- Subject: [Bug c++/27344] associativity of * operator incorrect when compiled without optimization
- References: <bug-27344-12614@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-04-28 00:00 -------
(five * 2 * five.neg());
This is equivlant to:
(five * 2) * (five.neg())
but the C and C++ standard do not specify which expression is evulated first.
In that (five * 2) might be evulated first or five.neg(). five.neg() has a
side effect of changing five (_value *= -1;) which makes the above statement
undefined as five is accessed and written to without a sequence point
inbetween.
And it makes it a duplicate of PR 11751.
*** This bug has been marked as a duplicate of 11751 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27344