diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2014-09-10 08:33:36 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2014-09-10 06:33:36 +0000 |
commit | 21833f2df07ba269b517e98946605b5a8385625c (patch) | |
tree | e0d4fcb0f9d8b8cacc76989460a86830e120d2cd /gcc | |
parent | e274629ef852151bc3cf9c2b1547ff2108dd3d75 (diff) | |
download | gcc-21833f2df07ba269b517e98946605b5a8385625c.zip gcc-21833f2df07ba269b517e98946605b5a8385625c.tar.gz gcc-21833f2df07ba269b517e98946605b5a8385625c.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ipa-prop.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lto/pr63166_0.ii | 37 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lto/pr63166_1.ii | 108 |
5 files changed, 157 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9357a6f..71d0700 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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> diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 9632ea85..bbb417d 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -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), diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0a2562a..e18eea3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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. diff --git a/gcc/testsuite/g++.dg/lto/pr63166_0.ii b/gcc/testsuite/g++.dg/lto/pr63166_0.ii new file mode 100644 index 0000000..f8ef712 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr63166_0.ii @@ -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) +{ +} diff --git a/gcc/testsuite/g++.dg/lto/pr63166_1.ii b/gcc/testsuite/g++.dg/lto/pr63166_1.ii new file mode 100644 index 0000000..29438fe5 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr63166_1.ii @@ -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) << " "; + } + } + } + } +} |