This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/29913] argument width changes from inlined method definition with -O2
- 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: 20 Nov 2006 14:52:53 -0000
- Subject: [Bug c++/29913] argument width changes from inlined method definition with -O2
- References: <bug-29913-12577@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from pinskia at gcc dot gnu dot org 2006-11-20 14:52 -------
(In reply to comment #3)
> Richard, please take another look at the bug report.
I just did. The behavior is undefined as the enum's size is not enough to fit
12.
>
> note that the printed number change values depending on wether a class method
> is inlined and compiled with -O2, or whether those 2 conditions are not met.
> i think that, regardless of how g++ chooses to implement the C++ standard, the
> calculated values shouldn't depend on -O1 vs. -O2 or on whether a class methopd
> is inlined or not.
Yes and the C++ standard says this is undefined behavior which means the output
can be different between runs (in this case it is different between
optimization levels and inlining).
>
> please also note that g++-3.4 and g++-3.3 both do not exhibit this behaviour,
> so if you still want to close this bug report as invalid, please give a short
> explanaition on why programs wich depend on the i++ result to increment, should
> fail with gcc-4.2 when they worked perfectly fine with 3.3 and 3.4.
3.4 (and before) did not implement this part of the C++ standard and got some
enum values incorrect.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29913