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
+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>
PR middle-end/45416
else if (TREE_CODE (t) == VAR_DECL && decl_function_context (t)
&& !TREE_STATIC (t))
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
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>
PR c++/51401
--- /dev/null
+/* 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;
+}
--- /dev/null
+/* { dg-lto-do run } */
+
+int
+test (void)
+{
+ int f (void);
+ return 0;
+}
+
+int
+main (void)
+{
+ int f (void);
+ int test (void);
+
+ return test ();
+}