[Bug rtl-optimization/14863] [3.4 regression] unit-at-a-time causes miscompilation

giovannibajo at libero dot it gcc-bugzilla@gcc.gnu.org
Wed Jun 2 11:14:00 GMT 2004


------- 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



More information about the Gcc-bugs mailing list