Commit d282264e by Martin Jambor Committed by Martin Jambor

re PR lto/52605 (LTO -g ICE when looking up context of VMTs of classes defined within functions)

2012-05-02  Martin Jambor  <mjambor@suse.cz>

	PR lto/52605
	* dwarf2out.c (dwarf2out_decl): Only lookup die representing context
	of a variable when the contect is a function.

	* gcc/testsuite/g++.dg/lto/pr52605_0.C: New test.

From-SVN: r187063
parent 40f93bb5
2012-05-02 Martin Jambor <mjambor@suse.cz>
PR lto/52605
* dwarf2out.c (dwarf2out_decl): Only lookup die representing context
of a variable when the contect is a function.
2012-05-02 Michael Matz <matz@suse.de> 2012-05-02 Michael Matz <matz@suse.de>
* coretypes.h (gimple_seq, const_gimple_seq): Typedef as gimple. * coretypes.h (gimple_seq, const_gimple_seq): Typedef as gimple.
......
...@@ -19122,7 +19122,9 @@ dwarf2out_decl (tree decl) ...@@ -19122,7 +19122,9 @@ dwarf2out_decl (tree decl)
return; return;
/* For local statics lookup proper context die. */ /* For local statics lookup proper context die. */
if (TREE_STATIC (decl) && decl_function_context (decl)) if (TREE_STATIC (decl)
&& DECL_CONTEXT (decl)
&& TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL)
context_die = lookup_decl_die (DECL_CONTEXT (decl)); context_die = lookup_decl_die (DECL_CONTEXT (decl));
/* If we are in terse mode, don't generate any DIEs to represent any /* If we are in terse mode, don't generate any DIEs to represent any
......
2012-05-02 Martin Jambor <mjambor@suse.cz>
PR lto/52605
* g++.dg/lto/pr52605_0.C: New test.
2012-05-02 Kirill Yukhin <kirill.yukhin@intel.com> 2012-05-02 Kirill Yukhin <kirill.yukhin@intel.com>
* gcc.target/i386/hle-cmpxchg-acq-1.c: New. * gcc.target/i386/hle-cmpxchg-acq-1.c: New.
......
// { dg-lto-do link }
// { dg-lto-options {{-flto -g}} }
extern "C" void abort (void);
class A
{
public:
virtual int foo (int i);
};
int A::foo (int i)
{
return i + 1;
}
int __attribute__ ((noinline,noclone)) get_input(void)
{
return 1;
}
int main (int argc, char *argv[])
{
class B : public A
{
public:
int bar (int i)
{
return foo (i) + 2;
}
};
class B b;
if (b.bar (get_input ()) != 4)
abort ();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment