Re: [PR81878]: fix --disable-bootstrap --enable-languages=ada, and cross-back gnattools build

2018-11-14 Thread Arnaud Charlet
> Huh, indeed - it's a host_module without bootstrap ... and libada is > a target_module not bootstrapped either. So we're indeed in a curious > situation where we have a bootstrap of Ada requiring a host Ada but > nothing of Ada is actually bootstrapped ... ;) Not sure what you mean by that, al

Re: not posted ada patch breaks ada build on alpha-linux-gnu

2018-11-26 Thread Arnaud Charlet
> r266136 broke the ada build on alpha-linux-gnu, filed as PR88191. I didn't > find this patch posted to gcc-patches. Thanks for the heads up. This is this change: [Ada] Update signal constants for GNU/Linux Add the signal SIGSYS and mark the glibc reserved real-time signals (32-34) as reserve

Re: not posted ada patch breaks ada build on alpha-linux-gnu

2018-11-26 Thread Arnaud Charlet
> that fixes the build, taken from the sparc64 file. not sure if that is > appropriate. The patch looks good, you can go ahead and commit it. > --- gcc/ada/libgnarl/s-linux__alpha.ads (revision 266457) > +++ gcc/ada/libgnarl/s-linux__alpha.ads (working copy) > @@ -87,6 +87,7 @@ >

