This is the mail archive of the gcc-patches@gcc.gnu.org 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: [gomp4] Fix combined directives.


On Mon, Oct 27, 2014 at 01:00:41PM -0500, James Norris wrote:
>      2014-10-27  James Norris<jnorris@codesourcery.com>

Missing two spaces before <.

>          * c/c-parser.c (c_parser_oacc_loop, OACC_LOOP_CLAUSE_MASK):

Note, gcc/c/ directory has its own ChangeLog, so the c/ prefix doesn't
belong into ChangeLog entries.

> +#define OACC_LOOP_CLAUSE_MASK						\
> +	( (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_COLLAPSE)		\
> +	| (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_REDUCTION) )
> +
> +static tree
> +c_parser_oacc_loop (location_t loc, c_parser *parser, char *p_name)
> +{
> +  tree stmt, clauses, block;
> +
> +  strcat (p_name, " loop");
> +
> +  clauses = c_parser_oacc_all_clauses (parser, OACC_LOOP_CLAUSE_MASK, p_name);

I must say I'm quite surprised that you hardcode the mask here, can loop
never be combined with acc parallel?  Look what I'm doing for OpenMP
constructs?

> +      if (!strcmp ("loop", IDENTIFIER_POINTER (stmt)))
>  	{
> +	  mask |= OACC_LOOP_CLAUSE_MASK;
> +	  strcat (p_name, " loop");
>  	  c_parser_consume_token (parser);
> -	  block = c_begin_omp_parallel ();
> -	  c_parser_oacc_loop (loc, parser, p_name);
> -	  stmt = c_finish_oacc_kernels (loc, clauses, block);
> -	  OACC_KERNELS_COMBINED (stmt) = 1;
> -	  return stmt;
> +	  is_combined = true;
>  	}
>      }
>  
> -  clauses =  c_parser_oacc_all_clauses (parser, OACC_KERNELS_CLAUSE_MASK,
> -					p_name);
> +  clauses =  c_parser_oacc_all_clauses (parser, mask, p_name);

Doesn't this really mean that you don't parse the the loop as loop?

Also, please avoid the extra space in "=  c_...".

	Jakub


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