Re: [patch] Implement Ada support for DragonFly, improve it for FreeBSD

2015-06-03 Thread Thomas Quinot
* Eric Botcazou, 2015-06-03 :

> > Note 2) I removed reference to FreeBSD 6 and earlier.  These platforms
> > have been EOL for years (FreeBSD 8 is EOL in 4 weeks)
> > 
> > Note 3) FreeBSD should have switched to use errno years ago, this patch
> > does that now.
> > 
> > Note 4) For all BSD except DragonFly (which doesn't support i386
> > anymore), the GCC_UNWINDER is specified for i386 platforms.  It wasn't
> > specified before.
> > 
> > Note 5) All the ce/cxa/cxg tests that failed on i386-FreeBSD are related
> > to the 53-bit float mantissa issue on FreeBSD.  This is resolved by my
> > GNAT-AUX repository changes so the tests pass without compromising other
> > compilers, but those patches are out of scope of this set.
> 
> I'm not a specialist of FreeBSD so Thomas is Cced.  The original message is:
>   https://gcc.gnu.org/ml/gcc-patches/2015-05/msg02830.html

Patch looks good to me. The story with floats is that on FreeBSD, the
i386 FPU is set to 53-bit floats, but the GNAT runtime library always
issues a "finit" instruction to reset it to full precision, so we need
to reset TARGET_96_ROUND_53_LONG_DOUBLE to 0.
 
* Arnaud Charlet, 2015-06-03 :

> > In all likelihood, I would be the first to discover the breakage and
> > also the most likely to submit the patch.  This covers all three targets
> > (both FreeBSD and the one DragonFly).
> 
> OK, as long as this happens and the files do not bitrot, that's fine with me.
> What I want to avoid is a one time submit and no follow ups afterwards, and
> files which no longer work after some time, with nobody bothering fixing
> them.

John has been actively maintaining these changes for the past few years,
so I'm confident these files won't bitrot.

-- 
Thomas Quinot, Ph.D. ** qui...@adacore.com ** Senior Software Engineer
   AdaCore -- Paris, France -- New York, USA


Re: [patch] Implement Ada support for DragonFly, improve it for FreeBSD

2015-06-03 Thread Thomas Quinot
* John Marino, 2015-06-03 :

