Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Previously, GCC could generate wrong code from code that passed a union data type with a signed and an unsigned integer between two functions as a parameter. The compiler could incorrectly insert the __builtin_unreachable call into a codepath in the program that was, in fact, reachable, which resulted in a crash. This bug in the IPA inline analysis has been fixed, and GCC now generates correct code also in the described scenario.
DescriptionRobert Thornthwaite
2015-04-29 22:34:27 UTC
Created attachment 1020351[details]
Preprocessed source
Description of problem:
I got this error while trying to compile.
Version-Release number of selected component (if applicable):
gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC)
How reproducible:
Steps to Reproduce:
1.
2.
3.
Actual results:
Expected results:
Additional info:
Reduced. Only -O is needed to show the ICE.
class A
{
int _M_p;
};
template < typename _Key, typename _Tp > class B
{
public:
_Tp operator[](_Key);
};
union U
{
long double ld;
void *v;
};
A a;
void
fn1 (U p1)
{
if (p1.v)
*reinterpret_cast < A * >(p1.v) = a;
}
class C
{
public:
C (A)
{
m_data.ld = 0;
fn1 (m_data);
}
U m_data;
};
class D
{
public:
A a1;
A a2;
void m_fn1 ()
{
arr[2][a1] = a2;
} B < int, B < A, C > >arr;
};
void
fn2 ()
{
D b;
b.m_fn1 ();
}
Slightly more cleaned up:
// { dg-options "-O -Wno-psabi" }
// { dg-do compile }
struct A { int a; };
template <typename T, typename V> struct B { V operator[] (T); };
union U { long double ld; void *v; };
A a;
void
bar (U &x)
{
if (x.v) *reinterpret_cast <A *>(x.v) = a;
}
struct C { C (A) { c.ld = 0; bar (c); } U c; };
struct D { A d, e; void foo () { f[0][d] = e; } B <int, B <A, C> > f; };
void
baz ()
{
D d;
d.foo ();
}
I've backported the relevant fixes to the 4.8 branch.
Comment 8Robert Thornthwaite
2015-04-30 19:19:34 UTC
(In reply to Marek Polacek from comment #7)
> I've backported the relevant fixes to the 4.8 branch.
You guys are awesome! Thank you. Will this be out in a patch to the compiler sometime soon?
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHBA-2015-2080.html
Created attachment 1020351 [details] Preprocessed source Description of problem: I got this error while trying to compile. Version-Release number of selected component (if applicable): gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: