[patch] cilkplus array notation for C (clean, independent patchset, take 1)

Iyer, Balaji V balaji.v.iyer@intel.com
Wed Mar 20 22:28:00 GMT 2013


HI Aldy, Joseph et al.,
	Attached, please find a fixed patch. Please see my responses to Aldy's questions below:

> -----Original Message-----
> From: Aldy Hernandez [mailto:aldyh@redhat.com]
> Sent: Wednesday, March 20, 2013 12:33 PM
> To: Joseph S. Myers
> Cc: Iyer, Balaji V; gcc-patches
> Subject: Re: [patch] cilkplus array notation for C (clean, independent patchset,
> take 1)
> 
> On 03/20/13 10:30, Aldy Hernandez wrote:
> >
> > I have found some little nits that I will point out in a reply to this
> > message.
> >
> > Joseph, folks, et al... How does this look?
> >
> > Thanks.
> 
> Balaji:
> 
> > +void
> > +array_notation_init_builtins (void)
> > +{
> > +  tree func_type = NULL_TREE;
> > +  tree new_func = NULL_TREE;
> > +  func_type = build_function_type_list (integer_type_node, ptr_type_node,
> > +					NULL_TREE);
> > +  new_func = build_fn_decl ("__sec_reduce_add", func_type);
> > +  mark_cold (new_func);
> > +  new_func = lang_hooks.decls.pushdecl (new_func);
> etc
> etc
> 
> All these builtins need to be documented in doc/.

DONE!


> 
> > +load_lib gcc-dg.exp
> > +
> > +dg-init
> > +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] " -fcilkplus" " "
> > +dg-finish
> > +
> > +dg-init
> > +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] " -O0 -fcilkplus" " "
> > +dg-finish
> > +
> > +dg-init
> > +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] " -O1 -fcilkplus" " "
> > +dg-finish
> etc
> etc
> 
> Can't you do all these dg-runtest's within one pair of dg-init/dg-finish?  Similarly
> for the other .exp files.

The reason why I did these is so that we can easily isolate the errors to one run if necessary. I fixed them as you requested.

> 
> As I'd mentioned, you have .exp files named compile.exp and execute.exp which
> seem to be causing ambiguity problems in parallel checks (make check -jN).  For
> some reason, with this patch, the rest of dg.exp fails to run after Cilkplus'
> compile/execute.exp runs.  Renaming these to something less generic does the
> trick.  Do you mind prefixing all the .exp's with "cilkplus_" or something similar?

FIXED! I added the "cilkplus_AN_c_" prefix to everything, where "an" stands for Array Notation . This way it won't interfere with the future Cilk Plus patches' test case.

> 
> [Perhaps someone can pontificate as to what the actual problem is here and
> describe it.  Dejagnu is a mystery to me.]
> 
> > diff --git
> > a/gcc/testsuite/gcc.dg/cilk-plus/array_notation/errors/errors.exp
> > b/gcc/testsuite/gcc.dg/cilk-plus/array_notation/errors/errors.exp
> > new file mode 100644
> > index 0000000..6d7604b
> > --- /dev/null
> > +++ b/gcc/testsuite/gcc.dg/cilk-plus/array_notation/errors/errors.exp
> > @@ -0,0 +1,65 @@
> > +#   Copyright (C) 2013 Free Software Foundation, Inc.
> > +
> > +# This program is free software; you can redistribute it and/or
> > +modify # it under the terms of the GNU General Public License as
> > +published by # the Free Software Foundation; either version 3 of the
> > +License, or # (at your option) any later version.
> > +#
> > +# This program is distributed in the hope that it will be useful, #
> > +but WITHOUT ANY WARRANTY; without even the implied warranty of #
> > +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the # GNU
> > +General Public License for more details.
> > +#
> > +# You should have received a copy of the GNU General Public License #
> > +along with GCC; see the file COPYING3.  If not see #
> > +<http://www.gnu.org/licenses/>.
> > +
> > +# Written by Balaji V. Iyer <balaji.v.iyer@intel.com>
> > +
> > +
> > +load_lib gcc-dg.exp
> > +
> > +dg-init
> > +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] " -fcilkplus" " "
> > +dg-finish
> > +
> > +dg-init
> > +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] " -O0 -fcilkplus" " "
> > +dg-finish
> > +
> > +dg-init
> > +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] " -O1 -fcilkplus" " "
> > +dg-finish
> 
> If these are mere syntax error tests, I suggest you get rid of all the optimization
> variants.  Surely there is no need to test the error at -O, then at -O2, etc.  -O0
> should suffice.  For that matter, you shouldn't pass any optimization flag and let
> the test itself set the flags with "// dg-options" or whatever in the test itself (if
> for some reason you have a test that has one particular error only reportable at
> some optimization level).

I did this purely as a safety measure for the commonly used flags that I know of. If it won't cause too much of a problem I would like to keep it.

> 
> And please make sure there are no regressions on the branch when checking
> with "make check -k -jN" (N > 1) and for a plain serial check-- at least while we
> iron out this dejagnu setup.

It works for make -j8 check on my 8 core machine.

Thanks,

Balaji V. Iyer.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130320/62b4d87c/attachment.txt>


More information about the Gcc-patches mailing list