Commit c37257a1 by Richard Guenther Committed by Richard Biener

re PR lto/48437 (LTO crashes with block-local function declarations)

2011-12-08  Richard Guenther  <rguenther@suse.de>

	PR lto/48437
	* lto-streamer-out.c (tree_is_indexable): Exclude block-local
	extern declarations.

	* gcc.dg/lto/20111207-2_0.c: New testcase.
	* gcc.dg/guality/pr48437.c: Likewise.

From-SVN: r182100
parent a633b93e
2011-12-08 Richard Guenther <rguenther@suse.de>
PR lto/48437
* lto-streamer-out.c (tree_is_indexable): Exclude block-local
extern declarations.
2011-12-07 Andrew Pinski <apinski@cavium.com> 2011-12-07 Andrew Pinski <apinski@cavium.com>
PR middle-end/45416 PR middle-end/45416
...@@ -129,6 +129,16 @@ tree_is_indexable (tree t) ...@@ -129,6 +129,16 @@ tree_is_indexable (tree t)
else if (TREE_CODE (t) == VAR_DECL && decl_function_context (t) else if (TREE_CODE (t) == VAR_DECL && decl_function_context (t)
&& !TREE_STATIC (t)) && !TREE_STATIC (t))
return false; return false;
/* If this is a decl generated for block local externs for
debug info generation, stream it unshared alongside BLOCK_VARS. */
else if (VAR_OR_FUNCTION_DECL_P (t)
/* ??? The following tests are a literal match on what
c-decl.c:pop_scope does. */
&& TREE_PUBLIC (t)
&& DECL_EXTERNAL (t)
&& DECL_CONTEXT (t)
&& TREE_CODE (DECL_CONTEXT (t)) == FUNCTION_DECL)
return false;
else else
return (TYPE_P (t) || DECL_P (t) || TREE_CODE (t) == SSA_NAME); return (TYPE_P (t) || DECL_P (t) || TREE_CODE (t) == SSA_NAME);
} }
......
2011-12-08 Richard Guenther <rguenther@suse.de>
PR lto/48437
* gcc.dg/lto/20111207-2_0.c: New testcase.
* gcc.dg/guality/pr48437.c: Likewise.
2011-12-07 Jakub Jelinek <jakub@redhat.com> 2011-12-07 Jakub Jelinek <jakub@redhat.com>
PR c++/51401 PR c++/51401
......
/* PR lto/48437 */
/* { dg-do run } */
/* { dg-options "-g" } */
#include "../nop.h"
int i __attribute__((used));
int main()
{
volatile int i;
for (i = 3; i < 7; ++i)
{
extern int i;
asm volatile (NOP : : : "memory"); /* { dg-final { gdb-test 14 "i" "0" } } */
}
return 0;
}
/* { dg-lto-do run } */
int
test (void)
{
int f (void);
return 0;
}
int
main (void)
{
int f (void);
int test (void);
return test ();
}
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