re PR lto/63166 (ICE (LTO): ipa_intraprocedural_devirtualization, at ipa-prop.c:2611)

PR ipa/63166
	* ipa-prop.c (compute_known_type_jump_func): Fix conditional.

	* g++.dg/lto/pr63166_0.ii: New testcase.
	* g++.dg/lto/pr63166_1.ii: New testcase.

From-SVN: r215105
This commit is contained in:
Jan Hubicka 2014-09-10 08:33:36 +02:00 committed by Jan Hubicka
parent e274629ef8
commit 21833f2df0
5 changed files with 157 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2014-09-10 Jan Hubicka <hubicka@ucw.cz>
PR ipa/63166
* ipa-prop.c (compute_known_type_jump_func): Fix conditional.
2014-09-10 Alexander Ivchenko <alexander.ivchenko@intel.com>
Maxim Kuznetsov <maxim.kuznetsov@intel.com>
Anna Tikhonova <anna.tikhonova@intel.com>

View file

@ -1537,8 +1537,8 @@ compute_known_type_jump_func (tree op, struct ipa_jump_func *jfunc,
call, current_function_decl)
/* Even if the var seems to be in construction by inline call stack,
we may work out the actual type by walking memory writes. */
&& (!is_global_var (base)
&& detect_type_change (op, base, expected_type, call, jfunc, offset)))
&& (is_global_var (base)
|| detect_type_change (op, base, expected_type, call, jfunc, offset)))
return;
ipa_set_jf_known_type (jfunc, offset, TREE_TYPE (base),

View file

@ -1,3 +1,8 @@
2014-09-10 Jan Hubicka <hubicka@ucw.cz>
* g++.dg/lto/pr63166_0.ii: New testcase.
* g++.dg/lto/pr63166_1.ii: New testcase.
2014-09-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
* gcc.dg/cpp/warn-normalized-3.c: Delete useless dg-prune-output.

View file

@ -0,0 +1,37 @@
// { dg-lto-do compile }
extern "C"
{
extern long unsigned int strlen (__const char *__s);
}
class Cstring
{
};
class Foobar_Out
{
virtual void put_to_buf (const char *str, long unsigned int msg_len);
void put_to_buf (const char *str)
{
put_to_buf (str, strlen (str));
}
Foobar_Out & operator << (const char *str);
Foobar_Out & operator << (const Cstring & cstring);
};
class Foobar_Log:public Foobar_Out
{
Foobar_Log (int channel);
virtual void put_to_buf (const char *str, long unsigned int msg_len);
};
Foobar_Out & Foobar_Out::operator << (const char *str)
{
put_to_buf (str);
}
Foobar_Out & Foobar_Out::operator << (const Cstring & cstring)
{
return *this;
}
Foobar_Log::Foobar_Log (int ch)
{
}

View file

@ -0,0 +1,108 @@
class EIdent { };
class Cstring { };
template < class KEY, class VALUE, class HASHER > class HashMapIterator
{
public:
virtual ~ HashMapIterator () { }
};
class ECell;
class ECell_ptr
{
ECell *mp_element;
public:
ECell * operator -> () const
{
return (mp_element);
}
}
sicat_cmd_status;
class CellListIterator;
class ECellList
{
public:
virtual CellListIterator * createIterator () const = 0;
virtual ECell_ptr Find (const EIdent & anIdent) = 0;
};
class Foobar_Out
{
virtual int get_channel () { }
public:
Foobar_Out & operator << (const char *str);
Foobar_Out & operator << (const Cstring & cstring);
};
class Foobar_Log:public Foobar_Out { };
extern Foobar_Log Foobar_LOG;
template < class KEY > class BagIterator
{
public:
inline const KEY & operator * () const;
inline int atEnd () const;
};
class EMaskView;
class ECell
{
public:
virtual const EMaskView & getMaskView () const = 0;
};
class FoobarDatabase
{
public:
const Cstring & getName (const EIdent & id) const;
ECellList *getCellList ();
};
inline FoobarDatabase &
DB () { }
class EMaskView
{
public:
inline BagIterator < EIdent > getCallerIterator () const;
};
struct DBHashFunctions
{
};
class CellListIterator:public HashMapIterator < EIdent, ECell *,
DBHashFunctions >
{
};
class IdentSet
{
public:
unsigned int getSize () const { }
int isEmpty () const { }
};
class IdentSetIterator
{
public:
IdentSetIterator (const IdentSet * p_source) { }
int atEnd () const { }
EIdent operator* () const { }
};
void
validate ()
{
IdentSet complete_cell_ids;
IdentSet incomplete_cell_ids;
CellListIterator *p_cl_it = DB ().getCellList ()->createIterator ();
delete p_cl_it;
while (!incomplete_cell_ids.isEmpty ())
{
if (incomplete_cell_ids.getSize () < complete_cell_ids.getSize ())
{
IdentSetIterator complete_cell_it (&complete_cell_ids);
while (!complete_cell_it.atEnd ())
{
BagIterator < EIdent > caller_it =
DB ().getCellList ()->Find (*complete_cell_it)->
getMaskView ().getCallerIterator ();
while (!caller_it.atEnd ())
{
Foobar_LOG << DB ().getName (*caller_it) << " ";
}
}
}
}
}