re PR lto/42653 (ICE with -g and -flto (requires both flags to crash))

2010-04-23  Richard Guenther  <rguenther@suse.de>

	PR lto/42653
	* tree.c (free_lang_data_in_decl): Do not reset DECL_CONTEXT
	of FUNCTION_DECLs.

	* g++.dg/lto/20100423-1_0.C: New testcase.

From-SVN: r158666
This commit is contained in:
Richard Guenther 2010-04-23 14:20:59 +00:00 committed by Richard Biener
parent 086058c2a6
commit c67f69a3f3
4 changed files with 51 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2010-04-23 Richard Guenther <rguenther@suse.de>
PR lto/42653
* tree.c (free_lang_data_in_decl): Do not reset DECL_CONTEXT
of FUNCTION_DECLs.
2010-04-22 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* sese.h (create_if_region_on_edge): Remove.

View File

@ -1,3 +1,8 @@
2010-04-23 Richard Guenther <rguenther@suse.de>
PR lto/42653
* g++.dg/lto/20100423-1_0.C: New testcase.
2010-04-22 Uros Bizjak <ubizjak@gmail.com>
* gcc.dg/graphite/interchange-0.c: Fix dg-final directive.

View File

@ -0,0 +1,38 @@
// { dg-lto-do assemble }
// { dg-lto-options {{-g -flto}} }
namespace llvm
{
class Function;
class MachineCodeInfo;
class ExecutionEngine
{
};
class JIT : public ExecutionEngine
{
void runJITOnFunction (Function * F, MachineCodeInfo * MCI = 0);
};
class JITEventListener
{
public:
JITEventListener ()
{
}
virtual ~JITEventListener ();
};
}
using namespace llvm;
void
JIT::runJITOnFunction (Function * F, MachineCodeInfo * MCI)
{
class MCIListener:public JITEventListener
{
MachineCodeInfo *const MCI;
public:
MCIListener (MachineCodeInfo * mci):MCI (mci)
{
}
};
}

View File

@ -4361,7 +4361,8 @@ free_lang_data_in_decl (tree decl)
/* Ignore any intervening types, because we are going to clear their
TYPE_CONTEXT fields. */
if (TREE_CODE (decl) != FIELD_DECL)
if (TREE_CODE (decl) != FIELD_DECL
&& TREE_CODE (decl) != FUNCTION_DECL)
DECL_CONTEXT (decl) = decl_function_context (decl);
if (DECL_CONTEXT (decl)