Bug 2211506 - dynamic_cast() is failing
Summary: dynamic_cast() is failing
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: gcc
Version: 8.7
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Marek Polacek
QA Contact: Václav Kadlčík
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-31 20:10 UTC by Paulo Andrade
Modified: 2023-07-11 04:50 UTC (History)
6 users (show)

Fixed In Version: gcc-8.5.0-20.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-06-05 16:09:21 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 99074 0 P3 RESOLVED gcc 8 and above is crashing with dynamic_cast<>() on null pointer with optimization level -O1 and above 2023-05-31 20:10:49 UTC
Red Hat Issue Tracker RHELPLAN-158745 0 None None None 2023-05-31 20:11:34 UTC

Description Paulo Andrade 2023-05-31 20:10:49 UTC
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.

Comment 1 Marek Polacek 2023-06-05 16:09:21 UTC
Like <https://bugzilla.redhat.com/show_bug.cgi?id=2211507#c1>, except that GTS 9 is not supported anymore.

Comment 2 Marek Polacek 2023-06-14 11:48:18 UTC
Reopening.  Since I'm updating RHEL 8 gcc for a different BZ, I might as well squeeze in this trivial fix.


Note You need to log in before you can comment on or make changes to this bug.