> I have this fixed in an interesting way on gnat-aux.  I found that
> setting TARGET_96_ROUND_53_LONG_DOUBLE affects other front ends, so you
> have to choose which one you want to be correct, GNAT or the C (or
> whatever, can't remember which ones were affected now)

Right.

> My solution was to create two common backends, one for gnat and one for
> the others.  An example of the main patch is here:
> 
> https://raw.githubusercontent.com/jrmarino/draco/master/misc/flux5/patch-gcc_Makefile.in
> 
> (note the new s-modes-ada target)
> 
> and then this patch is needed:
> 
> https://raw.githubusercontent.com/jrmarino/draco/master/misc/flux5/patch-gcc_ada_gcc-interface_Make-lang.in
> 
> 
> With those modifications, all the ACATS tests pass on i386 and the other
> front ends work as expected.

Interesting approach. However if we aim for integration in GCC, then
maybe a more straightforward approach (replacing the macro with a
variable that would be initialized by some back-end-specific startup
routine?) is in order.

-- 
Thomas Quinot, Ph.D. ** qui...@adacore.com ** Senior Software Engineer
   AdaCore -- Paris, France -- New York, USA


Re: [Ada] Add DragonFly support to System.OS_Constants template

2015-07-06 Thread Thomas Quinot
* John Marino, 2015-07-06 :

> The System.OS_Constants templates for GNAT has three preprocessor checks
> for FreeBSD.  In all three cases, DragonFly BSD needs to be treated the
> same as FreeBSD.  The attached patch accomplishes this.

Thanks John, looks good to me!

Thomas.



Re: [f...@deneb.enyo.de: [PATCH] ada/77535: GNAT.Perfect_Hash_Generators for non-1-based strings]

2016-09-18 Thread Thomas Quinot
> This patch fixes GNAT.Perfect_Hash_Generators for strings which are
> not 1-based.  It does this by introducing its own storage type which
> fixes the first index as 1.  This is also a minor optimization because
> it avoids the need to store the index.
> 
> Okay for trunk?
> 
> Should I try to construct a new test case for this?  I don't see any
> existing tests for this package.

Florian,

Sorry for the delay in reviewing your patch. It looks good on the
surface; we're QAing it internally to make sure it does not break
PolyORB (which is the primary consumer of g-pehage). I'll let you know
as soon as I have the results from that run.

In any case it would be good to include a regression test for this
issue.

Thanks!
Thomas.

-- 
Thomas Quinot, Ph.D. ** qui...@adacore.com ** IT Lead Engineer
   AdaCore -- Paris, France -- New York, USA


Re: [f...@deneb.enyo.de: [PATCH] ada/77535: GNAT.Perfect_Hash_Generators for non-1-based strings]

2016-09-19 Thread Thomas Quinot
* Thomas Quinot, 2016-09-18 :

> Sorry for the delay in reviewing your patch. It looks good on the
> surface; we're QAing it internally to make sure it does not break
> PolyORB (which is the primary consumer of g-pehage). I'll let you know
> as soon as I have the results from that run.

QA went fine so OK to commit (please include a regression test).

Thanks!
Thomas.

-- 
Thomas Quinot, Ph.D. ** qui...@adacore.com ** IT Lead Engineer
   AdaCore -- Paris, France -- New York, USA


[PATCH] Instance information in DWARF discriminators

2012-11-28 Thread Thomas Quinot
The following proposed change adds a new mode of operation where
the discriminator field in DWARF debugging information is set from
information provided by a language front-end to discriminate
between distinct code instances coming from instances of a given
template. (Currently the discriminator is set by assigning
arbitrary distinct identifiers to each basic block associated with
a single source location).

This is intended primarily for the Ada language front-end (further
changes, to be submitted shortly, will enable the new mode of
operation under control of appropriate switches), in order to
allow per-instance source coverage analysis of generics. However
this might also be useful for other language front-ends, e.g. with
C++ templates.

Change tested on x86_64-linux. OK to commit?

2012-08-08  Thomas Quinot  

gcc/
* common.opt (flag_debug_instances): Define new internal flag.
* final.c (notice_source_line): If flag_debug_instances is set,
set discriminator to current instance id.
* tree-cfg.c (assign_discriminator): If flag_debug_instances is set,
nothing to do here.
* input.h (LOCATION_INSTANCE): New macro to retrieve instance id.
* emit-rtl.c (insn_instance): New function to retrieve instance id.
* rtl.h (insn_instance): Declare.

libcpp/
* include/line_map.h (struct line_map_ordinary): Add instance field.
(expanded_location): Ditto.
(ORDINARY_MAP_INSTANCE): Define.
* line-map.c (linemap_expand_location): Set instance field in expanded
location from same in set.

Index: gcc/final.c
===
--- gcc/final.c (révision 193884)
+++ gcc/final.c (copie de travail)
@@ -2894,6 +2894,10 @@
 {
   filename = insn_file (insn);
   linenum = insn_line (insn);
+  if (flag_debug_instances)
+{
+  discriminator = insn_instance (insn);
+}
 }
 
   if (filename == NULL)
Index: gcc/input.h
===
--- gcc/input.h (révision 193884)
+++ gcc/input.h (copie de travail)
@@ -51,6 +51,7 @@
 #define LOCATION_FILE(LOC) ((expand_location (LOC)).file)
 #define LOCATION_LINE(LOC) ((expand_location (LOC)).line)
 #define LOCATION_COLUMN(LOC)((expand_location (LOC)).column)
+#define LOCATION_INSTANCE(LOC) ((expand_location (LOC)).instance)
 #define LOCATION_LOCUS(LOC) \
   ((IS_ADHOC_LOC(LOC)) ? get_location_from_adhoc_loc (line_table, LOC) : (LOC))
 #define LOCATION_BLOCK(LOC) \
Index: gcc/emit-rtl.c
===
--- gcc/emit-rtl.c  (révision 193884)
+++ gcc/emit-rtl.c  (copie de travail)
@@ -6007,6 +6007,14 @@
   return LOCATION_FILE (INSN_LOCATION (insn));
 }
 
