From 409274f15563bfb31e55ca2a731b6d7bd3ea2f77 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Sun, 13 Oct 2013 18:14:16 +0200 Subject: [PATCH] [multiple changes] 2013-10-13 Vincent Celier * gnat_ugn.texi: Minor editing. 2013-10-13 Ed Schonberg * sem_ch3.adb (Check_Abstract_Overriding): If a synchronized operation implements an interface primitive, mark the operation as referenced, to prevent usually spurious messages about unused entities: such operations are called in dispatching select statements that are not visible to the compiler. From-SVN: r203501 --- gcc/ada/ChangeLog | 12 ++++++++++++ gcc/ada/gnat_ugn.texi | 1 - gcc/ada/sem_ch3.adb | 11 +++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index cdd30eb4716..347f3112481 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,15 @@ +2013-10-13 Vincent Celier + + * gnat_ugn.texi: Minor editing. + +2013-10-13 Ed Schonberg + + * sem_ch3.adb (Check_Abstract_Overriding): If a synchronized + operation implements an interface primitive, mark the operation + as referenced, to prevent usually spurious messages about unused + entities: such operations are called in dispatching select + statements that are not visible to the compiler. + 2013-10-13 Eric Botcazou * gcc-interface/decl.c (gnat_to_gnu_param): Remove obsolete comment. diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 2b504957310..122534ce317 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -19034,7 +19034,6 @@ by @command{gnatstub} to compile an argument source file. @cindex @option{^-gnatyM^/MAX_LINE_LENGTH^} (@command{gnatstub}) (@var{n} is a non-negative integer). Set the maximum line length that is allowed in a source file. The default is 79. The maximum value that can be -body stub to @var{n}; the default is 79. The maximum value that can be specified is 32767. Note that in the special case of configuration pragma files, the maximum is always 32767 regardless of whether or not this switch appears. diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 0d3cd0f68c8..8410409737b 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -9432,6 +9432,17 @@ package body Sem_Ch3 is end if; end if; + -- If the operation is a wrapper for a synchronized primitive, it + -- may be called indirectly through a dispatching select. We assume + -- that it will be referenced elsewhere indirectly, and suppress + -- warnings about an unused entity. + + if Is_Primitive_Wrapper (Subp) + and then Present (Wrapped_Entity (Subp)) + then + Set_Referenced (Wrapped_Entity (Subp)); + end if; + Next_Elmt (Elmt); end loop; end Check_Abstract_Overriding; -- 2.30.2