This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54899] -fpredictive-commoning and -ftree-vectorize optimizations generate a nonsensical binary which segfaults
- From: "zsojka at seznam dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 11 Oct 2012 10:37:59 +0000
- Subject: [Bug c++/54899] -fpredictive-commoning and -ftree-vectorize optimizations generate a nonsensical binary which segfaults
- Auto-submitted: auto-generated
- References: <bug-54899-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54899
Zdenek Sojka <zsojka at seznam dot cz> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |zsojka at seznam dot cz
--- Comment #1 from Zdenek Sojka <zsojka at seznam dot cz> 2012-10-11 10:37:59 UTC ---
bug2.ii:57
Thing thing(Vec<>(0.0, 1.0, 0.0), Vec<>(0.0, 1.0, 1.0));
bug2.ii:33
inline VecBinaryExpr(const Vec<>& e1, const Vec<>& e2) : Exp1(e1), Exp2(e2)
{}
bug2.ii:31
const Vec<>& Exp1;
const Vec<>& Exp2;
References to temporaries are taken and stored. Life of temporaries ends after
the return from call to the contructor, thus (Exp1, Exp2) are referencing dead
objects.