This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/16115] [3.5 regression] double-destruction problem with argument passing via temporary (breaks auto_ptr)
- From: "rth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jun 2004 08:00:29 -0000
- Subject: [Bug tree-optimization/16115] [3.5 regression] double-destruction problem with argument passing via temporary (breaks auto_ptr)
- References: <20040621164318.16115.snyder@fnal.gov>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rth at gcc dot gnu dot org 2004-06-22 08:00 -------
This isn't my bug. The best I can figure has to do with aliasing changes, but
I'm not even 100% certain that there's bugs there either. Jason needs to answer
the question of how the ABI works for passing TREE_ADDRESSABLE type arguments.
What has happened is that the aliasing code saw that the address of PARM_DECL a
was taken (this = &a, where this came from inlining of release into destroy).
The optimizers do not, however, consider the PARM_DECL to overlap global memory,
so we are able to delete the store to a.p as dead.
If passing a TREE_ADDRESSABLE type argument is supposed to pass by invisible
reference, and magically overlap with the original temporary, then the tree
level representation of this is wrong. We should be using a reference type.
My best guess, however, is that the reduced test case is broken.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16115