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

Max TenEyck Woodbury <mtewoodbury at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #4 from Max TenEyck Woodbury <mtewoodbury at gmail dot com> ---
There is another semantic element to the a++ operator; the temporary where the
original value of the variable is stored until used.  You are either unaware of
this aspect of the language or are deliberately ignoring it.

This has NOTHING to do with overloading the postfix operators.  This is part of 
the basic definition of the C language.  In fact, C does NOT have operator
overloading and the majority of GCC is written in C, not C++.

Without optimization, this temporary store is allocated and set even if the
value is never used.  The fact that to value is not used and need never be set
is detected during optimization.  The fact that the temporary store is then
never
used and can be eliminated requires further optimization.  All this extra work
is unnecessary in well written code.  That makes the use of a++ where ++a will
do a minor coding defect.  This bug report provides a referent for changes that
improve that kind of defective code.

Since there are hundreds, if not thousands of instances of this defect in the
GCC code and there is no urgency in correcting these defects, this bug will
only
get resolved slowly.  Closing it for invalid reasons does the community a
disservice.

Reply via email to