Fixed a bug in expansion of array notations in if-statement conditions.
commitcc92dddcc1ccf36b35e2533f1b0a0fe418c67144
authorbviyer <bviyer@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Jun 2013 22:28:09 +0000 (3 22:28 +0000)
committerbviyer <bviyer@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Jun 2013 22:28:09 +0000 (3 22:28 +0000)
tree6714a569c16b57dd993b27c2763c4eb5a607bc3b
parenteddc63fdd079c88224537f35d257f8c75b618f4a
Fixed a bug in expansion of array notations in if-statement conditions.
2013-06-03  Balaji V. Iyer  <balaji.v.iyer@intel.com>

       * c-typeck.c (c_finish_if_stmt): Added a check to see if the rank of the
       condition of the if-statement matches the rank of else-block and then-
       block when array notations are used.
       * c-parser.c (c_parser_declaration_or_fndef): Expanded array notation
       expression after the entire function body is parsed.
       (c_parser_expr_no_commas): Delayed creating array notation expressions
       to the end of function parsing.
       * c-array-notation.c (fix_conditional_array_notations_1): Expanded the
       whole if-statement instead of just the condition.
       (expand_array_notation_exprs): Added MODIFY_EXPR case.

2013-06-03  Balaji V. Iyer  <balaji.v.iyer@intel.com>

       * c-c++-common/cilk-plus/AN/if_test_errors.c (main): New testcase.
       * c-c++-common/cilk-plus/AN/rank_mismatch.c: Added a '-w' option to
       dg-option and an header comment.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199628 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/c/ChangeLog
gcc/c/c-array-notation.c
gcc/c/c-parser.c
gcc/c/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/cilk-plus/AN/if_test_errors.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/cilk-plus/AN/rank_mismatch.c