* passes.c (rest_of_decl_compilation): Don't call varpool_finalize_decl
on decls for which assemble_alias has been called.
* c-c++-common/torture/pr57945.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206708
138bc75d-0d04-0410-961f-
82ee72b054a4
+2014-01-17 Jan Hubicka <hubicka@ucw.cz>
+
+ PR c++/57945
+ * passes.c (rest_of_decl_compilation): Don't call varpool_finalize_decl
+ on decls for which assemble_alias has been called.
+
2014-01-17 Nick Clifton <nickc@redhat.com>
* config/msp430/msp430.opt: (mcpu): New option.
int top_level,
int at_end)
{
+ bool finalize = true;
+
/* We deferred calling assemble_alias so that we could collect
other attributes such as visibility. Emit the alias now. */
if (!in_lto_p)
DECL_EXTERNAL (decl) = 0;
TREE_STATIC (decl) = 1;
assemble_alias (decl, alias);
+ finalize = false;
}
}
rebuild it. */
if (in_lto_p && !at_end)
;
- else if (TREE_CODE (decl) != FUNCTION_DECL)
+ else if (finalize && TREE_CODE (decl) != FUNCTION_DECL)
varpool_finalize_decl (decl);
}
+2014-01-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/57945
+ * c-c++-common/torture/pr57945.c: New test.
+
2014-01-17 Zhenqiang Chen <zhenqiang.chen@arm.com>
* gcc.target/arm/its.c: New testcase.
--- /dev/null
+/* PR c++/57945 */
+/* { dg-do compile } */
+
+extern int j;
+static int i __attribute__((weakref("j")));
+
+int
+foo (void)
+{
+ return &i ? i : 0;
+}