diff options
author | kyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-01 16:54:27 +0000 |
---|---|---|
committer | kyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-01 16:54:27 +0000 |
commit | 3394c80c2e094ef217bb16d401593ab347b8f7d5 (patch) | |
tree | 6b22b92b1cb7eb59e88beb1c6e546153ce181301 /gcc/cp | |
parent | 33fba0d6d884cb52f0ab7009eda885a983642270 (diff) | |
download | gcc-3394c80c2e094ef217bb16d401593ab347b8f7d5.tar.gz |
PR middle-end/61455
gcc/c-family/
* array-notation-common.c (extract_array_notation_exprs): Handling
of DECL_EXPR added.
gcc/c/
* c-array-notation.c (expand_array_notations): Handling
of DECL_EXPR added.
gcc/cp/
* cp-array-notation.c (expand_array_notation_exprs): Handling of
DECL_EXPR improved. Changed handling for INIT_EXPR.
gcc/testsuite/
* c-c++-common/cilk-plus/AN/pr61455.c: New test.
* c-c++-common/cilk-plus/AN/pr61455-2.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213491 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/cp-array-notation.c | 23 |
2 files changed, 23 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 62e4fe49c6b..017ec514510 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-07-08 Igor Zamyatin <igor.zamyatin@intel.com> + + PR middle-end/61455 + * cp-array-notation.c (expand_array_notation_exprs): Handling of + DECL_EXPR improved. Changed handling for INIT_EXPR. + 2014-08-01 Paolo Carlini <paolo.carlini@oracle.com> * pt.c (lookup_template_class_1): Use DECL_TYPE_TEMPLATE_P. diff --git a/gcc/cp/cp-array-notation.c b/gcc/cp/cp-array-notation.c index b45449bc44d..31253ff7d07 100644 --- a/gcc/cp/cp-array-notation.c +++ b/gcc/cp/cp-array-notation.c @@ -1148,13 +1148,13 @@ expand_array_notation_exprs (tree t) case PARM_DECL: case NON_LVALUE_EXPR: case NOP_EXPR: - case INIT_EXPR: case ADDR_EXPR: case ARRAY_REF: case BIT_FIELD_REF: case VECTOR_CST: case COMPLEX_CST: return t; + case INIT_EXPR: case MODIFY_EXPR: if (contains_array_notation_expr (t)) t = expand_an_in_modify_expr (loc, TREE_OPERAND (t, 0), NOP_EXPR, @@ -1176,13 +1176,24 @@ expand_array_notation_exprs (tree t) return t; } case DECL_EXPR: - { - tree x = DECL_EXPR_DECL (t); - if (t && TREE_CODE (x) != FUNCTION_DECL) + if (contains_array_notation_expr (t)) + { + tree x = DECL_EXPR_DECL (t); if (DECL_INITIAL (x)) - t = expand_unary_array_notation_exprs (t); + { + location_t loc = DECL_SOURCE_LOCATION (x); + tree lhs = x; + tree rhs = DECL_INITIAL (x); + DECL_INITIAL (x) = NULL; + tree new_modify_expr = build_modify_expr (loc, lhs, + TREE_TYPE (lhs), + NOP_EXPR, + loc, rhs, + TREE_TYPE(rhs)); + t = expand_array_notation_exprs (new_modify_expr); + } + } return t; - } case STATEMENT_LIST: { tree_stmt_iterator i; |