]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR middle-end/54860 - Make sure attributes hash table is created
authorDodji Seketeli <dodji@redhat.com>
Wed, 10 Oct 2012 10:25:03 +0000 (10:25 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Wed, 10 Oct 2012 10:25:03 +0000 (12:25 +0200)
commitf739e97a835efea413749d5505cd64fe1d0ad922
tree2d29ef6bfdcbd1ad25cfc850c1e0cf2fe33e563e
parentd072812eb51d021d887430459b60a5b627eae7f3
PR middle-end/54860 - Make sure attributes hash table is created

On targets cris-elf, alpha and sparc (for instance) it can happen that
the attribute_tables variable is empty for fortran.  Thus
register_scoped_attributes (called by init_attributes) won't call
register_scoped_attributes, so the hash table member of
scoped_attributes is not created.

Later when we try to e.g, lookup an attribute by calling
lookup_scoped_attribute_spec, that NULL member hash table comes to
byte us as htab_find_with_hash crashes.

This patch fixes this by ensuring in register_scoped_attributes that
the hash table is created.

Tested on cris-elf, x86_64-unknown-linux-gnu against trunk and some
commenters on the bug bootstrapped it on alpha and sparc.

gcc/

* attribs.c (register_scoped_attributes): Ensure the attribute
hash table is created.

From-SVN: r192301
gcc/ChangeLog
gcc/attribs.c