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: PR c/65586: Skipping omp pragmas with -fopenmp-simd


On Fri, Mar 27, 2015 at 10:58:14AM +0100, Tobias Burnus wrote:
> For -fopenmp-simd, GCC did not properly jump passed the clauses of
> ignored directives. It worked, for "for simd" directives and for
> those without clauses.
> 
> Bootstrapped and regtested on x86-64-gnu-linux.
> OK for the trunk?
> 
> Tobias

> +  while (true)
> +    {
> +      c_token *token = c_parser_peek_token (parser);
> +      if (token->type == CPP_EOF)
> +	break;
> +      if (token->type == CPP_PRAGMA_EOL)
> +	{
> +	  c_parser_consume_token (parser);
>  	  break;
> -	if (token->type == CPP_PRAGMA_EOL)
> -	  {
> -	    c_parser_consume_token (parser);
> -	    break;
> -	  }
> -	c_parser_consume_token (parser);
> -      }
> +	}
> +      c_parser_consume_token (parser);
> +    }

Can't you use

  cpp_ttype token_type;
  do
    {
      c_token *token = c_parser_peek_token (parser);
      token_type = token->type;
      if (token_type == CPP_EOF)
	break;
      c_parser_consume_token (parser);
    }
  while (token_type != CPP_PRAGMA_EOL);

instead?

Ok either way.

	Jakub


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