re PR target/80162 (ICE on invalid code (address of register variable))
authorJakub Jelinek <jakub@redhat.com>
Mon, 27 Mar 2017 21:07:21 +0000 (23:07 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 27 Mar 2017 21:07:21 +0000 (23:07 +0200)
commita9e4a1a56fb8e99594b65d6640432ba29c705f3e
tree2a71ba738ce8094ef17accb652eb7b850caad814
parentaade772d8a2eeda4ea22f0ca648ebdf44d8d8c15
re PR target/80162 (ICE on invalid code (address of register variable))

PR middle-end/80162
c-family/
* c-common.c (c_common_mark_addressable_vec): Don't set
TREE_ADDRESSABLE on DECL_HARD_REGISTER.
c/
* c-tree.h (c_mark_addressable): Add array_ref_p argument.
* c-typeck.c (c_mark_addressable): Likewise.  Look through
VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
to ARRAY_TYPE.
(build_array_ref): Pass true as array_ref_p to c_mark_addressable.
cp/
* cp-tree.h (cxx_mark_addressable): Add array_ref_p argument.
* typeck.c (cxx_mark_addressable): Likewise.  Look through
VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE
to ARRAY_TYPE.
(cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable.
testsuite/
* c-c++-common/pr80162-1.c: New test.
* c-c++-common/pr80162-2.c: New test.
* c-c++-common/pr80162-3.c: New test.

From-SVN: r246512
12 files changed:
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c/ChangeLog
gcc/c/c-tree.h
gcc/c/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/pr80162-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/pr80162-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/pr80162-3.c [new file with mode: 0644]