diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-family/array-notation-common.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/cilk-plus/AN/pr61962.c | 14 |
4 files changed, 29 insertions, 1 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index e71f6ed..269c6a1 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2014-08-12 Igor Zamyatin <igor.zamyatin@intel.com> + + PR other/61962 + * array-notation-common.c (find_rank): Added handling for other + types of references. + 2014-08-10 Marek Polacek <polacek@redhat.com> PR c/51849 diff --git a/gcc/c-family/array-notation-common.c b/gcc/c-family/array-notation-common.c index 84f6f45..f8bce04 100644 --- a/gcc/c-family/array-notation-common.c +++ b/gcc/c-family/array-notation-common.c @@ -221,11 +221,14 @@ find_rank (location_t loc, tree orig_expr, tree expr, bool ignore_builtin_fn, current_rank++; ii_tree = ARRAY_NOTATION_ARRAY (ii_tree); } - else if (TREE_CODE (ii_tree) == ARRAY_REF) + else if (handled_component_p (ii_tree) + || TREE_CODE (ii_tree) == INDIRECT_REF) ii_tree = TREE_OPERAND (ii_tree, 0); else if (TREE_CODE (ii_tree) == PARM_DECL || TREE_CODE (ii_tree) == VAR_DECL) break; + else + gcc_unreachable (); } if (*rank == 0) /* In this case, all the expressions this function has encountered thus diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 70d0653..260013b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-08-12 Igor Zamyatin <igor.zamyatin@intel.com> + + PR other/61962 + * c-c++-common/cilk-plus/AN/pr61962.c: New test. + 2014-08-12 Thomas Preud'homme <thomas.preudhomme@arm.com> PR middle-end/62103 diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61962.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61962.c new file mode 100644 index 0000000..08d4fe2 --- /dev/null +++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61962.c @@ -0,0 +1,14 @@ +/* PR other/61962 */ +/* { dg-do compile } */ +/* { dg-options "-fcilkplus" } */ + +struct FloatStruct +{ + float *f; +}; + +/* Either SRC or DST must be a struct, otherwise the bug does not occur. */ +void f (struct FloatStruct* dst, float *src, unsigned int length) +{ + dst->f[0:length] = src[0:length]; +} |