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 10:57:33 -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 10:57 -------
Subject: Re: [3.4 regression] unit-at-a-time causes miscompilation
rguenth at tat dot physik dot uni-tuebingen dot de wrote:
> Btw. - why doesn't gcc warn about returning a reference
> to a temporary there?
It's not easy, because IntervalIterator::operator* returns a reference which is
valid for its scope. Then, reverse_iterator::operator* thinks that the
reference it gets is valid and returns it without a warning. EDG doesn't warn
as well on this testcases. I wonder if the tree gurus can find a way to detect
this and similar situations.
Giovanni Bajo
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14863