aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2021-11-22 17:39:30 +0100
committerMartin Liska <mliska@suse.cz>2021-11-22 17:39:30 +0100
commit44a06feaf84111c298bb906b4906b54073fc61d5 (patch)
tree93211de0a07d41e0e046e7b37db2e99578a661a9 /gcc
parentffa33d36af92357098870be1e7dbedad0f883a37 (diff)
parentc38c547a708d9f144ba36f54d3d6ab5f5995966f (diff)
downloadgcc-44a06feaf84111c298bb906b4906b54073fc61d5.zip
gcc-44a06feaf84111c298bb906b4906b54073fc61d5.tar.gz
gcc-44a06feaf84111c298bb906b4906b54073fc61d5.tar.bz2
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/parser.c26
-rw-r--r--gcc/doc/invoke.texi12
-rw-r--r--gcc/testsuite/c-c++-common/goacc/routine-6.c4
3 files changed, 15 insertions, 27 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index aa7f0e4..e2b5d68 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -46852,8 +46852,8 @@ cp_parser_late_parsing_oacc_routine (cp_parser *parser, tree attrs)
emission easier. */
parser->oacc_routine->clauses = nreverse (parser->oacc_routine->clauses);
cp_parser_pop_lexer (parser);
- /* Later, cp_finalize_oacc_routine will process the clauses, and then set
- fndecl_seen. */
+ /* Later, cp_finalize_oacc_routine will process the clauses. */
+ parser->oacc_routine->fndecl_seen = true;
return attrs;
}
@@ -46871,16 +46871,17 @@ cp_finalize_oacc_routine (cp_parser *parser, tree fndecl, bool is_defn)
|| fndecl == error_mark_node)
return;
- if (parser->oacc_routine->fndecl_seen)
- {
- error_at (parser->oacc_routine->loc,
- "%<#pragma acc routine%> not immediately followed by"
- " a single function declaration or definition");
- parser->oacc_routine = NULL;
- return;
- }
if (TREE_CODE (fndecl) != FUNCTION_DECL)
{
+ if (parser->oacc_routine->fndecl_seen)
+ {
+ error_at (parser->oacc_routine->loc,
+ "%<#pragma acc routine%> not immediately followed by"
+ " a single function declaration or definition");
+ parser->oacc_routine = NULL;
+ return;
+ }
+
cp_ensure_no_oacc_routine (parser);
return;
}
@@ -46921,11 +46922,6 @@ cp_finalize_oacc_routine (cp_parser *parser, tree fndecl, bool is_defn)
parser->oacc_routine->clauses,
DECL_ATTRIBUTES (fndecl));
}
-
- /* Don't unset parser->oacc_routine here: we may still need it to
- diagnose wrong usage. But, remember that we've used this "#pragma acc
- routine". */
- parser->oacc_routine->fndecl_seen = true;
}
}
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 714a415..34484f6 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -14672,10 +14672,6 @@ by the RTL if-conversion pass for a branch that is considered unpredictable.
If @option{-fvariable-expansion-in-unroller} is used, the maximum number
of times that an individual variable will be expanded during loop unrolling.
-@item tracer-min-branch-probability-feedback
-Stop forward growth if the probability of best edge is less than
-this threshold (in percent). Used when profile feedback is available.
-
@item partial-inlining-entry-probability
Maximum probability of the entry BB of split region
(in percent relative to entry BB of the function)
@@ -14725,10 +14721,6 @@ A threshold on the average loop count considered by the swing modulo scheduler.
The number of cycles the swing modulo scheduler considers when checking
conflicts using DFA.
-@item max-inline-insns-recursive-auto
-The maximum number of instructions non-inline function
-can grow to via recursive inlining.
-
@item graphite-allow-codegen-errors
Whether codegen errors should be ICEs when @option{-fchecking}.
@@ -14778,10 +14770,6 @@ when comparing to the number of (scaled) blocks.
Maximum number of nested calls to search for control dependencies
during uninitialized variable analysis.
-@item sra-max-scalarization-size-Osize
-Maximum size, in storage units, of an aggregate
-which should be considered for scalarization when compiling for size.
-
@item fsm-scale-path-blocks
Scale factor to apply to the number of blocks in a threading path
when comparing to the number of (scaled) statements.
diff --git a/gcc/testsuite/c-c++-common/goacc/routine-6.c b/gcc/testsuite/c-c++-common/goacc/routine-6.c
new file mode 100644
index 0000000..0a231a0
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/goacc/routine-6.c
@@ -0,0 +1,4 @@
+/* PR c++/101731 */
+
+#pragma acc routine /* { dg-error "not immediately followed by a single function declaration or definition" "" { target c++ } } */
+int foo (int bar ());