+2005-03-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/20622
+ * cgraph.h (struct cgraph_varpool_node): Add alias field.
+ * cgraph.c (cgraph_varpool_assemble_pending_decls): Don't call
+ assemble_variable on aliases.
+ * varasm.c (assemble_alias): Set node->alias.
+ * toplev.c (wrapup_global_declarations): Don't call
+ rest_of_decl_compilation on aliases again.
+
2005-03-29 Paul Brook <paul@codesourcery.com>
* config/arm/arm-protos.h (arm_dbx_register_number): Add prototype.
while (cgraph_varpool_nodes_queue)
{
- tree decl = cgraph_varpool_nodes_queue->decl;
struct cgraph_varpool_node *node = cgraph_varpool_nodes_queue;
+ tree decl = node->decl;
cgraph_varpool_nodes_queue = cgraph_varpool_nodes_queue->next_needed;
- if (!TREE_ASM_WRITTEN (decl))
+ if (!TREE_ASM_WRITTEN (decl) && !node->alias)
{
assemble_variable (decl, 0, 1, 0);
changed = true;
bool finalized;
/* Set when function is scheduled to be assembled. */
bool output;
+ /* Set for aliases once they got through assemble_alias. */
+ bool alias;
};
extern GTY(()) struct cgraph_node *cgraph_nodes;
+2005-03-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/20622
+ * gcc.dg/alias-7.c: New test.
+
2005-03-29 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/sparc-reg-1.c: New test.
--- /dev/null
+/* { dg-do run } */
+/* { dg-require-alias "" } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+int foo __asm__ ("foo") __attribute__((nocommon));
+extern __typeof (foo) bar __attribute__ ((weak, alias ("foo")));
+
+int
+main (void)
+{
+ if (&foo != &bar || foo || bar)
+ abort ();
+ return bar;
+}
if (flag_unit_at_a_time && node->finalized)
needed = 0;
+ else if (node->alias)
+ needed = 0;
else if ((flag_unit_at_a_time && !cgraph_global_info_ready)
&& (TREE_USED (decl)
|| TREE_USED (DECL_ASSEMBLER_NAME (decl))))
if (TREE_CODE (decl) == FUNCTION_DECL)
cgraph_node (decl);
else
- cgraph_varpool_node (decl);
+ cgraph_varpool_node (decl)->alias = true;
/* If the target has already been emitted, we don't have to queue the
alias. This saves a tad o memory. */