2016-05-24 Richard Biener <rguenther@suse.de>
commit7345b9778070c430dced973348ef2289e6038751
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 May 2016 07:55:56 +0000 (24 07:55 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 24 May 2016 07:55:56 +0000 (24 07:55 +0000)
tree8563bc5695a3444a499e0c3f237354120053f294
parenta9ef4ad6bfa4fdbc2e3833f162a2f2ae7c83b414
2016-05-24  Richard Biener  <rguenther@suse.de>

PR middle-end/70434
PR c/69504
c-family/
* c-common.h (convert_vector_to_pointer_for_subscript): Rename to ...
(convert_vector_to_array_for_subscript): ... this.
* c-common.c (convert_vector_to_pointer_for_subscript): Use a
VIEW_CONVERT_EXPR to an array type.  Rename to ...
(convert_vector_to_array_for_subscript): ... this.

cp/
* expr.c (mark_exp_read): Handle VIEW_CONVERT_EXPR.
* constexpr.c (cxx_eval_array_reference): Handle indexed
vectors.
* typeck.c (cp_build_array_ref): Adjust.

c/
* c-typeck.c (build_array_ref): Do not complain about indexing
non-lvalue vectors.  Adjust for function name change.

* tree-ssa.c (non_rewritable_mem_ref_base): Make sure to mark
bases which are accessed with non-invariant indices.
* gimple-fold.c (maybe_canonicalize_mem_ref_addr): Re-write
constant index ARRAY_REFs of vectors into BIT_FIELD_REFs.

* c-c++-common/vector-subscript-4.c: New testcase.
* c-c++-common/vector-subscript-5.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236630 138bc75d-0d04-0410-961f-82ee72b054a4
15 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c/ChangeLog
gcc/c/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/expr.c
gcc/cp/typeck.c
gcc/gimple-fold.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/vector-subscript-4.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/vector-subscript-5.c [new file with mode: 0644]
gcc/tree-ssa.c