From: bviyer Date: Fri, 7 Jun 2013 22:16:24 +0000 (+0000) Subject: Fixed PR 57541. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bfc83720d5f8d8dbd1caf3d484312cd461e366cc;p=thirdparty%2Fgcc.git Fixed PR 57541. gcc/c/ChangeLog 2013-06-07 Balaji V. Iyer * c-array-notation.c (expand_array_notation_exprs): Added ARRAY_NOTATION_REF case. gcc/testsuite/ChangeLog 2013-06-07 Balaji V. Iyer PR middle-end/57541 * c-c++-common/cilk-plus/AN/pr57541.c: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199837 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 7f5b5a9f0fff..5fbb31f8aca1 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,8 @@ +2013-06-07 Balaji V. Iyer + + * c-array-notation.c (expand_array_notation_exprs): Added + ARRAY_NOTATION_REF case. + 2013-06-07 Balaji V. Iyer * c-array-notation.c (length_mismatch_in_expr_p): Moved this diff --git a/gcc/c/c-array-notation.c b/gcc/c/c-array-notation.c index 7b13687342a0..b1040da0cc77 100644 --- a/gcc/c/c-array-notation.c +++ b/gcc/c/c-array-notation.c @@ -2317,6 +2317,14 @@ expand_array_notation_exprs (tree t) case RETURN_EXPR: if (contains_array_notation_expr (t)) t = fix_return_expr (t); + return t; + case ARRAY_NOTATION_REF: + /* IF we are here, then we are dealing with cases like this: + A[:]; + A[x:y:z]; + A[x:y]; + Replace those with just void zero node. */ + t = void_zero_node; default: return t; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dce1515118a0..55a3ce6d1acb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-06-07 Balaji V. Iyer + + PR middle-end/57541 + * c-c++-common/cilk-plus/AN/pr57541.c: New test case. + 2013-06-07 Jan Hubicka * gcc.dg/tree-ssa/attr-alias.c: Remove brackets in template. diff --git a/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c new file mode 100755 index 000000000000..cabdb2376e61 --- /dev/null +++ b/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-fcilkplus" } */ + +int A[10]; + +int main () { + char c = (char)N; /* { dg-error "undeclared" } */ + short s = (short)N; + long l = (long)N; + A[l:s:c]; +} + +/* { dg-message "note: each" "defined" { target *-*-* } 7 } */ +