This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/71957] [5/6/7 Regression] Invalid code generation with function static objects
- From: "sebastian dot huber at embedded-brains dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 22 Jul 2016 08:24:56 +0000
- Subject: [Bug tree-optimization/71957] [5/6/7 Regression] Invalid code generation with function static objects
- Auto-submitted: auto-generated
- References: <bug-71957-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71957
Sebastian Huber <sebastian.huber@embedded-brains.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution|--- |INVALID
--- Comment #5 from Sebastian Huber <sebastian.huber@embedded-brains.de> ---
(In reply to Sebastian Huber from comment #4)
> (In reply to Richard Biener from comment #3)
> > On a second look the testcase looks invalid as it invokes a virtual function
> > via C<D> on an object of type C<A>. Why do you think doing this is valid?
>
> I try to generate a new test case without the reinterpret cast.
Sorry, you are right, this is undefined behaviour. Without the reinterpret
casts it is not reproducible. I reduced the test case from a larger code base
via the delta tool. This code worked for years well. Using the
-fsanitize=unreachable option would have saved some trouble.