+/* Return source instance of the statement that produced this insn.  */
+
+int
+insn_instance (const_rtx insn)
+{
+  return LOCATION_INSTANCE (INSN_LOCATION (insn));
+}
+
 /* Return true if memory model MODEL requires a pre-operation (release-style)
barrier or a post-operation (acquire-style) barrier.  While not universal,
this function matches behavior of several targets.  */
Index: gcc/common.opt
===
--- gcc/common.opt  (révision 193884)
+++ gcc/common.opt  (copie de travail)
@@ -158,6 +158,11 @@
 Variable
 int flag_debug_asm
 
+; For generic instances, include complete instantiation chain in debugging
+; information (ELF discriminators).
+Variable
+int flag_debug_instances = 0
+
 ; -dP causes the rtl to be emitted as a comment in assembly.
 Variable
 int flag_dump_rtl_in_asm
Index: gcc/rtl.h
===
--- gcc/rtl.h   (révision 193884)
+++ gcc/rtl.h   (copie de travail)
@@ -1917,6 +1917,7 @@
 /* In emit-rtl.c  */
 extern int insn_line (const_rtx);
 extern const char * insn_file (const_rtx);
+extern int insn_instance (const_rtx);
 extern tree insn_scope (const_rtx);
 extern location_t prologue_location, epilogue_location;
 
