User is experiencing the issue in upstream bug report https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99074 [gcc 8 and above is crashing with dynamic_cast<>() on null pointer with optimization level -O1 and above] and would like a backport for gcc-toolset-9-gcc-9.2* as it is being used for their product. While it is agreed it is UB, previous source code relied on this working.
Like <https://bugzilla.redhat.com/show_bug.cgi?id=2211507#c1>, except that GTS 9 is not supported anymore.
Reopening. Since I'm updating RHEL 8 gcc for a different BZ, I might as well squeeze in this trivial fix.