Avoid using unavailable objects in jt_state.
The jump threading state is about to get more interesting, and it may get with a ranger or with the const_copies/etc helpers. This patch makes sure we have an object before we attempt to call push_marker or pop_to_marker. Tested on x86-64 Linux. gcc/ChangeLog: * tree-ssa-threadedge.c (jt_state::push): Only call methods for which objects are available. (jt_state::pop): Same. (jt_state::register_equiv): Same. (jt_state::register_equivs_on_edge): Same.
This commit is contained in:
parent
b237eb9dfd
commit
2fcfc03459
@ -1323,7 +1323,9 @@ jt_state::jt_state (const_and_copies *copies,
|
|||||||
void
|
void
|
||||||
jt_state::push (edge)
|
jt_state::push (edge)
|
||||||
{
|
{
|
||||||
|
if (m_copies)
|
||||||
m_copies->push_marker ();
|
m_copies->push_marker ();
|
||||||
|
if (m_exprs)
|
||||||
m_exprs->push_marker ();
|
m_exprs->push_marker ();
|
||||||
if (m_evrp)
|
if (m_evrp)
|
||||||
m_evrp->push_marker ();
|
m_evrp->push_marker ();
|
||||||
@ -1334,7 +1336,9 @@ jt_state::push (edge)
|
|||||||
void
|
void
|
||||||
jt_state::pop ()
|
jt_state::pop ()
|
||||||
{
|
{
|
||||||
|
if (m_copies)
|
||||||
m_copies->pop_to_marker ();
|
m_copies->pop_to_marker ();
|
||||||
|
if (m_exprs)
|
||||||
m_exprs->pop_to_marker ();
|
m_exprs->pop_to_marker ();
|
||||||
if (m_evrp)
|
if (m_evrp)
|
||||||
m_evrp->pop_to_marker ();
|
m_evrp->pop_to_marker ();
|
||||||
@ -1346,6 +1350,7 @@ jt_state::pop ()
|
|||||||
void
|
void
|
||||||
jt_state::register_equiv (tree dst, tree src, bool update_range)
|
jt_state::register_equiv (tree dst, tree src, bool update_range)
|
||||||
{
|
{
|
||||||
|
if (m_copies)
|
||||||
m_copies->record_const_or_copy (dst, src);
|
m_copies->record_const_or_copy (dst, src);
|
||||||
|
|
||||||
/* If requested, update the value range associated with DST, using
|
/* If requested, update the value range associated with DST, using
|
||||||
@ -1396,6 +1401,7 @@ jt_state::record_ranges_from_stmt (gimple *stmt, bool temporary)
|
|||||||
void
|
void
|
||||||
jt_state::register_equivs_on_edge (edge e)
|
jt_state::register_equivs_on_edge (edge e)
|
||||||
{
|
{
|
||||||
|
if (m_copies && m_exprs)
|
||||||
record_temporary_equivalences (e, m_copies, m_exprs);
|
record_temporary_equivalences (e, m_copies, m_exprs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user