Index: gcc/tree-cfg.c
===
--- gcc/tree-cfg.c  (révision 193884)
+++ gcc/tree-cfg.c  (copie de travail)
@@ -768,7 +768,7 @@
 {
   gimple first_in_to_bb, last_in_to_bb;
 
-  if (locus == 0 || bb->discriminator != 0)
+  if (locus == 0 || bb->discriminator != 0 || flag_debug_instances)
 return;
 
   first_in_to_bb = first_non_label_stmt (bb);
Index: libcpp/include/line-map.h
===
--- libcpp/include/line-map.h   (révision 193884)
+++ libcpp/include/line-map.h   (copie de travail)
@@ -85,6 +85,12 @@
 
   /* Number of the low-order source_location bits used for a column number.  */
   unsigned int column_bits : 8;
+
+  /* For languages that have the notion of instantiating a given template
+ multiple times, different line_maps can be allocated for each in

Re: [PATCH] Instance information in DWARF discriminators

2012-11-29 Thread Thomas Quinot
* Richard Biener, 2012-11-28 :

> You need to stream the id with LTO, no?  Also increasing the size
> of line_map_ordinary might not be the most welcom change ...

Thanks for your feedback Richard, I'll take care of adding the missing
LTO pieces, and improve documentation of the flag.

As for the size impact on line_map_ordinary, indeed that's an additional
int here, but I'm not sure we allocate so many objects of that kind that
the increase is significant.

Now, an alternative might be to have an array of instance IDs stored at
the struct line_maps level, with the same indices at the set of ordinary
maps, which would be allocated only when flag_debug_instances is used;
when it is not used the cost would then be a single NULL pointer in
struct line_maps. Would that be acceptable?

Side note: I first tried to implement this option using a vec,
but it appears that vec.h cannot currently be used from within libcpp.
So, I'll have to either change that (but that seems like a pretty
significant change) or else manually manage this array through xrealloc.

Thomas.

-- 
Thomas Quinot, Ph.D. ** qui...@adacore.com ** Senior Software Engineer
   AdaCore -- Paris, France -- New York, USA


Re: [PATCH] Instance information in DWARF discriminators

2012-12-05 Thread Thomas Quinot
* Tom Tromey, 2012-11-29 :

> Thomas> Now, an alternative might be to have an array of instance IDs stored 
> at
> Thomas> the struct line_maps level, with the same indices at the set of 
> ordinary
> Thomas> maps, which would be allocated only when flag_debug_instances is used;
> Thomas> when it is not used the cost would then be a single NULL pointer in
> Thomas> struct line_maps. Would that be acceptable?
> 
> I thought there was already a similar approach in place.
> See location_adhoc_data.
> The proliferation of ways to do this is mildly worrying.

Tom,

location_adhoc_data is not really appropriate as it associates data with
a single locus, whereas we need an instance identifier for all loci
covered by a given line map entry.

Attached to this message is an update patch based on an alternative
approach, consisting in maintaining the instance ids in a parallel map
that is allocated only when actually used. In this way, the cost when
not using the option is reduced to a single NULL pointer in struct
line_maps.

This change also attempts to better document the new flag, as pointed
out by Richard, and fixes a few style nits. The LTO streaming part is
still missing.

The updated ChangeLog is:

gcc/
* common.opt (flag_debug_instances): Define new internal flag.
* final.c (notice_source_line): If flag_debug_instances is set,
set discriminator to current instance id.
* emit-rtl.c (insn_instance): New subprogram, retrieves instance
identifier from insn.
* rtl.h (insn_instance): Declare.
* input.h (LOCATION_INSTANCE): Define.
* tree-cfg.c (assign_discriminator): If flag_debug_instances is set,
nothing to do here.

libcpp/
* include/line_map.h (struct line_maps): Add instance_ids field
(table for use under flag_debug_instances).
(expanded_location): Add instance id field.
(LINEMAPS_INSTANCE_IDS): Define.
(ORDINARY_MAP_INSTANCE): Define.
* line-map.c (linemap_expand_location): Set instance field in expanded
location from same in set.

Index: gcc/rtl.h
===
--- gcc/rtl.h   (révision 193884)
+++ gcc/rtl.h   (copie de travail)
@@ -1917,6 +1917,7 @@
 /* In emit-rtl.c  */
 extern int insn_line (const_rtx);
 extern const char * insn_file (const_rtx);
+extern int insn_instance (const_rtx);
 extern tree insn_scope (const_rtx);
 extern location_t prologue_location, epilogue_location;
 
Index: gcc/final.c
===
--- gcc/final.c (révision 193884)
+++ gcc/final.c (copie de travail)
@@ -2894,6 +2894,8 @@
 {
   filename = insn_file (insn);
   linenum = insn_line (insn);
+  if (flag_debug_instances)
+discriminator = insn_instance (insn);
 }
 
   if (filename == NULL)
Index: gcc/input.h
===
--- gcc/input.h (révision 193884)
+++ gcc/input.h (copie de travail)
@@ -51,6 +51,7 @@
 #define LOCATION_FILE(LOC) ((expand_location (LOC)).file)
 #define LOCATION_LINE(LOC) ((expand_location (LOC)).line)
 #define LOCATION_COLUMN(LOC)((expand_location (LOC)).column)
+#define LOCATION_INSTANCE(LOC) ((expand_location (LOC)).instance)
 #define LOCATION_LOCUS(LOC) \
   ((IS_ADHOC_LOC(LOC)) ? get_location_from_adhoc_loc (line_table, LOC) : (LOC))
 #define LOCATION_BLOCK(LOC) \
Index: gcc/emit-rtl.c
===
--- gcc/emit-rtl.c  (révision 193884)
+++ gcc/emit-rtl.c  (copie de travail)
@@ -6007,6 +6007,14 @@
   return LOCATION_FILE (INSN_LOCATION (insn));
 }
 
