aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2020-03-01 17:58:45 -0700
committerMartin Sebor <msebor@redhat.com>2020-03-01 17:58:45 -0700
commit649e174102a8ae2d570616d09aa336b712e1baae (patch)
tree0a9d51cdfc11c504a79a9f42d59f35f97847f62e /gcc/calls.c
parent726e292d410fc29812a95eb6d88a2ceb82d9080d (diff)
downloadgcc-649e174102a8ae2d570616d09aa336b712e1baae.zip
gcc-649e174102a8ae2d570616d09aa336b712e1baae.tar.gz
gcc-649e174102a8ae2d570616d09aa336b712e1baae.tar.bz2
PR middle-end/92721 - checking ICE on attribute access redeclaration
gcc/c-family/ChangeLog: PR c++/92721 * c-attribs.c (append_access_attrs): Correctly handle attribute. (handle_access_attribute): Same. gcc/ChangeLog: PR c++/92721 * calls.c (init_attr_rdwr_indices): Correctly handle attribute. gcc/testsuite/ChangeLog: PR c++/92721 g++.dg/ext/attr-access.C: New test.
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index d1c5317..4c3a8f3 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1891,8 +1891,13 @@ init_attr_rdwr_indices (rdwr_map *rwm, tree fntype)
if (!access)
return;
+ /* The TREE_VALUE of an attribute is a TREE_LIST whose TREE_VALUE
+ is the attribute argument's value. */
tree mode = TREE_VALUE (access);
+ gcc_assert (TREE_CODE (mode) == TREE_LIST);
+ mode = TREE_VALUE (mode);
gcc_assert (TREE_CODE (mode) == STRING_CST);
+
const char *modestr = TREE_STRING_POINTER (mode);
for (const char *m = modestr; *m; )
{