On 03/29/13 16:57, Iyer, Balaji V wrote:

+bool
+find_rank (location_t loc, tree orig_expr, tree array, bool ignore_builtin_fn,
+          size_t *rank)
+{
+  tree ii_tree;

Balaji, I believe what Joseph meant with saving the location_t is so we can give meaningful error messages when encountering tests like this (distilled from one of the tests you added):

houston:/build/cilkplus-merge1/gcc$ cat a.c
int array[10][10];
int array2[10];

void foo()
{
  array[:][:] = array2[:];
}

Currently we are issuing this error:

houston:/build/cilkplus-merge1/gcc$ ./cc1 a.c -fcilkplus -quiet
a.c: In function 'foo':
a.c:6:15: error: rank mismatch between 'array' and 'array2'
   array[:][:] = array2[:];
               ^

Ideally, we should issue something like (notice the carets):

error: rank mismatch between 'array' and 'array2'
   array[:][:] = array2[:];
                        ^
note: original mismatching rank at:
   array[:][:] = array2[:];
         ^

Or something similar... the note can be emitted with inform(). So you need to save the original rank location to emit the note.

Reply via email to