https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90760

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I wonder if we couldn't do:
--- gcc/symtab.c.jj     2019-06-06 11:06:36.034399596 +0200
+++ gcc/symtab.c        2019-06-10 19:21:39.273909981 +0200
@@ -1583,7 +1583,7 @@ symtab_node::set_section (symtab_node *n
 void
 symtab_node::set_section (const char *section)
 {
-  gcc_assert (!this->alias);
+  gcc_assert (!this->alias || !this->analyzed);
   call_for_symbol_and_aliases
     (symtab_node::set_section, const_cast<char *>(section), true);
 }

i.e. allow setting the section name until the varpool node is actually
analyzed.
With that change
void bar (void) {}
void foo (void) __attribute__ ((alias ("bar")));
void foo (void) __attribute__ ((section ("baz")));
will no longer ICE, but will be rejected similarly to how
void bar (void) {}
void foo (void) __attribute__ ((alias ("bar"), section ("baz")));
is rejected (different section name for alias vs. what it aliases with).

Honza, your thoughts?

Reply via email to