mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-20 04:50:25 +08:00
re PR lto/64043 (ICE (segfault) with LTO: in tree_check/tree.h:2758 get_binfo_at_offset/tree.c:11914)
PR lto/64043 * tree.c (virtual_method_call_p): Return false when OTR type has no BINFO. * g++.dg/lto/pr64043_0.C: New testcase. From-SVN: r218727
This commit is contained in:
parent
1bf7c32414
commit
bebecd51b6
@ -1,4 +1,14 @@
|
||||
2014-12-14 Jan HUbicka <hubicka@ucw.cz>
|
||||
2014-12-14 Jan Hubicka <hubicka@ucw.cz>
|
||||
|
||||
* cgraphunit.c (analyze_functions): Always analyze targets of aliases.
|
||||
|
||||
2014-12-14 Jan Hubicka <hubicka@ucw.cz>
|
||||
|
||||
PR lto/64043
|
||||
* tree.c (virtual_method_call_p): Return false when OTR type has
|
||||
no BINFO.
|
||||
|
||||
2014-12-14 Jan Hubicka <hubicka@ucw.cz>
|
||||
|
||||
* cgraphunit.c (analyze_functions): Do not analyze extern inline
|
||||
funtions when not optimizing; skip comdat locals.
|
||||
|
@ -1,3 +1,8 @@
|
||||
2014-12-14 Jan HUbicka <hubicka@ucw.cz>
|
||||
|
||||
PR lto/64043
|
||||
* g++.dg/lto/pr64043_0.C: New testcase.
|
||||
|
||||
2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR rtl-optimization/64037
|
||||
|
14
gcc/testsuite/g++.dg/lto/pr64043_0.C
Normal file
14
gcc/testsuite/g++.dg/lto/pr64043_0.C
Normal file
@ -0,0 +1,14 @@
|
||||
// { dg-lto-do link }
|
||||
// { dg-lto-options { { -flto -std=c++11 } } }
|
||||
// { dg-extra-ld-options "-r -nostdlib -O2" }
|
||||
class Validator
|
||||
{
|
||||
public:
|
||||
virtual ~Validator ();
|
||||
};
|
||||
class FooWriter
|
||||
{
|
||||
Validator *validator;
|
||||
~FooWriter ();
|
||||
};
|
||||
FooWriter::~FooWriter () { delete validator; }
|
15
gcc/tree.c
15
gcc/tree.c
@ -11864,12 +11864,17 @@ virtual_method_call_p (tree target)
|
||||
{
|
||||
if (TREE_CODE (target) != OBJ_TYPE_REF)
|
||||
return false;
|
||||
target = TREE_TYPE (target);
|
||||
gcc_checking_assert (TREE_CODE (target) == POINTER_TYPE);
|
||||
target = TREE_TYPE (target);
|
||||
if (TREE_CODE (target) == FUNCTION_TYPE)
|
||||
tree t = TREE_TYPE (target);
|
||||
gcc_checking_assert (TREE_CODE (t) == POINTER_TYPE);
|
||||
t = TREE_TYPE (t);
|
||||
if (TREE_CODE (t) == FUNCTION_TYPE)
|
||||
return false;
|
||||
gcc_checking_assert (TREE_CODE (t) == METHOD_TYPE);
|
||||
/* If we do not have BINFO associated, it means that type was built
|
||||
without devirtualization enabled. Do not consider this a virtual
|
||||
call. */
|
||||
if (!TYPE_BINFO (obj_type_ref_class (target)))
|
||||
return false;
|
||||
gcc_checking_assert (TREE_CODE (target) == METHOD_TYPE);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user