PR c/88383 - ICE calling __builtin_has_attribute on a reference
authorMartin Sebor <msebor@redhat.com>
Fri, 12 Apr 2019 19:01:17 +0000 (19:01 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Fri, 12 Apr 2019 19:01:17 +0000 (13:01 -0600)
commit3fb82380dcbbc768e2a5bdb5ab4079259ee0e683
tree65f6424af90d819b32d06be37fadd150069dafa9
parent3d8695f529a41a639c6cc2a51cbcec7c8b243bc1
PR c/88383 - ICE calling __builtin_has_attribute on a reference

PR c/88383 - ICE calling __builtin_has_attribute on a reference
PR c/89288 - ICE in tree_code_size, at tree.c:865
PR c/89798 - excessive vector_size silently accepted and truncated
PR c/89797 - ICE on a vector_size (1LU << 33) int variable

gcc/ChangeLog:

PR c/89797
* targhooks.c (default_vector_alignment): Avoid assuming
argument fits in SHWI.
* tree.h (TYPE_VECTOR_SUBPARTS): Avoid sign overflow in
a shift expression.
* doc/extend.texi (__builtin_has_attribute): Add a clarifying note.

gcc/c-family/ChangeLog:

PR c/88383
PR c/89288
PR c/89798
PR c/89797
* c-attribs.c (type_valid_for_vector_size): Detect excessively
large sizes.
(validate_attribute): Handle DECLs and expressions.
(has_attribute): Handle types referenced by expressions.
Avoid considering array attributes in ARRAY_REF expressions .

gcc/cp/ChangeLog:

PR c/88383
PR c/89288
* parser.c (cp_parser_has_attribute_expression): Handle assignment
expressions.

gcc/testsuite/ChangeLog:

PR c/88383
PR c/89288
PR c/89798
PR c/89797
* c-c++-common/attributes-1.c: Adjust.
* c-c++-common/builtin-has-attribute-6.c: New test.
* c-c++-common/builtin-has-attribute-7.c: New test.
* c-c++-common/builtin-has-attribute-4.c: Adjust expectations.
* c-c++-common/builtin-has-attribute-6.c: New test.
* c-c++-common/pr71574.c: Adjust.
* gcc.dg/pr25559.c: Adjust.
* gcc.dg/attr-vector_size.c: New test.

From-SVN: r270326
13 files changed:
gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/targhooks.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/attributes-1.c
gcc/testsuite/c-c++-common/builtin-has-attribute-4.c
gcc/testsuite/c-c++-common/builtin-has-attribute-6.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/builtin-has-attribute-7.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/pr71574.c
gcc/testsuite/gcc.dg/attr-vector_size.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr25559.c
gcc/tree.h