+/* Return source instance of the statement that produced this insn.  */
+
+int
+insn_instance (const_rtx insn)
+{
+  return LOCATION_INSTANCE (INSN_LOCATION (insn));
+}
+
 /* Return true if memory model MODEL requires a pre-operation (release-style)
barrier or a post-operation (acquire-style) barrier.  While not universal,
this function matches behavior of several targets.  */
Index: gcc/common.opt
===
--- gcc/common.opt  (révision 193884)
+++ gcc/common.opt  (copie de travail)
@@ -158,6 +158,15 @@
 Variable
 int flag_debug_asm
 
+; Language front-ends that support multiple instantiations of a given
+; source template (such as Ada with generics) may enable this flag, and
+; provide instance identifiers in the line map, so that discriminators in
+; DWARF debugging information carry these instance identifiers, allowing
+; external tools to identify which instance a given object instruction comes
+; from.
+Variable
+int flag_debug_instances = 0
+
 ; -dP causes the rtl to be emitted as a comment in assembly.
 Variable
 int flag_dump_rtl_in_asm
Index: gcc/tree-cfg.c
===
--- gcc/tree-cfg.c  (révision 193884)
+++ gcc/tree-cfg.c  (copie de travail

[PATCH] gcc/tree-complex.c: Fix minor typo in comment

2013-07-05 Thread Thomas Quinot
2013-07-06  Thomas Quinot  

gcc/
* tree-complex.c: Fix minor typo in comment

OK to commit?

diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index c45ba19..acd0169 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -1476,7 +1476,7 @@ expand_complex_operations_1 (gimple_stmt_iterator *gsi)
 case EQ_EXPR:
 case NE_EXPR:
   /* Note, both GIMPLE_ASSIGN and GIMPLE_COND may have an EQ_EXPR
-subocde, so we need to access the operands using gimple_op.  */
+subcode, so we need to access the operands using gimple_op.  */
   inner_type = TREE_TYPE (gimple_op (stmt, 1));
   if (TREE_CODE (inner_type) != COMPLEX_TYPE)
return;


Re: PING 1 [Patch Ada RFA] make sure that multilibs are built with correct s-oscons.ads

2011-11-09 Thread Thomas Quinot
* Iain Sandoe, 2011-11-07 :

> Subject: PING 1 [Patch Ada RFA] make sure that multilibs are built with
>  correct s-oscons.ads

Patch looks fine to me.

-- 
Thomas Quinot, Ph.D. ** qui...@adacore.com ** Senior Software Engineer
   AdaCore -- Paris, France -- New York, USA


Re: [PATCH] GCC Ada/GNAT configuration for GNU/Hurd

2012-08-08 Thread Thomas Quinot
* Arnaud Charlet, 2012-06-18 :

> > > > -#if defined (__linux__) && !defined (_XOPEN_SOURCE)
> > > > +#if (defined (__linux__) || defined (__GNU__)) && !defined
> > > > (_XOPEN_SOURCE)
> > > >  /** For Linux _XOPEN_SOURCE must be defined, otherwise IOV_MAX is not
> > > >  defined
> > > >   **/
> > > >  #define _XOPEN_SOURCE 500
> > > 
> > > You need to update the comment here, since the section so far only
> > > applied to GNU/Linux and not GNU/Hurd.
> > 
> > In fact, should that perhaps (unverified) simply say »For glibc,
> > _XOPEN_SOURCE must be defined [...]« -- or is this code meant to be
> > usable on GNU/Linux with a C library different from glibc?
> 
> Posibly yes. Thomas (Quinot), any comment on the above?

No strong opinion either way. What is important is that the comment be
consistent with what we actually test. If we want the comment to say
"For glibc, blah..." then we need to change the test to something that
actually tests for glibc.

Thomas.

-- 
Thomas Quinot, Ph.D. ** qui...@adacore.com ** Senior Software Engineer
   AdaCore -- Paris, France -- New York, USA


[PATCH] New command line switch -fada-spec-parent

2012-08-24 Thread Thomas Quinot
The following proposed change adds a new command line switch
-fada-spec-parent allowing the user to specify a parent unit
for all units generated by -fdump-ada-spec.

* common.opt (-fada-spec-parent): Define new command line switch.
* c-family/c-ada-spec.c (get_ada_package): When -fada-spec-parent
is specified, generate binding spec as a child of the specified unit.
* doc/invoke.texi: Document -fada-spec-parent.

Tested on x86_64-linux.

diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c
index d18e78d..250078c 100644
--- a/gcc/c-family/c-ada-spec.c
+++ b/gcc/c-family/c-ada-spec.c
@@ -945,15 +945,26 @@ get_ada_package (const char *file)
   char *res;
   const char *s;
   int i;
+  int plen;
 
   s = strstr (file, "/include/");
   if (s)
 base = s + 9;
   else
 base = lbasename (file);
-  res = XNEWVEC (char, strlen (base) + 1);
 
-  for (i = 0; *base; base++, i++)
+  if (ada_specs_parent == NULL)
+plen = 0;
+  else
+plen = strlen(ada_specs_parent) + 1;
+
+  res = XNEWVEC (char, plen + strlen (base) + 1);
+  if (ada_specs_parent != NULL) {
+strcpy(res, ada_specs_parent);
+res [plen - 1] = '.';
+  }
+
+  for (i = plen; *base; base++, i++)
 switch (*base)
   {
case '+':
@@ -965,7 +976,7 @@ get_ada_package (const char *file)
case '_':
case '/':
case '\\':
- res [i] = (i == 0 || res [i - 1] == '_') ? 'u' : '_';
+ res [i] = (i == 0 || res [i - 1] == '.' || res [i - 1] == '_') ? 'u' 
: '_';
  break;
 
default:
@@ -3365,7 +3376,10 @@ dump_ads (const char *source_file,
   ads_name = xstrdup (pkg_name);
 
   for (s = ads_name; *s; s++)
-*s = TOLOWER (*s);
+if (*s == '.')
+  *s = '-';
+else
+  *s = TOLOWER (*s);
 
   ads_name = reconcat (ads_name, ads_name, ".ads", NULL);
 
diff --git a/gcc/common.opt b/gcc/common.opt
index 1c7c4c6..f0fcf5e 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1031,6 +1031,10 @@ fdump-
 Common Joined RejectNegative Var(common_deferred_options) Defer
 -fdump-  Dump various compiler internals to a file
 
+fada-spec-parent=
+Common RejectNegative Joined Var(ada_specs_parent)
+-fada-spec-parent=unit Dump Ada specs as child units of given parent
+
 fdump-final-insns
 Driver RejectNegative
 
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 5725f7b..97ac5c3 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -166,7 +166,7 @@ in the following sections.
 -pipe  -pass-exit-codes  @gol
 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  
--target-help  @gol
 --version -wrapper @@@var{file} -fplugin=@var{file} 
-fplugin-arg-@var{name}=@var{arg}  @gol
--fdump-ada-spec@r{[}-slim@r{]} -fdump-go-spec=@var{file}}
+-fdump-ada-spec@r{[}-slim@r{]} -fada-spec-parent=@var{arg} 
-fdump-go-spec=@var{file}}
 
 @item C Language Options
 @xref{C Dialect Options,,Options Controlling C Dialect}.

-- 
Thomas Quinot, Ph.D. ** qui...@adacore.com ** Senior Software Engineer
   AdaCore -- Paris, France -- New York, USA


Re: [PATCH] New command line switch -fada-spec-parent

2012-08-31 Thread Thomas Quinot
* Steven Bosscher, 2012-08-24 :

> > * common.opt (-fada-spec-parent): Define new command line switch.
> Why here instead of in c-family/c.opt?

Makes sense indeed, I'll move the definition there.

-- 
Thomas Quinot, Ph.D. ** qui...@adacore.com ** Senior Software Engineer
   AdaCore -- Paris, France -- New York, USA


Re: [PATCH] New command line switch -fada-spec-parent

2012-09-07 Thread Thomas Quinot
* Steven Bosscher, 2012-08-24 :

> Why here instead of in c-family/c.opt?

Good point. Here is a new version of the patch:

* c-family/c.opt (-fada-spec-parent): Define new command line switch.
* c-family/c-ada-spec.c (get_ada_package): When -fada-spec-parent
is specified, generate binding spec as a child of the specified unit.
* doc/invoke.texi: Document -fada-spec-parent.

diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c
index c67..d3974f3 100644
--- a/gcc/c-family/c-ada-spec.c
+++ b/gcc/c-family/c-ada-spec.c
@@ -818,15 +818,26 @@ get_ada_package (const char *file)
   char *res;
   const char *s;
   int i;
+  int plen;
 
   s = strstr (file, "/include/");
   if (s)
 base = s + 9;
   else
 base = lbasename (file);
-  res = XNEWVEC (char, strlen (base) + 1);
 
-  for (i = 0; *base; base++, i++)
+  if (ada_specs_parent == NULL)
+plen = 0;
+  else
+plen = strlen(ada_specs_parent) + 1;
+
+  res = XNEWVEC (char, plen + strlen (base) + 1);
+  if (ada_specs_parent != NULL) {
+strcpy(res, ada_specs_parent);
+res [plen - 1] = '.';
+  }
+
+  for (i = plen; *base; base++, i++)
 switch (*base)
   {
case '+':
@@ -838,7 +849,7 @@ get_ada_package (const char *file)
case '_':
case '/':
case '\\':
- res [i] = (i == 0 || res [i - 1] == '_') ? 'u' : '_';
+ res [i] = (i == 0 || res [i - 1] == '.' || res [i - 1] == '_') ? 'u' 
: '_';
  break;
 
default:
@@ -3238,7 +3249,10 @@ dump_ads (const char *source_file,
   ads_name = xstrdup (pkg_name);
 
   for (s = ads_name; *s; s++)
-*s = TOLOWER (*s);
+if (*s == '.')
+  *s = '-';
+else
+  *s = TOLOWER (*s);
 
   ads_name = reconcat (ads_name, ads_name, ".ads", NULL);
 
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 40ff96c..4e64fce 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -709,6 +709,10 @@ faccess-control
 C++ ObjC++ Var(flag_access_control) Init(1)
 Enforce class member access control semantics
 
+fada-spec-parent=
+C ObjC C++ ObjC++ RejectNegative Joined Var(ada_specs_parent)
+-fada-spec-parent=unit  Dump Ada specs as child units of given parent
+
 fall-virtual
 C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
 
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 98959be..ad42eca 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -166,7 +166,7 @@ in the following sections.
 -pipe  -pass-exit-codes  @gol
 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  
--target-help  @gol
 --version -wrapper @@@var{file} -fplugin=@var{file} 
-fplugin-arg-@var{name}=@var{arg}  @gol
--fdump-ada-spec@r{[}-slim@r{]} -fdump-go-spec=@var{file}}
+-fdump-ada-spec@r{[}-slim@r{]} -fada-spec-parent=@var{arg} 
-fdump-go-spec=@var{file}}
 
 @item C Language Options
 @xref{C Dialect Options,,Options Controlling C Dialect}.
-- 
Thomas Quinot, Ph.D. ** qui...@adacore.com ** Senior Software Engineer
   AdaCore -- Paris, France -- New York, USA


Re: [patch ada]: Fix MSG_WAITALL handling for windows native targets

2011-04-04 Thread Thomas Quinot
* Kai Tietz, 2011-04-04 :

> So here is the patch without the part in g-socthi-mingw.adb.

Thanks, OK for me.

-- 
Thomas Quinot, Ph.D. ** qui...@adacore.com ** Senior Software Engineer
   AdaCore -- Paris, France -- New York, USA