This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [patch] cilkplus: Array notation for C patch
- From: "Iyer, Balaji V" <balaji dot v dot iyer at intel dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: 'Joseph Myers' <joseph at codesourcery dot com>, 'gcc-patches' <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 1 Apr 2013 21:10:44 +0000
- Subject: RE: [patch] cilkplus: Array notation for C patch
- References: <BF230D13CA30DD48930C31D40993300016D7FC87 at FMSMSX102 dot amr dot corp dot intel dot com> <BF230D13CA30DD48930C31D40993300016D800FE at FMSMSX102 dot amr dot corp dot intel dot com> <5159F5DA dot 90704 at redhat dot com>
> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> owner@gcc.gnu.org] 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?
Thanks,
Balaji V. Iyer.