c-family: Fix ICE on attribute with -fgnu-tm [PR94733]
authorMarek Polacek <polacek@redhat.com>
Thu, 23 Apr 2020 18:38:58 +0000 (14:38 -0400)
committerMarek Polacek <polacek@redhat.com>
Thu, 23 Apr 2020 19:13:55 +0000 (15:13 -0400)
commit7291b2edf6f87fba839b0d10c04b2562a5f6bd60
treeff03733a96219eb6a43a0b985de63cdaf14a9fbe
parentbca558de2a24b2a78c6a321d6cec384e07759d77
c-family: Fix ICE on attribute with -fgnu-tm [PR94733]

find_tm_attribute was using TREE_PURPOSE to get the attribute name,
which is breaking now that we preserve the C++11-style attribute
format past decl_attributes.  So use get_attribute_name which can
handle both formats of attributes.

PR c++/94733
* c-attribs.c (find_tm_attribute): Use get_attribute_name instead of
TREE_PURPOSE.

* g++.dg/tm/attrib-5.C: New test.
gcc/c-family/ChangeLog
gcc/c-family/c-attribs.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tm/attrib-5.C [new file with mode: 0644]