Message ID | 530b495f-e3e8-8223-cda0-1fe0525ba46b@foss.arm.com |
---|---|
State | New |
Headers | show |
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 7b4f47e6efb41e7c401e7347d86fffca6618c4e9..c2cc9df6419573bdc6223e1d2ee348f8af69ccca 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1984,7 +1984,7 @@ cgraph_node::assemble_thunks_and_aliases (void) FOR_EACH_ALIAS (this, ref) { cgraph_node *alias = dyn_cast <cgraph_node *> (ref->referring); - if (!alias->transparent_alias) + if (!alias->transparent_alias && !DECL_EXTERNAL (alias->decl)) { bool saved_written = TREE_ASM_WRITTEN (decl); diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c index 3600ab23bd9157aad76751912306abd498acae92..620deac090b7e718f05d3f37e6ef68e759de0008 100644 --- a/gcc/lto/lto-partition.c +++ b/gcc/lto/lto-partition.c @@ -132,7 +132,7 @@ add_symbol_to_partition_1 (ltrans_partition part, symtab_node *node) /* Be sure that we never try to duplicate partitioned symbol or add external symbol. */ - gcc_assert (c != SYMBOL_EXTERNAL + gcc_assert ((c != SYMBOL_EXTERNAL || node->alias) && (c == SYMBOL_DUPLICATE || !symbol_partitioned_p (node))); part->symbols++; diff --git a/gcc/testsuite/gcc.dg/lto/pr69866_0.c b/gcc/testsuite/gcc.dg/lto/pr69866_0.c new file mode 100644 index 0000000000000000000000000000000000000000..f49ef8d4c1da7a21d1bfb5409d647bd18141595b --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr69866_0.c @@ -0,0 +1,13 @@ +/* { dg-lto-do link } */ + +int _umh(int i) +{ + return i+1; +} + +int weaks(int i) __attribute__((weak, alias("_umh"))); + +int main() +{ + return weaks(10); +} diff --git a/gcc/testsuite/gcc.dg/lto/pr69866_1.c b/gcc/testsuite/gcc.dg/lto/pr69866_1.c new file mode 100644 index 0000000000000000000000000000000000000000..3a14f850eefaffbf659ce4642adef7900330f4ed --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr69866_1.c @@ -0,0 +1,6 @@ +/* { dg-options { -fno-lto } } */ + +int weaks(int i) +{ + return i+1; +}