This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [patch] cilkplus: Array notation for C patch

> -----Original Message-----
> From: [mailto:gcc-patches-
>] On Behalf Of Aldy Hernandez
> Sent: Monday, April 01, 2013 5:02 PM
> To: Iyer, Balaji V
> Cc: 'Joseph Myers'; 'gcc-patches'
> Subject: Re: [patch] cilkplus: Array notation for C patch
> 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[:];
>                          ^

OK, I understand it a bit better now. Please let me know if I am mistaken here:

 We need to do EXPR_LOCATION (array2) and then issue the error....

> 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.

...and we take the location information in "loc" and print that out in inform?

Did I get it right?


Balaji V. Iyer.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]