Re: [PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD

2019-07-03 Thread Arnaud Charlet
OK, thanks. > From: James Clarke > > Monotonic_Clock and RT_Resolution in the recently-added s-tpopmo.adb > call clock_gettime/clock_getres with the integral constants from OSC and > thus rely on clockid_t being an integral type, so we cannot hide it on > GNU/kFreeBSD. Instead, make the definiti

Re: [PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD

2019-07-04 Thread Arnaud Charlet
> I don't have commit access so could you please do so on my behalf? No, I won't be able to do that unfortunately. By the way do you have a copyright assignment in place? Arno

Re: [PATCH] [Ada] Make clockid_t type public on GNU/kFreeBSD

2019-07-04 Thread Arnaud Charlet
> checked in. Ok for the gcc-9 branch as well? Yes.

Re: r273212 - in /trunk/gcc/ada: ChangeLog Makefile...

2019-07-13 Thread Arnaud Charlet
> > 2019-07-08 Dmitriy Anisimkov > > > > gcc/ada/ > > > > * Makefile.rtl: Use g-sercom__linux.adb for all linuxes. > > ln: failed to create symbolic link 'rts/g-sercom.adb': File exists > make[7]: *** [/daten/riscv64/gcc/gcc-20190713/gcc/ada/Makefile.rtl:2676: > setup-rts] Error 1 > > And

[Ada] clean ups in C runtime files

2019-07-18 Thread Arnaud Charlet
-linux-gnu, committed on trunk. 2019-07-18 Arnaud Charlet * Makefile.rtl, expect.c, env.c, aux-io.c, mkdir.c, initialize.c, cstreams.c, raise.c, tracebak.c, adadecode.c, init.c, raise-gcc.c, argv.c, adaint.c, adaint.h, ctrl_c.c, sysdep.c, rtinit.c, cio.c,

Re: [PATCH] PR ada/89583, GNAT.Sockets.Bind_Socket fails with IPv4 address

2019-03-05 Thread Arnaud Charlet
Simon, Thanks for the patch. We already have a fix pending for that in our tree that we will merge. Arno > On 4 Mar 2019, at 20:48, Simon Wright wrote: > > With GCC9, GNAT.Sockets includes support for IPv6. Sockaddr is an > Unchecked_Union, which now includes IPv6 fields, bringing the total p

Re: [ada, build] Fix make install-gcc-specs with empty GCC_SPEC_FILES

2019-05-07 Thread Arnaud Charlet
> When installing gcc 9.1.0 on Solaris 10 with CONFIG_SHELL=/bin/ksh, it > failed in the same way as originally fixed by > > https://gcc.gnu.org/ml/gcc-patches/2016-05/msg00087.html > > While the patch still is on the gcc-5 and gcc-6 branches, it has been > lost (inadvertently, I assume) on

Re: [ada, build] Avoid cp -p failures during Ada make install

2019-05-08 Thread Arnaud Charlet
> Tested on x86_64-pc-linux-gnu installing both to a local filesystem and > an NFSv3 filesystem. > > Ok for mainline (and the gcc-9 and gcc-8 branches eventually)? No, this is not OK. I'd rather keep the simple current logic and either stick to cp -p, or use a proper $(INSTALL_whatever) as done

Re: [ada, build] Avoid cp -p failures during Ada make install

2019-05-08 Thread Arnaud Charlet
> Also, standard.ads.h is a valid file, so the reference shouldn't be removed. > > I'll add it to the repository, this was an oversight, thanks for noticing. I've added it now. 2019-05-08 Arnaud Charlet * standard.ads.h: New file.

Re: [ada, build] Avoid cp -p failures during Ada make install

2019-05-13 Thread Arnaud Charlet
> > No, this is not OK. > > > > I'd rather keep the simple current logic and either stick to cp -p, or > > use a proper $(INSTALL_whatever) as done elsewhere rather than adding more > > kludges. > > how do you mean, `proper $(INSTALL_whatever)'? Using e.g. INSTALL_DATA from configure. > I've run

Re: [PATCH] Don't DCE const/pure calls that can throw if cfg can't be altered (PR rtl-optimization/88870)

2019-01-17 Thread Arnaud Charlet
> > > PR rtl-optimization/88870 > > > * dce.c (deletable_insn_p): Never delete const/pure calls that can > > > throw if we can't alter the cfg or delete dead exceptions. > > > (mark_insn): Don't call find_call_stack_args for such calls. > > > > > > * gcc.dg/pr88870.c: New test. > > OK.

[Ada] fix gnatlib build on x32 runtime

2019-02-06 Thread Arnaud Charlet
This has been reported on https://github.com/mattgodbolt/compiler-explorer-image/issues/161 The failure has been introduced 2018-11-14 when updating the list of signals in s-linux*.ads files, s-linux__x32.ads was forgotten. Tested on x86_64-pc-linux-gnu, committed on trunk. 2019-02-06 Arnaud

Re: [PATCH 1/4][Ada,DJGPP] Ada support for DJGPP

2016-08-13 Thread Arnaud Charlet
>>> * ada/adaint.c (__gnat_is_djgpp): define (1 for DJGPP host, 0 >>> otherwise). * ada/s-os_lib.ads (Is_Djgpp): import __gnat_is_djgpp as >>> constant. * ada/s-os_lib.adb (Normalize_Pathname): support DJGPP special >>> paths (/dev/*) for DJGPP hosts >> The patch does more than this though: >

Re: [PATCH 2/4][Ada,DJGPP] Ada support for DJGPP

2016-08-18 Thread Arnaud Charlet
> This patch (2nd of 4) includes various changes to Ada related C files > required for DJGPP support > > ChangeLog entry: > > 2016-07-30 Andris Pavenis > > * ada/ctrl_c.c: Do not use macro SA_RESTART for DJGPP. > > * ada/gsocket.h: Do not support sockets for DJGPP. > > * ada/init.

Re: [PATCH 3/4][Ada,DJGPP] Ada support for DJGPP

2016-08-18 Thread Arnaud Charlet
> 2016-07-30 Andris Pavenis > > * ada/gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS): Define for > DJGPP target > (EH_MECHANISM): Define to -gcc for DJGPP > * ada/system-djgpp.ads: New file > > Andris > +++ b/gcc/ada/system-djgpp.ads > @@ -0,0 +1,148 @@ > +--

Re: [Patch] Disable text mode translation in ada for Cygwin

2016-08-19 Thread Arnaud Charlet
> > Text mode translation should not be done for Cygwin, especially since it > > does not > > support unicode setmode calls. This also fixes ada builds for Cygwin. > > > > OK for trunk? > > Ping? Can you send the link to your original submission for easy retrieval? Arno

Re: Implement -Wimplicit-fallthrough (take 3)

2016-08-19 Thread Arnaud Charlet
> > > > Does this warning make sense if !(lang_GNU_C() || lang_GNU_CXX()) ? > > > > > > I don't think so, it's meant for C/C++ only. I added a better check. > > > > Well, maybe the warning could also work for ObjC and ObjC++, but since I > > haven't included any testcases for these languages so

Re: [Patch] Disable text mode translation in ada for Cygwin

2016-08-25 Thread Arnaud Charlet
Patch is OK

Re: [PATCH 2/4][Ada,DJGPP] Ada support for DJGPP

2016-08-25 Thread Arnaud Charlet
> -#if defined (__MINGW32__) > +#if defined (__DJGPP__) > + > +/* FIXME: this is draft version only. Fix me if that is not correct */ > +/*or not complete (AP) */ This FIXME needs to be addressed. The rest of the patch is OK. Arno

Re: [PATCH 3/4][Ada,DJGPP] Ada support for DJGPP

2016-08-25 Thread Arnaud Charlet
Which exception handling mechanism is used by the DJGPP port? Is it (GCC) SJLJ? Arno

Re: [PATCH 3/4][Ada,DJGPP] Ada support for DJGPP

2016-09-04 Thread Arnaud Charlet
> On 08/25/2016 12:46 PM, Arnaud Charlet wrote: > >Which exception handling mechanism is used by the DJGPP port? > >Is it (GCC) SJLJ? > No. Updated to set ZCX_By_Default := true for DJGPP. Well I'm confused now. How could this work before? In other words, has the target r

Re: [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP

2016-09-04 Thread Arnaud Charlet
> >This last patch (4/4) contains DJGPP related changes to adaint.c > >(except one which belongs to patch 1/4). This patch is quite intrusive. Are all these changes really needed? > char > __gnat_get_default_identifier_character_set (void) > { > +#if defined (__DJGPP__) > + return 'p'; > +#el

Re: [PATCH 2/4][Ada,DJGPP] Ada support for DJGPP

2016-09-04 Thread Arnaud Charlet
This patch is OK > From 83fe70a17d811ebdec7ca70509e3c2521657d8f2 Mon Sep 17 00:00:00 2001 > From: Andris Pavenis > Date: Sun, 28 Aug 2016 08:02:11 +0300 > Subject: [PATCH 2/4] [DJGPP, Ada] DJGPP support > > * ada/ctrl_c.c: Do not use macro SA_RESTART for DJGPP. > > * ada/gsocket.h: Do not suppo

Re: [PATCH 3/4][Ada,DJGPP] Ada support for DJGPP

2016-09-04 Thread Arnaud Charlet
> GCC Ada compiler itself uses exceptions. Yes, but the bootstrap doesn't use system-dgjpp.ads, it uses the generic system.ads which uses front-end (GNAT) SJLJ, hence my question. Your answer isn't very reassuring. Arno

Re: [Patch] Disable text mode translation in ada for Cygwin

2016-05-26 Thread Arnaud Charlet
> Text mode translation should not be done for Cygwin, especially since it > does not > support unicode setmode calls. This also fixes ada builds for Cygwin. > > OK for trunk? OK, thanks. > gcc/ada/ChangeLog: > * sysdep.c (__gnat_set_binary_mode, __gnat_set_text_mode, > __gnat_set_mo

Re: [PATCH] Fix PR ada/71358

2016-06-01 Thread Arnaud Charlet
> This fixes a minor problem where GNAT.Command_Line.Getopt raises CE if > there are in fact no program-specified options (only the > internally-supplied -h, --help are meant to be available). > > Tested on GCC 6.1.0, x86_64-apple-darwin15. > > If OK, can someone commit it (I can't). > > gcc/ada

[Ada] Fix handling of separate units in GNATprove cross references

2016-06-14 Thread Arnaud Charlet
The collect of cross references for computing effects of subprograms in GNATprove was done incorrectly in the case of separate units. This is now fixed, by bypassing subunits when computing the unit of interest for both scopes and cross references. Tested on x86_64-pc-linux-gnu, committed on trunk

[Ada] Missing error on formal package

2016-06-14 Thread Arnaud Charlet
This patch fixes an omission in the analysis of formal package declarations. Actuals in the instance are properly rejected if their name does not correspond to any of the actuals, and there are box associations for existing formals. Compiling gcc -c c_test.ads must yield generic_p_level_2

[Ada] Improve error message on Extensions_Visible

2016-06-14 Thread Arnaud Charlet
This patch changes the formatting of errors related to the pragma Extensions_Visible so as not to suggest Extensions_Visible applies to a formal parameters instead of a subprogram when SPARK RM 6.1.7(3) is violated. In addition, a small change to sem_prag was made to make the printing of boolean

[Ada] Remove useless calls to invariant procedures

2016-06-14 Thread Arnaud Charlet
This patch removes a redundant call to a generated invariant procedure when Assertion_Policy is ignored. The following must execute quietly: gcc -c -gnatn -O3 -S ut.adb grep "invariant" ut.s --- pragma Assertion_Policy (Ignore); --- private with TI; package UT is type T2 is limited private;

[Ada] Exclude private protected type defined in the runtime for restrictions

2016-06-16 Thread Arnaud Charlet
This is preliminary work to allow an implementation change in the runtime. Does not affect users. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-06-16 Tristan Gingold * einfo.ads (Has_Protected): Clarify comment. * sem_ch9.adb (Analyze_Protected_Type_Declaration): Do n

[Ada] Improve the support of No_Use_Entity

2016-06-16 Thread Arnaud Charlet
This patch performs a code cleanup of the previous implementation and extends its functionality to facilitate the use of this restriction with entities of the Ada83 package Text_IO. For example: pragma Restrictions (No_Use_Of_Entity => Text_IO.Put_Line); with Text_IO; use Text_IO; procedure Restr

[Ada] Warn on buffer overrun with complex overlay

2016-06-16 Thread Arnaud Charlet
This change improves the warning issued for buffer overruns caused by overlays where the underlying object is too small, by taking into account the offset of the overlaid object from the first bit of the underlying object. The effect is visible on the following package: 1. with Interfaces; u

[Ada] Avoid anonymous array object for aggregates with qualified expressions

2016-06-16 Thread Arnaud Charlet
This patch enhances the memory usage of object declarations initialized by a qualified array aggregate. Previously, as per RM 4.3(5), an anonymous object was created to capture the value of the array aggregate, effectively doubling the memory consumption. The changes above remove the anonymous obje

[Ada] Use System.Priority to validate pragma Priority value for subprogram.

2016-06-16 Thread Arnaud Charlet
This fixes a corner case for pragma Priority (0) set on the main subprogram. Does not affect usual platforms. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-06-16 Tristan Gingold * sem_prag.adb (Analyze_Pragma): Simplify code for Pragma_Priority. Index: exp_aggr.adb =

[Ada] Fix minor memory leak in GNAT.Command_Line

2016-06-16 Thread Arnaud Charlet
When a new switch is defined with a specific name for its parameter, that name is not freed. This is a minor leak, since such switches are in general defined once at the beginning of the program, and never modified afterwards. Detected with valgrind. Tested on x86_64-pc-linux-gnu, committed on tru

[Ada] Missing finalization of controlled build-in-place function result

2016-06-16 Thread Arnaud Charlet
This patch modifies the finalization machinery to recognize a controlled deferred constant initialized by means of a build-in-place function call as requiring finalization actions. -- Source -- -- types.ads private with Ada.Finalization; package Types is type T (<>

[Ada] Missing errors on illegal expressions for entry pre/postconditions

2016-06-16 Thread Arnaud Charlet
This patch adds checks on the expressions of pre/postconditions for task and protected entries, prior to their full analysis, so that errors are properly emitted in various compiler modes. Tested by ACATS 4.0L: B611008 Tested on x86_64-pc-linux-gnu, committed on trunk 2016-06-16 Ed Schonberg

[Ada] Handling of all-digits host names

2016-06-20 Thread Arnaud Charlet
In Get_Host_By_Name, do not treat a strings consisting of digits only as an IP address whose lookup should actually be done using Get_Host_By_Address. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-06-20 Thomas Quinot * g-socket.adb (Is_IP_Address): A string consisting in digi

[Ada] Always consider Linker_Options from package System

2016-06-20 Thread Arnaud Charlet
On full runtimes, this was always the case. On restricted one, force system to be in the closer of the program. No test for full runtimes (as no behaviour change). Tested on x86_64-pc-linux-gnu, committed on trunk 2016-06-20 Tristan Gingold * make.adb (Check_Standard_Library): Consid

[Ada] Adapt treatment of inherited classwide pre/post to GNATprove

2016-06-20 Thread Arnaud Charlet
In GNATprove mode, inherited classwide pre/post are copied to the overriding subprogram declaration, so that GNATprove can find them to verify Liskov Substitution Principle on SPARK code. The copied pre/post are not turned into pragma checks anymore in GNATprove mode, so that they are added to the

[Ada] Reimplementation of type invariants

2016-06-20 Thread Arnaud Charlet
This patch prevents the insertion of the invariant procedure declaration and body when the context is a generic unit. This ensures that generated code does not permiate the template. -- Source -- -- tester.ads package Tester is type Type_Id is (Ext_1_Id,

[Ada] Spurious error with predicate on type derived from unconstrained array

2016-06-22 Thread Arnaud Charlet
This patch fixes a spurious error on the compilation of a subprogram whose formal parameter is derived from an unconstrained array type with a dynamic predicate aspect. The following must compile quietly: gcc -c gpr2-attribute.adb gcc -c -gnata gpr2-attribute.adb --- package GPR2 is su

[Ada] New debug switch -gnatd.o

2016-06-22 Thread Arnaud Charlet
This patch causes -gnatd.o to choose a more conservative elaboration order. The following test should compile and run quietly. gnatmake -q -f -gnatd.o -g -O0 elab_indirect_2-main -bargs -p -ws with Elab_Indirect; with Elab_Indirect.Child; package body Elab_Indirect_2 is procedure P is begi

[Ada] Crash on illegal expression in context with predicate

2016-06-22 Thread Arnaud Charlet
This patch fixes a compiler abort on a return statement for a function whose type is a derived type with a dynamic predicate, when the return expression has the parent type. Compiling gpr2-attribute.adb must yield: gpr2-attribute.adb:8:14: expected type "Qualified_Name" defined at gpr

[Ada] New implementation of Ada.Containers.Unbounded_Priority_Queues

2016-06-22 Thread Arnaud Charlet
This patch uses O(lg N) algorithms for Unbounded_Priority_Queues. No expected change in behavior; no test available. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-06-22 Bob Duff * a-cuprqu.ads, a-cuprqu.adb: Completely rewrite this package. Use red-black trees, which

[Ada] Improve and unify warning machinery for address clauses

2016-06-22 Thread Arnaud Charlet
This change moves the rest of the warning machinery for address clauses to Validate_Address_Clauses, ensuring that all the variants are issued from it. This affects only absolute address clauses in practice, i.e. address clauses of the form for I'Address use To_Address (16#_#) and variants

[Ada] Independent tasks and the Fall_Back_Handler

2016-06-22 Thread Arnaud Charlet
This patch fixes a bug in which if a Fall_Back_Handler is installed for the environment task, independent tasks will call it. The following test should run quietly: with Ada.Text_IO; package body Debug is protected body Dbg is procedure Termination (Cause : in Task_Termination.

[Ada] Spurious error on derived type with unknown discriminants and predicate

2016-06-22 Thread Arnaud Charlet
This patch fixes a spurious error on an instantiation of an unbounded container, when the element type is a private type with unknown discriminants, derived from an array subtype with a predicate aspect. The following must ocmpile quietly: gcc -c gpr2-attribute.adb --- package GPR2 is sub

[Ada] Analysis of pragmas containing integer expressions not verified properly

2016-06-22 Thread Arnaud Charlet
If a string is used as an argument instead of an integer, Check_Arg_Is_OK_Static_Expression with Any_Integer will falsely verify causing the compiler to halt compilation when the caller acts on the assumption that it was verified. This patch creates checks so that Any_Integer works properly and doc

[Ada] Crash on config pragma Component_Alignment

2016-06-22 Thread Arnaud Charlet
Pragma Component_Alignment was not implemented properly and caused a crash when used in a configuration file due to how it was applied via the scope table. This patch correctly identifies this case and uses a global variable Configuration_Component_Alignment to capture the value set during configur

Re: [PATCH] gcc: ada: delete old $(P) reference

2017-07-18 Thread Arnaud Charlet
> From: Mike Frysinger > > The P variable was deleted back in Nov 2015 (svn rev 231062), > but its expansion was missed. Delete those now too. > > 2017-07-18 Mike Frysinger > > * gcc-interface/Makefile.in ($(P)): Delete OK, thanks.

Re: [PATCH] Adjust function name dumping

2017-08-23 Thread Arnaud Charlet
Richard, > When enabling free-lang-data the lang_hooks.decl_printable_name hook > gets reset. The following patch reduces the noise from that by > using verbosity 1 (do not print arguments) from the places where > we dump the function name and then follow by arguments manually. > > This makes du

Re: [PATCH] Adjust function name dumping

2017-08-23 Thread Arnaud Charlet
> > You have typos in the a bove changelog BTW, the "b" and "s" should be > > part of the filenames (e.g. gnat.dg/noinline2.adb: Likewise.) > > Ooops. Will fix. > > > I do not understand the changes in the ada testsuite: cana you explain why > > you renames some variables? > > Because the scan

[Ada] Compiler crash on call to eliminated protected operation.

2017-09-06 Thread Arnaud Charlet
This patch fixes an omission in the handling of pragma Eliminate when applied to a protected operation. The pragma was properly processed, but a call to an eliminated protected operation was not flagged as an error, and the code generator aborted on a call to an undefined operation. Compiling:

[Ada] Extension of 'Image in Ada2020.

2017-09-06 Thread Arnaud Charlet
AI12-0124 adds the notation Object'Image to the language, following the semantics of GNAT-defined attribute 'Img. This patch fixes an omission in the characterization of objects, which must include function calls and thus attribute references for attributes that are functions, as well as predefined

[Ada] Spurious error with formal incomplete types

2017-09-06 Thread Arnaud Charlet
This patch fixes a spurious error on the use of of a generic unit with formal incomplete types, as a formal package in another generic unit, when the actuals for the incomplete types are themselves formal incomplete types. The treatment of incomplete subtypes that are created for such formals is n

[Ada] Enable automatic reordering of components in record types

2017-09-06 Thread Arnaud Charlet
This activates the reordering of components in record types with convention Ada that was implemented some time ago in the compiler. The idea is to get rid of blatant inefficiencies that the layout in textual order of the source code can bring about, typically when the offset of components is not f

[Ada] Resolution of set membersip operations with overloaded alternatives

2017-09-06 Thread Arnaud Charlet
This patch fixes a bug in the resolution of set membership operations when the expression and/or the alternatives on the right-hand side are overloaded. If a given overloaded alternative is resolved to a unique type by intersection with the types of previous alternatives, the type is used subsequen

[Ada] Minor cleanup in support machinery for inter-unit inlining

2017-09-06 Thread Arnaud Charlet
The inter-unit inlining done by the compiler requires a dedicated machinery to deal with the public status of library-level entities, since it breaks the private/plublic semantic barrier of the language. This is a minor cleanup to this machinery, no functional changes. Tested on x86_64-pc-linux-g

[Ada] Spurious errors on derived untagged types with partial constraints

2017-09-06 Thread Arnaud Charlet
This patch fixes the handling of untagged discriminated derived types that constrain some parent discriminants and rename others. The compiler failed to handle a change of representation on the derived type, and generated faulty code for the initialization procedure or such a derived type. Executi

[Ada] Restore original implementation of internal Table package

2017-09-06 Thread Arnaud Charlet
This wasn't explicitly mentioned but the previous changes also replaced the internal Table package used in the compiler by GNAT.Tables, resulting in a large performance hit for the compiler because the memory management scheme of the latter is very inefficient. This restores the original implement

[Ada] Primitive functions that require one formal and return an array

2017-09-06 Thread Arnaud Charlet
Primitive functions whose first formal is a controlling parameter, whose other formals have defaults and whose result is an array type can lead to ambiguities when the result of such a call is the prefix of an indexed component. The interpretation that analyzes Obj.F (X, Y) into F (Obj)(X, Y) is on

[Ada] Inherited aspects that may be delayed in a parent type

2017-09-06 Thread Arnaud Charlet
This patch fixes an omission in the handling of delayed aspects on derived types. The type may inherit a representation aspect from its parent, but have no explicit aspect specifications. At the point it is frozen, the parent is frozen as well and its explicit aspects have been analyzed. The inheri

[Ada] Pragma No_Return on generic units

2017-09-06 Thread Arnaud Charlet
This patch ensures that if a pragma No_Return applies to a generic subprogram , all its instantiations are treated as No_Return subprograms as well. Tested in ACATS 4.1D C651001. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-09-06 Ed Schonberg * sem_ch12.adb (Analyze_Subprog

[Ada] Crash on generic subprogram with aspect No_Return.

2017-09-06 Thread Arnaud Charlet
This patch fixes a compiler abort on a generic unit to which the aspect No_Return applies. Tested in ACATS 4.1D C651002. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-09-06 Ed Schonberg * freeze.adb (Freeze_Entity): Do not generate a freeze node for a generic unit, e

[Ada] Improve error message when function is used in a call statement

2017-09-06 Thread Arnaud Charlet
A typical error for new users of Ada is to call functions in a call statement. Improve the error message for these users, to better indicate what the error is in that case. The following compilation raises the new message. $ gcc -c main.adb 1. procedure Main is 2.function Lol

[Ada] No_Return procedures in renaming declarations.

2017-09-06 Thread Arnaud Charlet
This patch implements legality rule in 6.5.1 (7/2): if a renaming as body completes a nonreturning procedure declaration, the renamed procedure must be nonreturning as well. Previously GNAT only produced a warning in such cases. Tested in ACATS test B651002. Tested on x86_64-pc-linux-gnu, commit

[Ada] Better warning on access to string at negative or null index

2017-09-06 Thread Arnaud Charlet
The warning issued when accessing a string at a negative or null index was misleading, suggesting to use S'First - 1 as correct index, which it is obviously not. Add a detection for negative or null index when accessing a standard string, so that an appropriate warning is issued. Also add a corresp

[Ada] Missing finalization of cursor in "of" iterator loop

2017-09-06 Thread Arnaud Charlet
This patch modifies the finalization machinery to ensure that the cursor of an "of" iterator loop is properly finalized at the end of the loop. Previously it was incorrectly assumed that such a cursor will never need finalization ctions. -- Source -- -- leak.adb pragma

[Ada] Derived iterable types with noniterable parent

2017-09-06 Thread Arnaud Charlet
This patch fixes a bug in which if a derived type has a Default_Iterator specified, and the parent type does not, then a "for ... of" loop causes the compiler to crash. No small test case available. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-09-06 Bob Duff * exp_ch5.adb (G

[Ada] Extension of 'Image in Ada2020

2017-09-06 Thread Arnaud Charlet
Refactor of all 'Image attributes for better error diagnostics and clarity. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-09-06 Justin Squirek * exp_imgv.adb (Expand_Image_Attribute), (Expand_Wide_Image_Attribute), (Expand_Wide_Wide_Image_Attribute): Added cas

[Ada] Crash when issuing warning on uninitialized value

2017-09-06 Thread Arnaud Charlet
When issuing a warning on a read of an uninitialized variable through reading an attribute such as Loop_Entry, GNAT could crash. Now fixed. GNAT issues a warning as expected on the following code: $ gcc -c s.adb 1. package S is 2. 3.type Array_Range is range 1 .. 10;

[Ada] Eliminate out-of-line body of local inlined subprograms

2017-09-06 Thread Arnaud Charlet
This improves a little the algorithm used to compute the set of externally visible entities in package bodies to make it less conservative in the presence of local inlined subprograms. The typical effect is to eliminate the out-of-line body if the subprogram is inlined at every call site: package

[Ada] Time_IO.Value enhanced to parse ISO-8861 UTC date and time

2017-09-06 Thread Arnaud Charlet
The function Value of package GNAT.Calendar.Time_IO has been enhanced to parse strings containing UTC date and time. After this patch the following test works fine. with Ada.Calendar; use Ada.Calendar; with Ada.Text_IO; use Ada.Text_IO; with GNAT.Calendar.Time_IO; use GNAT.Cale

[Ada] Dimensional checking and generic subprograms

2017-09-06 Thread Arnaud Charlet
This patch enahnces dimensionality checking to cover generic subprograms that are intended to apply to types of different dimensions, such as an integration function. Dimensionality checking is performed in each instance. and rely on a special handling of conversion operations to prevent spurious d

[Ada] Handling of inherited and explicit postconditions

2017-09-06 Thread Arnaud Charlet
This patch fixes the handling of overriding operations that have both an explicit postcondition and an inherited classwide one. Executing: gnatmake -q -gnata post_class.adb post_class must yield: raised SYSTEM.ASSERTIONS.ASSERT_FAILURE : failed inherited postcondition from the_p

[Ada] Missing finalization of generalized indexed element

2017-09-06 Thread Arnaud Charlet
This patch modifies the finalization mechanism to recognize a heavily expanded generalized indexing where the element type requires finalization actions. -- Source -- -- types.ads with Ada.Finalization; use Ada.Finalization; package Types is type Element is new Con

[Ada] Reject invalid use of Global/Depends on object declaration

2017-09-06 Thread Arnaud Charlet
GNAT failed to issue an error on a Global/Depends aspect put on an object declaration, which is only allowed for a task object. Instead it crashed. Now fixed. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-09-06 Yannick Moy * sem_prag.adb (Analyze_Depends_Global): Reinforce te

[Ada] Issue error message on invalid representation clause for extension

2017-09-06 Thread Arnaud Charlet
This makes the compiler generate an error message also in the case where one of the specified components overlaps the parent field because its size has been explicitly set by a size clause. The compiler must issue an error on 32-bit platforms for the package: 1. package P is 2. 3.

[Ada] Volatile component not treated as such

2017-09-06 Thread Arnaud Charlet
This patch corrects an issue where attributes applied to records were not propagated to components within the records - causing incorrect code to be generated by the backend. Additionally, this ticket fixes another issue with pragma Volatile_Full_Access that allowed the attribute to be applied to a

[Ada] Spurious warning in formal package when use clause is present.

2017-09-06 Thread Arnaud Charlet
This patch removes a spurious style warning on an operator declared in a generic package when the package is used as a formal of a generic subprogram, and the subprogream body includes a use clause on that package. The following must compile quietly: gcc -c -gnatyO generic_test.adb --- with Gene

[Ada] Wrong code on assignment of conditional expression to a mutable obkect

2017-09-06 Thread Arnaud Charlet
This patch fixes an error in an assignmen statement to an entity of a mutable type (variable or in-out parameter) when the righ-hand side of the assignment is a conditioal expression, some of whose alternatives are aggregates. Prior to this patch, not all components of the mutable object were prop

[Ada] Improved error message on malformed null procedure with aspect

2017-09-07 Thread Arnaud Charlet
This patch improve the error reporting on a null procedure with misplaced aspect specification, which the parser first attempts to interpret as a malformed expression function, in spite of the initial keyword in the declaration. Compiling --- package Null_Proc_With_Contract is procedu

[Ada] Finalization for b-i-p that raises exception

2017-09-07 Thread Arnaud Charlet
This patch fixes a bug where if a limited object is initialized with a build-in-place function call, and the call does not return on the secondary stack, and the function raises an exception, so that the object is not (successfully) created, the uninitialized object is incorrectly finalized. The f

[Ada] Fix internal error on task allocation and inlining

2017-09-07 Thread Arnaud Charlet
This fixes a small regression introduced by the recent improvement to the algorithm used by Hide_Public_Entities to compute the final set of external visible entities of a package. It now needs to recurse on the Actions list of freeze nodes to find references to subprograms. The following procedu

[Ada] Avoid secondary stack for nondispatching build-in-place calls

2017-09-07 Thread Arnaud Charlet
This patch fixes a performance regression. The compiler was using the secondary stack for a nondispatching build-in-place call, which is unnecessary, and indeed older compilers did not do so. The compiler no longer uses the secondary stack for such calls. Note that the secondary stack is necessary

[Ada] Spurious errors on dynamic predicates and private declarations.

2017-09-07 Thread Arnaud Charlet
This patch fixes spurious visibility errors on the expression for a dynamic predicate in a subtype declaration, when the enclosing package includes private declarations. The following packages much compile quietly: --- package foo is type Kind_Type is (None, Known); type Auction_State_Ty

[Ada] Fix handling of ghost entity in predicate

2017-09-07 Thread Arnaud Charlet
Ghost types are allowed to mention ghost entities in their predicate. Because Ghost is propagated from type to the generated predicate function, GNAT correctly identified valid from invalid cases, but this modification simplifies the reason for correction. Tested on x86_64-pc-linux-gnu, committed

[Ada] Fix internal error on package instantiation and inlining

2017-09-07 Thread Arnaud Charlet
This fixes a small regression introduced by the recent improvement to the algorithm used by Hide_Public_Entities to compute the final set of external visible entities of a package. Subprogram renamings not only need to be dealt with as declaring a subprogram but also as referencing another one. T

[Ada] Spurious error in precondition and classwide parameter

2017-09-07 Thread Arnaud Charlet
This patch fixes a spurious error on a classwide precondition for a subprogram S that is a primitive of some type T, when the precondition includes a dispatching call on a classwide formal of S whose type is urelated to T. The following must compile quietly: gnatmake -q main --- with Derived_

[Ada] Return raise with access class-wide interface

2017-09-07 Thread Arnaud Charlet
This patches fixes a bug in which a function returns an anonymous access type whose designated type is a class-wide interface type, and the return statement returns a raise expression, the compiler crashes. Tested on x86_64-pc-linux-gnu, committed on trunk 2017-09-07 Bob Duff * sem_ch

[Ada] Adding switch to disable implicit Elaborate_All in task case

2017-09-07 Thread Arnaud Charlet
This patch adds switch -gnatd.y to disable the generation of implicit Elaborate_All on a package X when a task body calls a procedure in the same package, and that procedure calls a procedure in another package X. As documented in the GNAT User Guide, when sources cannot be modified, the recommend

[Ada] Proper handling of dimension information in a type conversion.

2017-09-07 Thread Arnaud Charlet
This patch implements the proper handling of dimension information on type conversions. Given a conversion T (Expr), where the expression has type TE, the following cases arise: a) If TE has dimension information, the dimensions of the conversion are those of TE. b) If TE has no dimension informa

[Ada] Use of renamings of function results in SPARK annotations

2017-09-08 Thread Arnaud Charlet
This patch changes the expansion of object renamings in SPARK to reuse the entity associated with the renaming when the name denotes a function call. The patch also modifies a routine used to extract the entity of references to abstract states and whole objects to handle renamings of function resul

[Ada] Small fix for couple of internal glitches with record layout

2017-09-08 Thread Arnaud Charlet
This change ensures that (1) -gnatR always displays the record layout that was used internally by the compiler for code generation and (2) the record layout is fully adjusted internally when the reverse bit order is specified. No functional changes expected because the first issue was papering ove

[Ada] Infinite loop on an interface conversion involving private extensions.

2017-09-08 Thread Arnaud Charlet
This patch fixes a loop in the compiler, on an interface conversion from an interface declared as a synchronized private extension to one of its ancestors. databases-instantiations,adb below must compile quietly: --- package body Databases.Generics is New_Data_ID : Data_ID_Type := 1; prote

<    2   3   4   5   6   7   8   9   10   11   >