re PR c/90760 (ICE on attributes section and alias in set_section, at symtab.c:1573)

PR c/90760
	* symtab.c (symtab_node::set_section): Allow being called on aliases
	as long as they aren't analyzed yet.

	* gcc.dg/pr90760.c: New test.

From-SVN: r272178
This commit is contained in:
Jakub Jelinek 2019-06-12 09:14:08 +02:00 committed by Jakub Jelinek
parent bfde1e2173
commit f3139680c3
4 changed files with 20 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2019-06-12 Jakub Jelinek <jakub@redhat.com>
PR c/90760
* symtab.c (symtab_node::set_section): Allow being called on aliases
as long as they aren't analyzed yet.
2019-06-11 Faraz Shahbazker <fshahbazker@wavecomp.com>
* config/mips/mips.c (mips_final_postscan_insn): Modify call

View File

@ -1583,7 +1583,7 @@ symtab_node::set_section (symtab_node *n, void *s)
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);
}

View File

@ -1,3 +1,8 @@
2019-06-12 Jakub Jelinek <jakub@redhat.com>
PR c/90760
* gcc.dg/pr90760.c: New test.
2019-06-11 Faraz Shahbazker <fshahbazker@wavecomp.com>
* gcc.target/mips/data-sym-pool.c: Update expected output.

View File

@ -0,0 +1,8 @@
/* PR c/90760 */
/* { dg-do compile } */
/* { dg-require-named-sections "" } */
void bar (void) {}
void foo (void) __attribute__ ((alias ("bar"))); /* { dg-error "section of alias 'foo' must match section of its target" } */
void foo (void) __attribute__ ((section ("baz")));
void qux (void) __attribute__ ((alias ("bar"), section ("baz"))); /* { dg-error "section of alias 'qux' must match section of its target" } */