This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/71957] [5/6/7 Regression] Invalid code generation with function static objects


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]