This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/36742] [4.2 Regression] g++ -O2 produces wrong code
- From: "paolo dot carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jul 2008 21:21:42 -0000
- Subject: [Bug libstdc++/36742] [4.2 Regression] g++ -O2 produces wrong code
- References: <bug-36742-16424@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from paolo dot carlini at oracle dot com 2008-07-11 21:21 -------
(In reply to comment #5)
> Isn't this the kind of thing that -Wstrict-aliasing or -Wstrict-aliasing=n
> should warn about?
Hi Benjamin. My guess is that any possible problem can only have to do with
some long standing weaknesses that we have in basic_string and we have big
troubles changing without breaking the ABI. Back when #pragma system header
didn't work with templates we suppressed a "may" aliasing warning in
_S_empty_rep (see comment), and there are chances it may have created actual
problems in 4_2-branch, per this PR. Currently, AFAIK, isn't possible to
reproduce such problems (Ian committed in 4_3 and mainline very important
aliasing-related fixes).
Anyway, for the record, this patch of mine:
http://gcc.gnu.org/ml/libstdc++/2008-07/msg00051.html
fixes this problem in 4_2-branch, passes abi-check. I think it's safe, I don't
think code linking vs the amended library can tell that the exported
_S_empty_rep_storage array changed type, because it's the same size and the
same alignment. If you can double-check may analysis we could imagine
committing it, somewhere.
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bkoz at redhat dot com
Last reconfirmed|2008-07-06 13:40:43 |2008-07-11 21:21:42
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36742