diff options
author | Marek Polacek <polacek@redhat.com> | 2020-04-23 14:38:58 -0400 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2020-04-23 15:13:55 -0400 |
commit | 7291b2edf6f87fba839b0d10c04b2562a5f6bd60 (patch) | |
tree | ff03733a96219eb6a43a0b985de63cdaf14a9fbe /gcc/c-family | |
parent | bca558de2a24b2a78c6a321d6cec384e07759d77 (diff) |
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.
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-family/c-attribs.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 66f4873c3c2..55e6eb8ae45 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2020-04-23 Marek Polacek <polacek@redhat.com> + + PR c++/94733 + * c-attribs.c (find_tm_attribute): Use get_attribute_name instead of + TREE_PURPOSE. + 2020-04-14 Patrick Palka <ppalka@redhat.com> PR c++/85278 diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/c-attribs.c index 1483b3540dc..ac936d5bbbb 100644 --- a/gcc/c-family/c-attribs.c +++ b/gcc/c-family/c-attribs.c @@ -3314,7 +3314,7 @@ find_tm_attribute (tree list) { for (; list ; list = TREE_CHAIN (list)) { - tree name = TREE_PURPOSE (list); + tree name = get_attribute_name (list); if (tm_attr_to_mask (name) != 0) return name; } |