[Bug c++/89698] [7/8/9 Regression] Run-time error due to optimization of field access after cast at -Os/-O2 and higher

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 13 10:09:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89698

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|Host                        |x86_64-*-*
                 CC|                            |jason at gcc dot gnu.org
               Host|Linux solsa-server          |
                   |4.15.0-45-generic           |
                   |#48-Ubuntu SMP Tue Jan 29   |
                   |16:28:13 UTC 2019 x86_64    |
                   |x86_64 x86_64 GNU/Linux     |

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Eliding the strange dynamic_cast also fixes this, that is, just writing

    void* vp = (void *)(bp);


More information about the Gcc-bugs mailing list