From: Richard Biener Date: Thu, 28 Nov 2013 12:09:10 +0000 (+0000) Subject: re PR debug/59323 (Int. comp. error: in add_AT_specification, at dwarf2out.c:4026) X-Git-Tag: releases/gcc-4.9.0~2396 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=53a5717ecda2796f06cb8d15c2f0e951703479f6;p=thirdparty%2Fgcc.git re PR debug/59323 (Int. comp. error: in add_AT_specification, at dwarf2out.c:4026) 2013-11-28 Richard Biener PR lto/59323 * lto-streamer-out.c (tree_is_indexable): TYPE_DECLs and CONST_DECLs in function context are not indexable. * gcc.dg/lto/pr59323_0.c: New testcase. From-SVN: r205481 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7438fe04f25b..49aad278f562 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-11-28 Richard Biener + + PR lto/59323 + * lto-streamer-out.c (tree_is_indexable): TYPE_DECLs and + CONST_DECLs in function context are not indexable. + 2013-11-28 Chung-Ju Wu * config/nds32/nds32.c (nds32_rtx_costs): Adjust MULT cost if it is diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index 94dc13172a5d..b4b92c72628e 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -135,8 +135,10 @@ tree_is_indexable (tree t) definition. */ if (TREE_CODE (t) == PARM_DECL || TREE_CODE (t) == RESULT_DECL) return variably_modified_type_p (TREE_TYPE (DECL_CONTEXT (t)), NULL_TREE); - else if (TREE_CODE (t) == VAR_DECL && decl_function_context (t) - && !TREE_STATIC (t)) + else if (((TREE_CODE (t) == VAR_DECL && !TREE_STATIC (t)) + || TREE_CODE (t) == TYPE_DECL + || TREE_CODE (t) == CONST_DECL) + && decl_function_context (t)) return false; else if (TREE_CODE (t) == DEBUG_EXPR_DECL) return false; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4cb559c63f9a..c4f749e72125 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-11-28 Richard Biener + + PR lto/59323 + * gcc.dg/lto/pr59323_0.c: New testcase. + 2013-11-28 Jakub Jelinek PR middle-end/57393 diff --git a/gcc/testsuite/gcc.dg/lto/pr59323_0.c b/gcc/testsuite/gcc.dg/lto/pr59323_0.c new file mode 100644 index 000000000000..b5910589158a --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr59323_0.c @@ -0,0 +1,37 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options { { -O2 -g -flto } } } */ +/* { dg-extra-ld-options { -r -nostdlib } } */ + +extern void bar(void); + +int main(int argc, char **argv) +{ + int i; + + if (argc == 1) { + enum { X }; + + bar(); + + { + enum { X }; + + asm goto ("" : : : : lab); +lab: + ; + } + } + + { + enum { X }; + + int foo(void) + { + return argv[0][0]; + } + + i = foo(); + } + + return i; +}