re PR c++/79512 (ICE: Segfault in gimple_build_call_1, at gimple.c:218)

PR c++/79512
c/
	* c-parser.c (c_parser_omp_target): For -fopenmp-simd
	ignore #pragma omp target even when not followed by identifier.
cp/
	* parser.c (cp_parser_omp_target): For -fopenmp-simd
	ignore #pragma omp target even when not followed by identifier.
testsuite/
	* c-c++-common/gomp/pr79512.c: New test.

From-SVN: r245504
This commit is contained in:
Jakub Jelinek 2017-02-16 13:02:24 +01:00 committed by Jakub Jelinek
parent cc46a51d4f
commit bcac0b4dac
6 changed files with 41 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2017-02-16 Jakub Jelinek <jakub@redhat.com>
PR c++/79512
* c-parser.c (c_parser_omp_target): For -fopenmp-simd
ignore #pragma omp target even when not followed by identifier.
2017-02-14 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* gimpler-parser.c (c_parser_gimple_statement): Handle ABS_EXPR.

View File

@ -16505,6 +16505,11 @@ c_parser_omp_target (c_parser *parser, enum pragma_context context, bool *if_p)
return c_parser_omp_target_update (loc, parser, context);
}
}
if (!flag_openmp) /* flag_openmp_simd */
{
c_parser_skip_to_pragma_eol (parser, false);
return false;
}
stmt = make_node (OMP_TARGET);
TREE_TYPE (stmt) = void_type_node;

View File

@ -1,3 +1,9 @@
2017-02-16 Jakub Jelinek <jakub@redhat.com>
PR c++/79512
* parser.c (cp_parser_omp_target): For -fopenmp-simd
ignore #pragma omp target even when not followed by identifier.
2017-02-15 Jason Merrill <jason@redhat.com>
Jakub Jelinek <jakub@redhat.com>

View File

@ -35981,6 +35981,11 @@ cp_parser_omp_target (cp_parser *parser, cp_token *pragma_tok,
return cp_parser_omp_target_update (parser, pragma_tok, context);
}
}
if (!flag_openmp) /* flag_openmp_simd */
{
cp_parser_skip_to_pragma_eol (parser, pragma_tok);
return false;
}
stmt = make_node (OMP_TARGET);
TREE_TYPE (stmt) = void_type_node;

View File

@ -1,3 +1,8 @@
2017-02-16 Jakub Jelinek <jakub@redhat.com>
PR c++/79512
* c-c++-common/gomp/pr79512.c: New test.
2017-02-15 Martin Sebor <msebor@redhat.com>
PR c++/79363

View File

@ -0,0 +1,14 @@
/* PR c++/79512 */
/* { dg-options "-fopenmp-simd" } */
void
foo (void)
{
#pragma omp target
#pragma omp teams
{
int i;
for (i = 0; i < 10; i++)
;
}
}