This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/14863] [3.4 regression] unit-at-a-time causes miscompilation
- From: "giovannibajo at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jun 2004 11:14:36 -0000
- Subject: [Bug rtl-optimization/14863] [3.4 regression] unit-at-a-time causes miscompilation
- References: <20040406114325.14863.rguenth@tat.physik.uni-tuebingen.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From giovannibajo at libero dot it 2004-06-02 11:14 -------
Subject: Re: [3.4 regression] unit-at-a-time causes miscompilation
rguenth at tat dot physik dot uni-tuebingen dot de wrote:
> Hmm, if all is inlined, it should be detectable.
Not really. If *all* is correctly inline and optimized, Serge's testcase would
be reduced to "main() { return 0; }". Actually, tree-ssa is pretty close to do
that, we need to fix the C++ frontend lowering things Pinski is working on.
> Maybe worth a few false positives. I.e. warn for returned
> references to results of methods of local objects.
I think the complete solution must happen at the tree level (not in the
frontend as it is now). Of course, such a situation is detectable only if the
definition of all involved functions are available, etc. After all, it is
undefined behaviour so it is only a QoI issue, we can try harder to help the
user.
Giovanni Bajo
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14863