[Ada] Enable use of GNAT.Sockets for VxWorks RTP

2019-08-19 Thread Pierre-Marie de Rodat
The recent introduction of GNAT.Sockets IPv6 support broke support for VxWorks RTPs due to the use of internal VxWorks kernel calls. This patch rectifies this by using the VxWorks public API for these routines. The following RTP should compile successfully on a Development profile VxWorks kernel t

[Ada] Buffer reading overflow in dispatch table initialization

2019-08-19 Thread Pierre-Marie de Rodat
For tagged types not defined at library level that derive from library level tagged types the compiler may generate code to initialize their dispatch table of predefined primitives copying from the parent type data stored in memory after the dispatch table of the parent; that is, at runtime the ini

[Ada] Improve warnings about "too few elements" and "too many elements"

2019-08-19 Thread Pierre-Marie de Rodat
When warning about length-check failures detected at compile time that are flagged with "too few elements" or "too many elements", the compiler now gives an additional message indicating the number of elements expected by the context versus how many are present in the conflicting expression (such a

[Ada] Legality of protected subp. implementing interface operations

2019-08-19 Thread Pierre-Marie de Rodat
This patch refines the predicate that implements rule in RM 9.4 (11.9/2) Compiling b94.ads must yield: b94.ads:11:17: illegal overriding of subprogram inherited from interface b94.ads:11:17: first formal of "N" declared at line 8 must be of mode "out", "in out" or access-to-variable -

[Ada] Improve placement of warning on formals of generic subprograms

2019-08-19 Thread Pierre-Marie de Rodat
This patch modifies the handling of warnings on unused formal parameters of generic subprograms. Previously such warnings were placed on the formal appearing in the subprogram declaration, in contrast with warnings on non-generic subprograms, where the warning is placed on the corresponding entity

[Ada] Do not skip non-aliasing checking when inlining in GNATprove

2019-08-19 Thread Pierre-Marie de Rodat
When code is inlinined for proof in the special mode for GNATprove, Ada rules about non-aliasing should still be checked. Now fixed. There is no impact on compilation. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-19 Yannick Moy gcc/ada/ * sem_res.adb (Resolve_Call): Che

[Ada] Representation clause for derived enumeration type is mishandled

2019-08-19 Thread Pierre-Marie de Rodat
This patch fixes an old-standing problem with premature freezing. When a derived type declaration includes a constraint, we generate a subtype declaration of an anonymous base type, with the constraint given in the original type declaration, Conceptually, the bounds are converted to the new base ty

[Ada] Factor out the "size for& too small..." error message

2019-08-19 Thread Pierre-Marie de Rodat
Use a constant for the Size_Too_Small_Message, so if it changes, it won't change in one place but not another. DRY. It might be better to move this code out of errout.adb, but that's for another day. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-19 Bob Duff gcc/ada/ * er

[Ada] Further cleanup in inlining machinery

2019-08-19 Thread Pierre-Marie de Rodat
This gets rid of a small issue in the inlining machinery: under very peculiar circumstances, it would add a pending instantiation for the body of a generic package at the point of call to an inlined subprogram of the instance. That's theoritically problematic because the saved context is that of t

[Ada] Fix thinko in Acc_Loop_to_gnu

2019-08-19 Thread Pierre-Marie de Rodat
This fixes a glitch introduced during the initial OpenACC work import process, causing crashes on any Acc_Parallel + Acc_Loop combination. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-08-19 Olivier Hainque gcc/ada/ * gcc-interface/trans.c (Acc_Loop_to_gnu): Return the opena

<    1   2