alias.c (compare_base_decls): Use symtab_node::get.

gcc/
	* alias.c (compare_base_decls): Use symtab_node::get.

	gcc/testsuite/
	* gcc.dg/alias-15.c: New.

From-SVN: r232073
This commit is contained in:
Nathan Sidwell 2016-01-05 14:15:01 +00:00 committed by Nathan Sidwell
parent a2faef8e06
commit 929710d96c
4 changed files with 32 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2016-01-05 Nathan Sidwell <nathan@acm.org>
* alias.c (compare_base_decls): Use symtab_node::get.
2016-01-05 Nick Clifton <nickc@redhat.com>
PR target/68770

View File

@ -2044,8 +2044,15 @@ compare_base_decls (tree base1, tree base2)
|| !decl_in_symtab_p (base2))
return 0;
ret = symtab_node::get_create (base1)->equal_address_to
(symtab_node::get_create (base2), true);
/* Don't cause symbols to be inserted by the act of checking. */
symtab_node *node1 = symtab_node::get (base1);
if (!node1)
return 0;
symtab_node *node2 = symtab_node::get (base2);
if (!node2)
return 0;
ret = node1->equal_address_to (node2, true);
if (ret == 2)
return -1;
return ret;

View File

@ -1,3 +1,7 @@
2016-01-05 Nathan Sidwell <nathan@acm.org>
* gcc.dg/alias-15.c: New.
2016-01-05 Nick Clifton <nickc@redhat.com>
PR target/68870

View File

@ -0,0 +1,15 @@
/* { dg-do compile } */
/* { dg-additional-options "-O2 -fdump-ipa-cgraph" } */
/* RTL-level CSE shouldn't introduce LCO (for the string) into varpool */
char *p;
void foo ()
{
p = "abc\n";
while (*p != '\n')
p++;
}
/* { dg-final { scan-ipa-dump-not "LC0" "cgraph" } } */