re PR c/57474 (FAIL: c-c++-common/cilk-plus/AN/sec_implicit2?.c -fcilkplus (internal...
authorBalaji V. Iyer <balaji.v.iyer@intel.com>
Mon, 3 Jun 2013 21:07:54 +0000 (21:07 +0000)
committerBalaji V. Iyer <bviyer@gcc.gnu.org>
Mon, 3 Jun 2013 21:07:54 +0000 (14:07 -0700)
2013-06-03  Balaji V. Iyer  <balaji.v.iyer@intel.com>

       PR c/57474
       * c-array-notation.c (build_array_notation_expr): Initialized rhs_length
       array to NULL_TREE if they are unused.  Also added a check for the
       field to be NULL before its fields are used in future.

From-SVN: r199627

gcc/c/ChangeLog
gcc/c/c-array-notation.c

index d33fa2b96b3a0d4edd1b728126044cddca6ab0f9..437be919ec43607567fe8035a08bc23805779457 100644 (file)
@@ -1,3 +1,10 @@
+2013-06-03  Balaji V. Iyer  <balaji.v.iyer@intel.com>
+
+       PR c/57474
+       * c-array-notation.c (build_array_notation_expr): Initialized rhs_length
+       array to NULL_TREE if they are unused.  Also added a check for the
+       field to be NULL before its fields are used in future.
+       
 2013-05-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        PR bootstrap/57450
index bf139a855f2b6e4e1bd77b8759607db391ff2e85..080746625a61cafcdbf789e333d7d4fcd13a3dba 100644 (file)
@@ -1541,7 +1541,10 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
        }
       else
        for (jj = 0; jj < rhs_rank; jj++)
-         rhs_vector[ii][jj] = false;
+         { 
+           rhs_vector[ii][jj] = false;
+           rhs_length[ii][jj] = NULL_TREE;
+         }
     }
 
   if (length_mismatch_in_expr_p (EXPR_LOCATION (lhs), lhs_length,
@@ -1555,6 +1558,7 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
 
   if (lhs_list_size > 0 && rhs_list_size > 0 && lhs_rank > 0 && rhs_rank > 0
       && TREE_CODE (lhs_length[0][0]) == INTEGER_CST
+      && rhs_length[0][0]
       && TREE_CODE (rhs_length[0][0]) == INTEGER_CST)
     {
       HOST_WIDE_INT l_length = int_cst_value (lhs_length[0][0]);