From d5c23c6ceacf666f218676b648801379044e326a Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Fri, 10 Jan 2020 16:08:41 +0100 Subject: =?UTF-8?q?OpenACC=20=E2=80=93=20support=20"if"=20+=20"if=5Fpresen?= =?UTF-8?q?t"=20clauses=20with=20"host=5Fdata"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2020-01-10 Gergö Barany Thomas Schwinge Julian Brown Tobias Burnus gcc/c/ * c-parser.c (OACC_HOST_DATA_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_IF and PRAGMA_OACC_CLAUSE_IF_PRESENT. gcc/cp/ * parser.c (OACC_HOST_DATA_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_IF and PRAGMA_OACC_CLAUSE_IF_PRESENT. gcc/fortran/ * openmp.c (OACC_HOST_DATA_CLAUSES): Add PRAGMA_OACC_CLAUSE_IF and PRAGMA_OACC_CLAUSE_IF_PRESENT. gcc/ * omp-low.c (lower_omp_target): Use GOMP_MAP_USE_DEVICE_PTR_IF_PRESENT if PRAGMA_OACC_CLAUSE_IF_PRESENT exist. gcc/testsuite/ * c-c++-common/goacc/host_data-1.c: Added tests of if and if_present clauses on host_data. * gfortran.dg/goacc/host_data-tree.f95: Likewise. include/ * gomp-constants.h (enum gomp_map_kind): New enumeration constant GOMP_MAP_USE_DEVICE_PTR_IF_PRESENT. libgomp/ * oacc-parallel.c (GOACC_data_start): Handle GOMP_MAP_USE_DEVICE_PTR_IF_PRESENT. * target.c (gomp_map_vars_async): Likewise. * testsuite/libgomp.oacc-c-c++-common/host_data-7.c: New. * testsuite/libgomp.oacc-fortran/host_data-5.F90: New. From-SVN: r280115 --- gcc/c/c-parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index ea06069..bf9e3e0 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -16701,7 +16701,9 @@ c_parser_oacc_enter_exit_data (c_parser *parser, bool enter) */ #define OACC_HOST_DATA_CLAUSE_MASK \ - ( (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_USE_DEVICE) ) + ( (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_USE_DEVICE) \ + | (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_IF) \ + | (OMP_CLAUSE_MASK_1 << PRAGMA_OACC_CLAUSE_IF_PRESENT) ) static tree c_parser_oacc_host_data (location_t loc, c_parser *parser, bool *if_p) -- cgit v1.1 From 852f0ae80555238c425e33f98df5c7077694bd9f Mon Sep 17 00:00:00 2001 From: Kerem Kat Date: Thu, 16 Jan 2020 23:42:11 +0000 Subject: Fix ICE caused by swallowing a token in c_parser_consume_token This patch fixes ICE on invalid code, specifically files that have conflict-marker-like signs before EOF. PR c/92833 gcc/c/ * c-parser.c (c_parser_consume_token): Fix peeked token stack pop to support 4 available tokens. gcc/testsuite/ * c-c++-common/pr92833-1.c, c-c++-common/pr92833-2.c, c-c++-common/pr92833-3.c, c-c++-common/pr92833-4.c: New tests. --- gcc/c/c-parser.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index bf9e3e0..6164017 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -846,7 +846,11 @@ c_parser_consume_token (c_parser *parser) { parser->tokens[0] = parser->tokens[1]; if (parser->tokens_avail >= 3) - parser->tokens[1] = parser->tokens[2]; + { + parser->tokens[1] = parser->tokens[2]; + if (parser->tokens_avail >= 4) + parser->tokens[2] = parser->tokens[3]; + } } parser->tokens_avail--; } -- cgit v1.1 From f9eb0973edb2b4eed4cdbba7105b8af7afe5b547 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 30 Jan 2020 14:09:41 -0700 Subject: Mark switch expression as used to avoid bogus warning PR c/88660 * c-parser.c (c_parser_switch_statement): Make sure to request marking the switch expr as used. PR c/88660 * gcc.dg/pr88660.c: New test. --- gcc/c/c-parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 6164017..1e8f2f7 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -6607,7 +6607,7 @@ c_parser_switch_statement (c_parser *parser, bool *if_p) && c_token_starts_typename (c_parser_peek_2nd_token (parser))) explicit_cast_p = true; ce = c_parser_expression (parser); - ce = convert_lvalue_to_rvalue (switch_cond_loc, ce, true, false); + ce = convert_lvalue_to_rvalue (switch_cond_loc, ce, true, true); expr = ce.value; /* ??? expr has no valid location? */ parens.skip_until_found_close (parser); -- cgit v1.1 From 9def91e9f2a7051c9c146f16c1a10d1b25d33b47 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 19 Mar 2020 22:56:20 +0100 Subject: c: Fix up cfun->function_end_locus from the C FE [PR94029] On the following testcase we ICE because while DECL_STRUCT_FUNCTION (current_function_decl)->function_start_locus = c_parser_peek_token (parser)->location; and similarly DECL_SOURCE_LOCATION (fndecl) is set from some token's location, the end is set as: /* Store the end of the function, so that we get good line number info for the epilogue. */ cfun->function_end_locus = input_location; and the thing is that input_location is only very rarely set in the C FE (the primary spot that changes it is the cb_line_change/fe_file_change). Which means, e.g. for pretty much all C functions that are on a single line, function_start_locus column is > than function_end_locus column, and the testcase even has smaller line in function_end_locus because cb_line_change isn't performed while parsing multi-line arguments of a function-like macro. Attached are two possible fixes to achieve what the C++ FE does, in particular that cfun->function_end_locus is the locus of the closing } of the function. The first one updates input_location when we see a closing } of a compound statement (though any, not just the function body) and thus input_location in the finish_function call is what we need. The second instead propagates the location_t from the parsing of the outermost compound statement (the function body) to finish_function. The second one is this version. 2020-03-19 Jakub Jelinek PR gcov-profile/94029 * c-tree.h (finish_function): Add location_t argument defaulted to input_location. * c-parser.c (c_parser_compound_statement): Add endlocp argument and set it to the locus of closing } if non-NULL. (c_parser_compound_statement_nostart): Return locus of closing }. (c_parser_parse_rtl_body): Likewise. (c_parser_declaration_or_fndef): Propagate locus of closing } to finish_function. * c-decl.c (finish_function): Add end_loc argument, use it instead of input_location to set function_end_locus. * gcc.misc-tests/gcov-pr94029.c: New test. --- gcc/c/c-parser.c | 51 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 21 deletions(-) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 1e8f2f7..4b068a9 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -1487,8 +1487,8 @@ static struct c_expr c_parser_braced_init (c_parser *, tree, bool, static void c_parser_initelt (c_parser *, struct obstack *); static void c_parser_initval (c_parser *, struct c_expr *, struct obstack *); -static tree c_parser_compound_statement (c_parser *); -static void c_parser_compound_statement_nostart (c_parser *); +static tree c_parser_compound_statement (c_parser *, location_t * = NULL); +static location_t c_parser_compound_statement_nostart (c_parser *); static void c_parser_label (c_parser *); static void c_parser_statement (c_parser *, bool *, location_t * = NULL); static void c_parser_statement_after_labels (c_parser *, bool *, @@ -1583,8 +1583,7 @@ static void c_parser_objc_at_synthesize_declaration (c_parser *); static void c_parser_objc_at_dynamic_declaration (c_parser *); static bool c_parser_objc_diagnose_bad_element_prefix (c_parser *, struct c_declspecs *); - -static void c_parser_parse_rtl_body (c_parser *parser, char *start_with_pass); +static location_t c_parser_parse_rtl_body (c_parser *, char *); /* Parse a translation unit (C90 6.7, C99 6.9, C11 6.9). @@ -2472,12 +2471,13 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, c_finish_oacc_routine (oacc_routine_data, current_function_decl, true); DECL_STRUCT_FUNCTION (current_function_decl)->function_start_locus = c_parser_peek_token (parser)->location; + location_t endloc; /* If the definition was marked with __RTL, use the RTL parser now, consuming the function body. */ if (specs->declspec_il == cdil_rtl) { - c_parser_parse_rtl_body (parser, specs->gimple_or_rtl_pass); + endloc = c_parser_parse_rtl_body (parser, specs->gimple_or_rtl_pass); /* Normally, store_parm_decls sets next_is_function_body, anticipating a function body. We need a push_scope/pop_scope @@ -2486,7 +2486,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, push_scope (); pop_scope (); - finish_function (); + finish_function (endloc); return; } /* If the definition was marked with __GIMPLE then parse the @@ -2499,9 +2499,11 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, specs->declspec_il, specs->entry_bb_count); in_late_binary_op = saved; + struct function *fun = DECL_STRUCT_FUNCTION (current_function_decl); + endloc = fun->function_start_locus; } else - fnbody = c_parser_compound_statement (parser); + fnbody = c_parser_compound_statement (parser, &endloc); tree fndecl = current_function_decl; if (nested) { @@ -2512,7 +2514,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, by initializer_constant_valid_p. See gcc.dg/nested-fn-2.c. */ DECL_STATIC_CHAIN (decl) = 1; add_stmt (fnbody); - finish_function (); + finish_function (endloc); c_pop_function_context (); add_stmt (build_stmt (DECL_SOURCE_LOCATION (decl), DECL_EXPR, decl)); } @@ -2520,7 +2522,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, { if (fnbody) add_stmt (fnbody); - finish_function (); + finish_function (endloc); } /* Get rid of the empty stmt list for GIMPLE/RTL. */ if (specs->declspec_il != cdil_none) @@ -5599,7 +5601,7 @@ c_parser_initval (c_parser *parser, struct c_expr *after, cancellation-point-directive */ static tree -c_parser_compound_statement (c_parser *parser) +c_parser_compound_statement (c_parser *parser, location_t *endlocp) { tree stmt; location_t brace_loc; @@ -5613,7 +5615,9 @@ c_parser_compound_statement (c_parser *parser) return error_mark_node; } stmt = c_begin_compound_stmt (true); - c_parser_compound_statement_nostart (parser); + location_t end_loc = c_parser_compound_statement_nostart (parser); + if (endlocp) + *endlocp = end_loc; return c_end_compound_stmt (brace_loc, stmt, true); } @@ -5622,7 +5626,7 @@ c_parser_compound_statement (c_parser *parser) used for parsing both compound statements and statement expressions (which follow different paths to handling the opening). */ -static void +static location_t c_parser_compound_statement_nostart (c_parser *parser) { bool last_stmt = false; @@ -5631,9 +5635,10 @@ c_parser_compound_statement_nostart (c_parser *parser) location_t label_loc = UNKNOWN_LOCATION; /* Quiet warning. */ if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE)) { - add_debug_begin_stmt (c_parser_peek_token (parser)->location); + location_t endloc = c_parser_peek_token (parser)->location; + add_debug_begin_stmt (endloc); c_parser_consume_token (parser); - return; + return endloc; } mark_valid_location_for_stdc_pragma (true); if (c_parser_next_token_is_keyword (parser, RID_LABEL)) @@ -5674,8 +5679,9 @@ c_parser_compound_statement_nostart (c_parser *parser) { mark_valid_location_for_stdc_pragma (save_valid_for_pragma); c_parser_error (parser, "expected declaration or statement"); + location_t endloc = c_parser_peek_token (parser)->location; c_parser_consume_token (parser); - return; + return endloc; } while (c_parser_next_token_is_not (parser, CPP_CLOSE_BRACE)) { @@ -5773,7 +5779,7 @@ c_parser_compound_statement_nostart (c_parser *parser) { mark_valid_location_for_stdc_pragma (save_valid_for_pragma); c_parser_error (parser, "expected declaration or statement"); - return; + return c_parser_peek_token (parser)->location; } else if (c_parser_next_token_is_keyword (parser, RID_ELSE)) { @@ -5781,7 +5787,7 @@ c_parser_compound_statement_nostart (c_parser *parser) { mark_valid_location_for_stdc_pragma (save_valid_for_pragma); error_at (loc, "expected %<}%> before %"); - return; + return c_parser_peek_token (parser)->location; } else { @@ -5804,9 +5810,11 @@ c_parser_compound_statement_nostart (c_parser *parser) } if (last_label) error_at (label_loc, "label at end of compound statement"); + location_t endloc = c_parser_peek_token (parser)->location; c_parser_consume_token (parser); /* Restore the value we started with. */ mark_valid_location_for_stdc_pragma (save_valid_for_pragma); + return endloc; } /* Parse all consecutive labels, possibly preceded by standard @@ -21725,13 +21733,13 @@ c_parse_file (void) Take ownership of START_WITH_PASS, if non-NULL. */ -void +location_t c_parser_parse_rtl_body (c_parser *parser, char *start_with_pass) { if (!c_parser_require (parser, CPP_OPEN_BRACE, "expected %<{%>")) { free (start_with_pass); - return; + return c_parser_peek_token (parser)->location; } location_t start_loc = c_parser_peek_token (parser)->location; @@ -21753,7 +21761,7 @@ c_parser_parse_rtl_body (c_parser *parser, char *start_with_pass) case CPP_EOF: error_at (start_loc, "no closing brace"); free (start_with_pass); - return; + return c_parser_peek_token (parser)->location; default: break; } @@ -21771,12 +21779,13 @@ c_parser_parse_rtl_body (c_parser *parser, char *start_with_pass) if (!read_rtl_function_body_from_file_range (start_loc, end_loc)) { free (start_with_pass); - return; + return end_loc; } /* Run the backend on the cfun created above, transferring ownership of START_WITH_PASS. */ run_rtl_passes (start_with_pass); + return end_loc; } #include "gt-c-c-parser.h" -- cgit v1.1 From 5db9e89323cd0a0be16a94f2f984121531ea7772 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 23 Mar 2020 19:44:58 +0100 Subject: c: Fix up cfun->function_end_locus on invalid function bodies [PR94239] Unfortunately the patch broke +FAIL: gcc.dg/pr20245-1.c (internal compiler error) +FAIL: gcc.dg/pr20245-1.c (test for excess errors) +FAIL: gcc.dg/pr28419.c (internal compiler error) +FAIL: gcc.dg/pr28419.c (test for excess errors) on some targets (and under valgrind on the rest of them). Those functions don't have the opening { and so c_parser_compound_statement returned error_mark_node before initializing *endlocp. So, either we can initialize it in that case too: --- gcc/c/c-parser.c 2020-03-20 22:09:39.659411721 +0100 +++ gcc/c/c-parser.c 2020-03-21 09:36:44.455705261 +0100 @@ -5611,6 +5611,8 @@ c_parser_compound_statement (c_parser *p if we have just prepared to enter a function body. */ stmt = c_begin_compound_stmt (true); c_end_compound_stmt (brace_loc, stmt, true); + if (endlocp) + *endlocp = brace_loc; return error_mark_node; } stmt = c_begin_compound_stmt (true); or perhaps simpler initialize it to the function_start_locus at the beginning and have those functions without { have function_start_locus == function_end_locus like the __GIMPLE functions (where propagating the closing } seemed too difficult). 2020-03-23 Jakub Jelinek PR gcov-profile/94029 PR c/94239 * c-parser.c (c_parser_declaration_or_fndef): Initialize endloc to the function_start_locus location. Don't do that afterwards for the __GIMPLE body parsing. --- gcc/c/c-parser.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 4b068a9..aeeac8c 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -2469,9 +2469,10 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, omp_declare_simd_clauses); if (oacc_routine_data) c_finish_oacc_routine (oacc_routine_data, current_function_decl, true); + location_t startloc = c_parser_peek_token (parser)->location; DECL_STRUCT_FUNCTION (current_function_decl)->function_start_locus - = c_parser_peek_token (parser)->location; - location_t endloc; + = startloc; + location_t endloc = startloc; /* If the definition was marked with __RTL, use the RTL parser now, consuming the function body. */ @@ -2499,8 +2500,6 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, specs->declspec_il, specs->entry_bb_count); in_late_binary_op = saved; - struct function *fun = DECL_STRUCT_FUNCTION (current_function_decl); - endloc = fun->function_start_locus; } else fnbody = c_parser_compound_statement (parser, &endloc); -- cgit v1.1 From 4df50a059fbd4d4a1cb067bd43caccdfca0327a8 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 7 Apr 2020 14:30:53 +0200 Subject: openmp: Fix parallel master error recovery [PR94512] We need to set OMP_PARALLEL_COMBINED only if the parsing of omp_master succeeded, because otherwise there is no nested master construct in the parallel. 2020-04-07 Jakub Jelinek PR c++/94512 * c-parser.c (c_parser_omp_parallel): Set OMP_PARALLEL_COMBINED if c_parser_omp_master succeeded. * parser.c (cp_parser_omp_parallel): Set OMP_PARALLEL_COMBINED if cp_parser_omp_master succeeded. * g++.dg/gomp/pr94512.C: New test. --- gcc/c/c-parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index aeeac8c..17a28e9 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -18877,9 +18877,9 @@ c_parser_omp_parallel (location_t loc, c_parser *parser, stmt = c_finish_omp_parallel (loc, cclauses[C_OMP_CLAUSE_SPLIT_PARALLEL], block); - OMP_PARALLEL_COMBINED (stmt) = 1; if (ret == NULL) return ret; + OMP_PARALLEL_COMBINED (stmt) = 1; return stmt; } else if (strcmp (p, "loop") == 0) -- cgit v1.1 From 13e41d8b9d3d7598c72c38acc86a3d97046c8373 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Wed, 8 Apr 2020 09:39:43 +0200 Subject: [C/C++, OpenACC] Reject vars of different scope in acc declare (PR94120) gcc/c/ PR middle-end/94120 * c-decl.c (c_check_in_current_scope): New function. * c-tree.h (c_check_in_current_scope): Declare it. * c-parser.c (c_parser_oacc_declare): Add check that variables are declared in the same scope as the directive. Fix handling of namespace vars. gcc/cp/ PR middle-end/94120 * paser.c (cp_parser_oacc_declare): Add check that variables are declared in the same scope as the directive. gcc/testsuite/ PR middle-end/94120 * c-c++-common/goacc/declare-pr94120.c: New. * g++.dg/declare-pr94120.C: New. libgomp/testsuite/ PR middle-end/94120 * libgomp.oacc-c++/declare-pr94120.C: New. --- gcc/c/c-parser.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 17a28e9..d1c954c 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -16580,6 +16580,15 @@ c_parser_oacc_declare (c_parser *parser) break; } + if (!c_check_in_current_scope (decl)) + { + error_at (loc, + "%qD must be a variable declared in the same scope as " + "%<#pragma acc declare%>", decl); + error = true; + continue; + } + if (lookup_attribute ("omp declare target", DECL_ATTRIBUTES (decl)) || lookup_attribute ("omp declare target link", DECL_ATTRIBUTES (decl))) -- cgit v1.1 From 2dc9294c3c7c81a6d5e1d4dedf58fea87bbadde6 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 15 Apr 2020 09:59:14 +0200 Subject: openmp: Reject requires directives not at file or namespace scope [PR94593] This change started with a bugreport about a typo in one requires testcase (diagnosed with -Wunknown-pragmas only), but following discussion lead to noting that we do not diagnose restriction that requires directives in C/C++ may only appear at file or namespace scope; and several our tests violated that. 2020-04-15 Jakub Jelinek PR c/94593 * c-parser.c (c_parser_pragma) : Reject requires directive when not at file scope. * parser.c (cp_parser_pragma) : Reject requires directive when not at file or namespace scope. * c-c++-common/gomp/requires-1.c: Fix a typo, requries -> requires. Move directives to file scope. (i): Remove. * c-c++-common/gomp/requires-2.c: Move directives to file scope. (i, foo): Remove. * c-c++-common/gomp/requires-4.c: Move directives to file scope. * c-c++-common/gomp/atomic-19.c: Move requires directive to file scope. * c-c++-common/gomp/atomic-20.c: Likewise. * c-c++-common/gomp/atomic-21.c: Likewise. * c-c++-common/gomp/atomic-22.c: Likewise. * gcc.dg/gomp/requires-1.c: New test. * g++.dg/gomp/requires-1.C: New test. * g++.dg/gomp/requires-2.C: New test. * g++.dg/gomp/atomic-18.C: Move requires directive to file scope. --- gcc/c/c-parser.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index d1c954c..679c14d 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -12402,6 +12402,13 @@ c_parser_pragma (c_parser *parser, enum pragma_context context, bool *if_p) return false; case PRAGMA_OMP_REQUIRES: + if (context != pragma_external) + { + error_at (c_parser_peek_token (parser)->location, + "%<#pragma omp requires%> may only be used at file scope"); + c_parser_skip_until_found (parser, CPP_PRAGMA_EOL, NULL); + return false; + } c_parser_omp_requires (parser); return false; -- cgit v1.1 From 2e3897490e0f99b22a2813cfb34d59a1ea71ff68 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 17 Apr 2020 16:59:57 +0200 Subject: c, c++: Fix two redundantAssignment warnings [PR94629] This change fixes two obvious redundant assignments reported by cppcheck: trunk.git/gcc/c/c-parser.c:16969:2: style: Variable 'data.clauses' is reassigned a value before the old one has been used. [redundantAssignment] trunk.git/gcc/cp/call.c:5116:9: style: Variable 'arg2' is reassigned a value before the old one has been used. [redundantAssignment] 2020-04-17 Jakub Jelinek PR other/94629 * c-parser.c (c_parser_oacc_routine): Remove redundant assignment to data.clauses. * call.c (build_conditional_expr_1): Remove redundant assignment to arg2. --- gcc/c/c-parser.c | 1 - 1 file changed, 1 deletion(-) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 679c14d..4e90d55 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -16939,7 +16939,6 @@ c_parser_oacc_routine (c_parser *parser, enum pragma_context context) oacc_routine_data data; data.error_seen = false; data.fndecl_seen = false; - data.clauses = NULL_TREE; data.loc = c_parser_peek_token (parser)->location; c_parser_consume_pragma (parser); -- cgit v1.1 From e1113ffbd619d0568fb3b37e9660d9e0ae7862f5 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sun, 19 Apr 2020 12:13:33 +0200 Subject: c, objc: Fix up c_parser_objc_selector_arg after CPP_SCOPE changes [PR94637] Similarly to inline asm, :: (or any other number of consecutive colons) can appear in ObjC @selector argument and with the introduction of CPP_SCOPE into the C FE, we need to trat CPP_SCOPE as two CPP_COLON tokens. The C++ FE does that already that way. 2020-04-19 Jakub Jelinek PR objc/94637 * c-parser.c (c_parser_objc_selector_arg): Handle CPP_SCOPE like two CPP_COLON tokens. * objc.dg/pr94637.m: New test. --- gcc/c/c-parser.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 4e90d55..ae354e6 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -11782,15 +11782,28 @@ c_parser_objc_selector_arg (c_parser *parser) { tree sel = c_parser_objc_selector (parser); tree list = NULL_TREE; - if (sel && c_parser_next_token_is_not (parser, CPP_COLON)) + if (sel + && c_parser_next_token_is_not (parser, CPP_COLON) + && c_parser_next_token_is_not (parser, CPP_SCOPE)) return sel; while (true) { - if (!c_parser_require (parser, CPP_COLON, "expected %<:%>")) - return list; - list = chainon (list, build_tree_list (sel, NULL_TREE)); + if (c_parser_next_token_is (parser, CPP_SCOPE)) + { + c_parser_consume_token (parser); + list = chainon (list, build_tree_list (sel, NULL_TREE)); + list = chainon (list, build_tree_list (NULL_TREE, NULL_TREE)); + } + else + { + if (!c_parser_require (parser, CPP_COLON, "expected %<:%>")) + return list; + list = chainon (list, build_tree_list (sel, NULL_TREE)); + } sel = c_parser_objc_selector (parser); - if (!sel && c_parser_next_token_is_not (parser, CPP_COLON)) + if (!sel + && c_parser_next_token_is_not (parser, CPP_COLON) + && c_parser_next_token_is_not (parser, CPP_SCOPE)) break; } return list; -- cgit v1.1 From 49ddde69fc8e1e4c48d4b0027ea37ac862da0f1f Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 14 May 2020 09:48:32 +0200 Subject: openmp: Also implicitly mark as declare target to functions mentioned in target regions OpenMP 5.0 also specifies that functions referenced from target regions (except for target regions with device(ancestor:)) are also implicitly declare target to. This patch implements that. 2020-05-14 Jakub Jelinek * function.h (struct function): Add has_omp_target bit. * omp-offload.c (omp_discover_declare_target_fn_r): New function, old renamed to ... (omp_discover_declare_target_tgt_fn_r): ... this. (omp_discover_declare_target_var_r): Call omp_discover_declare_target_tgt_fn_r instead of omp_discover_declare_target_fn_r. (omp_discover_implicit_declare_target): Also queue functions with has_omp_target bit set, for those walk with omp_discover_declare_target_fn_r, for declare target to functions walk with omp_discover_declare_target_tgt_fn_r. gcc/c/ * c-parser.c (c_parser_omp_target): Set cfun->has_omp_target. gcc/cp/ * cp-gimplify.c (cp_genericize_r): Set cfun->has_omp_target. gcc/fortran/ * trans-openmp.c: Include function.h. (gfc_trans_omp_target): Set cfun->has_omp_target. libgomp/ * testsuite/libgomp.c-c++-common/target-40.c: New test. --- gcc/c/c-parser.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index ae354e6..5c8502b 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -19866,6 +19866,7 @@ check_clauses: } pc = &OMP_CLAUSE_CHAIN (*pc); } + cfun->has_omp_target = true; return true; } -- cgit v1.1 From 53b663f90a88a9e8daeb98bac0b9d20294652d5d Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 19 May 2020 10:39:30 +0200 Subject: Fix typo in c-parser.c. gcc/c/ChangeLog: * c-parser.c: Fix typo. --- gcc/c/c-parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 5c8502b..5d11e7e 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -73,7 +73,7 @@ along with GCC; see the file COPYING3. If not see /* We need to walk over decls with incomplete struct/union/enum types after parsing the whole translation unit. In finish_decl(), if the decl is static, has incomplete - struct/union/enum type, it is appeneded to incomplete_record_decls. + struct/union/enum type, it is appended to incomplete_record_decls. In c_parser_translation_unit(), we iterate over incomplete_record_decls and report error if any of the decls are still incomplete. */ -- cgit v1.1 From 34e4962aed08b38f37e37242234bfbbd1b897f39 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sun, 24 May 2020 18:01:51 +0200 Subject: diagnostics: Add function call parens matching to c_parser. The C++ parser already tracks function call parens matching, but the C parser doesn't. This adds the same functionality to the C parser and adds a testcase showing the C++ and C parser matching function call parens in an error message. gcc/c/ChangeLog: * c-parser.c (c_parser_postfix_expression_after_primary): Add scope with matching_parens after CPP_OPEN_PAREN. gcc/testsuite/ChangeLog: * c-c++-common/missing-close-func-paren.c: New test. --- gcc/c/c-parser.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 5d11e7e..23d6fa2 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -10458,21 +10458,23 @@ c_parser_postfix_expression_after_primary (c_parser *parser, break; case CPP_OPEN_PAREN: /* Function call. */ - c_parser_consume_token (parser); - for (i = 0; i < 3; i++) - { - sizeof_arg[i] = NULL_TREE; - sizeof_arg_loc[i] = UNKNOWN_LOCATION; - } - literal_zero_mask = 0; - if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) - exprlist = NULL; - else - exprlist = c_parser_expr_list (parser, true, false, &origtypes, - sizeof_arg_loc, sizeof_arg, - &arg_loc, &literal_zero_mask); - c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, - "expected %<)%>"); + { + matching_parens parens; + parens.consume_open (parser); + for (i = 0; i < 3; i++) + { + sizeof_arg[i] = NULL_TREE; + sizeof_arg_loc[i] = UNKNOWN_LOCATION; + } + literal_zero_mask = 0; + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + exprlist = NULL; + else + exprlist = c_parser_expr_list (parser, true, false, &origtypes, + sizeof_arg_loc, sizeof_arg, + &arg_loc, &literal_zero_mask); + parens.skip_until_found_close (parser); + } orig_expr = expr; mark_exp_read (expr.value); if (warn_sizeof_pointer_memaccess) -- cgit v1.1 From 9eea5d2ddf73037e21b59bcd8084ba969ae10174 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 22 May 2020 01:10:50 +0200 Subject: Provide diagnostic hints for missing C inttypes.h string constants. This adds a flag to c_parser so we know when we were trying to construct a string literal. If there is a parse error and we were constructing a string literal, and the next token is an unknown identifier name, and we know there is a standard header that defines that name as a string literal, then add a missing header hint to the error messsage. The list of macro names are also used when providing a hint for missing identifiers. gcc/c-family/ChangeLog: * known-headers.cc (get_string_macro_hint): New function. (get_stdlib_header_for_name): Use get_string_macro_hint. (get_c_stdlib_header_for_string_macro_name): New function. * known-headers.h (get_c_stdlib_header_for_string_macro_name): New function declaration. gcc/c/ChangeLog: * c-parser.c (struct c_parser): Add seen_string_literal bitfield. (c_parser_consume_token): Reset seen_string_literal. (c_parser_error_richloc): Add name_hint if seen_string_literal and next token is a CPP_NAME and we have a missing header suggestion for the name. (c_parser_string_literal): Set seen_string_literal. gcc/testsuite/ChangeLog: * gcc.dg/spellcheck-inttypes.c: New test. * g++.dg/spellcheck-inttypes.C: Likewise. --- gcc/c/c-parser.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 23d6fa2..df0b59f 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -69,6 +69,7 @@ along with GCC; see the file COPYING3. If not see #include "c-family/name-hint.h" #include "tree-iterator.h" #include "memmodel.h" +#include "c-family/known-headers.h" /* We need to walk over decls with incomplete struct/union/enum types after parsing the whole translation unit. @@ -223,6 +224,13 @@ struct GTY(()) c_parser { keywords are valid. */ BOOL_BITFIELD objc_property_attr_context : 1; + /* Whether we have just seen/constructed a string-literal. Set when + returning a string-literal from c_parser_string_literal. Reset + in consume_token. Useful when we get a parse error and see an + unknown token, which could have been a string-literal constant + macro. */ + BOOL_BITFIELD seen_string_literal : 1; + /* Location of the last consumed token. */ location_t last_token_location; }; @@ -853,6 +861,7 @@ c_parser_consume_token (c_parser *parser) } } parser->tokens_avail--; + parser->seen_string_literal = false; } /* Expect the current token to be a #pragma. Consume it and remember @@ -966,6 +975,25 @@ c_parser_error_richloc (c_parser *parser, const char *gmsgid, } } + /* If we were parsing a string-literal and there is an unknown name + token right after, then check to see if that could also have been + a literal string by checking the name against a list of known + standard string literal constants defined in header files. If + there is one, then add that as an hint to the error message. */ + auto_diagnostic_group d; + name_hint h; + if (parser->seen_string_literal && token->type == CPP_NAME) + { + tree name = token->value; + const char *token_name = IDENTIFIER_POINTER (name); + const char *header_hint + = get_c_stdlib_header_for_string_macro_name (token_name); + if (header_hint != NULL) + h = name_hint (NULL, new suggest_missing_header (token->location, + token_name, + header_hint)); + } + c_parse_error (gmsgid, /* Because c_parse_error does not understand CPP_KEYWORD, keywords are treated like @@ -7539,6 +7567,7 @@ c_parser_string_literal (c_parser *parser, bool translate, bool wide_ok) ret.original_code = STRING_CST; ret.original_type = NULL_TREE; set_c_expr_source_range (&ret, get_range_from_loc (line_table, loc)); + parser->seen_string_literal = true; return ret; } -- cgit v1.1 From fab46c5df7500f2ce640f98320d47a19d3de8a2f Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 16 Jun 2020 16:30:05 +0200 Subject: openmp: Diagnose invalid OpenMP schedule(simd, static) 2020-06-16 Jakub Jelinek gcc/c/ * c-parser.c (c_parser_omp_clause_schedule): Reject modifier separated from kind by comma rather than colon. gcc/cp/ * parser.c (cp_parser_omp_clause_schedule): Reject modifier separated from kind by comma rather than colon. gcc/testsuite/ * c-c++-common/gomp/schedule-modifiers-2.c: New test. --- gcc/c/c-parser.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index df0b59f..fea6a09 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -14782,6 +14782,7 @@ c_parser_omp_clause_schedule (c_parser *parser, tree list) c = build_omp_clause (loc, OMP_CLAUSE_SCHEDULE); + location_t comma = UNKNOWN_LOCATION; while (c_parser_next_token_is (parser, CPP_NAME)) { tree kind = c_parser_peek_token (parser)->value; @@ -14794,16 +14795,22 @@ c_parser_omp_clause_schedule (c_parser *parser, tree list) modifiers |= OMP_CLAUSE_SCHEDULE_NONMONOTONIC; else break; + comma = UNKNOWN_LOCATION; c_parser_consume_token (parser); if (nmodifiers++ == 0 && c_parser_next_token_is (parser, CPP_COMMA)) - c_parser_consume_token (parser); + { + comma = c_parser_peek_token (parser)->location; + c_parser_consume_token (parser); + } else { c_parser_require (parser, CPP_COLON, "expected %<:%>"); break; } } + if (comma != UNKNOWN_LOCATION) + error_at (comma, "expected %<:%>"); if ((modifiers & (OMP_CLAUSE_SCHEDULE_MONOTONIC | OMP_CLAUSE_SCHEDULE_NONMONOTONIC)) -- cgit v1.1 From 1160ec9a141faf1c4c0496c7412c8febeb623962 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 16 Jun 2020 16:31:13 +0200 Subject: openmp: Initial part of OpenMP 5.0 non-rectangular loop support OpenMP 5.0 adds support for non-rectangular loop collapses, e.g. triangular and more complex. This patch deals just with the diagnostics so that they aren't rejected immediately as before. As the spec generally requires as before that the iteration variable initializer and bound in the comparison as invariant vs. the outermost loop, and just add some exceptional forms that can violate that, we need to avoid folding the expressions until we can detect them and in order to avoid folding it later on, I chose to use a TREE_VEC in those expressions to hold the var_outer * expr1 + expr2 triplet, the patch adds pretty-printing of that, gimplification etc. and just sorry_at during omp expansion for now. The next step will be to implement the different cases of that one by one. 2020-06-16 Jakub Jelinek gcc/ * tree.h (OMP_FOR_NON_RECTANGULAR): Define. * gimplify.c (gimplify_omp_for): Diagnose schedule, ordered or dist_schedule clause on non-rectangular loops. Handle gimplification of non-rectangular lb/b expressions. When changing iteration variable, adjust also non-rectangular lb/b expressions referencing that. * omp-general.h (struct omp_for_data_loop): Add m1, m2 and outer members. (struct omp_for_data): Add non_rect member. * omp-general.c (omp_extract_for_data): Handle non-rectangular loops. Fill in non_rect, m1, m2 and outer. * omp-low.c (lower_omp_for): Handle non-rectangular lb/b expressions. * omp-expand.c (expand_omp_for): Emit sorry_at for unsupported non-rectangular loop cases and assert for cases that can't be non-rectangular. * tree-pretty-print.c (dump_mem_ref): Formatting fix. (dump_omp_loop_non_rect_expr): New function. (dump_generic_node): Handle non-rectangular OpenMP loops. * tree-pretty-print.h (dump_omp_loop_non_rect_expr): Declare. * gimple-pretty-print.c (dump_gimple_omp_for): Handle non-rectangular OpenMP loops. gcc/c-family/ * c-common.h (c_omp_check_loop_iv_exprs): Add an int argument. * c-omp.c (struct c_omp_check_loop_iv_data): Add maybe_nonrect and idx members. (c_omp_is_loop_iterator): New function. (c_omp_check_loop_iv_r): Use it. Add support for silent scanning if outer loop iterator is present. Perform duplicate checking through hash_set in the function rather than expecting caller to do that. Pass NULL instead of d->ppset to walk_tree_1. (c_omp_check_nonrect_loop_iv): New function. (c_omp_check_loop_iv): Use it. Fill in new members, allow non-rectangular loop forms, diagnose multiple associated loops with the same iterator. Pass NULL instead of &pset to walk_tree_1. (c_omp_check_loop_iv_exprs): Likewise. gcc/c/ * c-parser.c (c_parser_expr_no_commas): Save, clear and restore c_in_omp_for. (c_parser_omp_for_loop): Set c_in_omp_for around some calls to avoid premature c_fully_fold. Defer explicit c_fully_fold calls to after c_finish_omp_for. * c-tree.h (c_in_omp_for): Declare. * c-typeck.c (c_in_omp_for): Define. (build_modify_expr): Avoid c_fully_fold if c_in_omp_for. (digest_init): Likewise. (build_binary_op): Likewise. gcc/cp/ * semantics.c (handle_omp_for_class_iterator): Adjust c_omp_check_loop_iv_exprs caller. (finish_omp_for): Likewise. Don't call fold_build_cleanup_point_expr before calling c_finish_omp_for and c_omp_check_loop_iv, move it after those calls. * pt.c (tsubst_omp_for_iterator): Handle non-rectangular loops. gcc/testsuite/ * c-c++-common/gomp/loop-6.c: New test. * gcc.dg/gomp/loop-1.c: Don't expect diagnostics on valid non-rectangular loops. * gcc.dg/gomp/loop-2.c: New test. * g++.dg/gomp/loop-1.C: Don't expect diagnostics on valid non-rectangular loops. * g++.dg/gomp/loop-2.C: Likewise. * g++.dg/gomp/loop-5.C: New test. * g++.dg/gomp/loop-6.C: New test. --- gcc/c/c-parser.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 8 deletions(-) (limited to 'gcc/c/c-parser.c') diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index fea6a09..7bf91ef 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -7594,6 +7594,8 @@ c_parser_expr_no_commas (c_parser *parser, struct c_expr *after, struct c_expr lhs, rhs, ret; enum tree_code code; location_t op_location, exp_location; + bool save_in_omp_for = c_in_omp_for; + c_in_omp_for = false; gcc_assert (!after || c_dialect_objc ()); lhs = c_parser_conditional_expression (parser, after, omp_atomic_lhs); op_location = c_parser_peek_token (parser)->location; @@ -7633,6 +7635,7 @@ c_parser_expr_no_commas (c_parser *parser, struct c_expr *after, code = BIT_IOR_EXPR; break; default: + c_in_omp_for = save_in_omp_for; return lhs; } c_parser_consume_token (parser); @@ -7652,6 +7655,7 @@ c_parser_expr_no_commas (c_parser *parser, struct c_expr *after, ret.original_code = ERROR_MARK; } ret.original_type = NULL; + c_in_omp_for = save_in_omp_for; return ret; } @@ -18119,8 +18123,10 @@ c_parser_omp_for_loop (location_t loc, c_parser *parser, enum tree_code code, if (i > 0) vec_safe_push (for_block, c_begin_compound_stmt (true)); this_pre_body = push_stmt_list (); + c_in_omp_for = true; c_parser_declaration_or_fndef (parser, true, true, true, true, true, NULL, vNULL); + c_in_omp_for = false; if (this_pre_body) { this_pre_body = pop_stmt_list (this_pre_body); @@ -18158,9 +18164,11 @@ c_parser_omp_for_loop (location_t loc, c_parser *parser, enum tree_code code, init_exp = c_parser_expr_no_commas (parser, NULL); init_exp = default_function_array_read_conversion (init_loc, init_exp); + c_in_omp_for = true; init = build_modify_expr (init_loc, decl, decl_exp.original_type, NOP_EXPR, init_loc, init_exp.value, init_exp.original_type); + c_in_omp_for = false; init = c_process_expr_stmt (init_loc, init); c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); @@ -18181,19 +18189,13 @@ c_parser_omp_for_loop (location_t loc, c_parser *parser, enum tree_code code, if (c_parser_next_token_is_not (parser, CPP_SEMICOLON)) { location_t cond_loc = c_parser_peek_token (parser)->location; + c_in_omp_for = true; struct c_expr cond_expr = c_parser_binary_expression (parser, NULL, NULL_TREE); + c_in_omp_for = false; cond = cond_expr.value; cond = c_objc_common_truthvalue_conversion (cond_loc, cond); - if (COMPARISON_CLASS_P (cond)) - { - tree op0 = TREE_OPERAND (cond, 0), op1 = TREE_OPERAND (cond, 1); - op0 = c_fully_fold (op0, false, NULL); - op1 = c_fully_fold (op1, false, NULL); - TREE_OPERAND (cond, 0) = op0; - TREE_OPERAND (cond, 1) = op1; - } switch (cond_expr.original_code) { case GT_EXPR: @@ -18337,8 +18339,10 @@ c_parser_omp_for_loop (location_t loc, c_parser *parser, enum tree_code code, an error from the initialization parsing. */ if (!fail) { + c_in_omp_for = true; stmt = c_finish_omp_for (loc, code, declv, NULL, initv, condv, incrv, body, pre_body, true); + c_in_omp_for = false; /* Check for iterators appearing in lb, b or incr expressions. */ if (stmt && !c_omp_check_loop_iv (stmt, declv, NULL)) @@ -18348,6 +18352,40 @@ c_parser_omp_for_loop (location_t loc, c_parser *parser, enum tree_code code, { add_stmt (stmt); + for (i = 0; i < TREE_VEC_LENGTH (OMP_FOR_INIT (stmt)); i++) + { + tree init = TREE_VEC_ELT (OMP_FOR_INIT (stmt), i); + gcc_assert (TREE_CODE (init) == MODIFY_EXPR); + tree decl = TREE_OPERAND (init, 0); + tree cond = TREE_VEC_ELT (OMP_FOR_COND (stmt), i); + gcc_assert (COMPARISON_CLASS_P (cond)); + gcc_assert (TREE_OPERAND (cond, 0) == decl); + + tree op0 = TREE_OPERAND (init, 1); + if (!OMP_FOR_NON_RECTANGULAR (stmt) + || TREE_CODE (op0) != TREE_VEC) + TREE_OPERAND (init, 1) = c_fully_fold (op0, false, NULL); + else + { + TREE_VEC_ELT (op0, 1) + = c_fully_fold (TREE_VEC_ELT (op0, 1), false, NULL); + TREE_VEC_ELT (op0, 2) + = c_fully_fold (TREE_VEC_ELT (op0, 2), false, NULL); + } + + tree op1 = TREE_OPERAND (cond, 1); + if (!OMP_FOR_NON_RECTANGULAR (stmt) + || TREE_CODE (op1) != TREE_VEC) + TREE_OPERAND (cond, 1) = c_fully_fold (op1, false, NULL); + else + { + TREE_VEC_ELT (op1, 1) + = c_fully_fold (TREE_VEC_ELT (op1, 1), false, NULL); + TREE_VEC_ELT (op1, 2) + = c_fully_fold (TREE_VEC_ELT (op1, 2), false, NULL); + } + } + if (cclauses != NULL && cclauses[C_OMP_CLAUSE_SPLIT_PARALLEL] != NULL) { -- cgit v1.1