[PATCH] c-pragma: adding a data field to pragma_handler

2011-06-01 Thread Pierre
field might be of general use: we can have condition or data at register time that we want to express in the handler. I guess this is a common way to pass data to an handler function. I would like your opinion on this patch! Thanks! Pierre Vittet Changelog 2011-06-01 Pierre Vittet * c

Re: [PATCH, MELT] correct meltgc_read_from_val without location

2011-06-29 Thread Pierre
, conducting to avoid crash. I have been able to build MELT with this pass and test it without problem. On 24/06/2011 18:13, Pierre Vittet wrote: Hello, The function meltgc_read_from_val (in melt-runtime.c) takes two arguments, a string value and a second one which is a location. In the comments

Re: [GCC-MELT-95] [Melt] Fix foreach_edge_bb_precs

2011-07-26 Thread Pierre
wrote the initial iterator and agree with your change. I guess Basile will commit it soon. Pierre

[PATCH, MELT] fixing upgrade-warmelt target

2011-08-27 Thread Pierre Vittet
beyond (but there are still issues. Pierre Vittet Index: melt-build.tpl === --- melt-build.tpl (révision 178131) +++ melt-build.tpl (copie de travail) @@ -579,7 +579,7 @@ ENDFOR melt_translator_file+] [+FOR melt_translator_file

Re: [PATCH, MELT, minor] add a primitive read_strv

2011-08-30 Thread Pierre Vittet
of a strbuf. Pierre Vittet Index: gcc/melt/warmelt-base.melt === --- gcc/melt/warmelt-base.melt (revision 176434) +++ gcc/melt/warmelt-base.melt (working copy) @@ -272,6 +272,11 @@ number $NUM opaque location number $LOC.}# :doc

[PATCH, MELT] add primitive isnull_tree

2011-08-30 Thread Pierre Vittet
Hello, This is a small patch adding primitive isnull_tree (as there is already a primitive isnull_basicblock). Pierre Vittet Index: gcc/melt/xtramelt-ana-base.melt === --- gcc/melt/xtramelt-ana-base.melt (révision 178282

[PATCH, libiberty] correct md5_process_bytes with unaligned pointers

2011-09-16 Thread Pierre Vittet
the code. I searched on google, and it does not looks to be used. Does anyone want it or thing that it should not be removed? Ok for trunk ? Thanks! Pierre Vittet PS: I also write a small gcc plugin, allowing to easily test md5_process_bytes, if can change your environment in a way where the

Re: [PATCH, libiberty] correct md5_process_bytes with unaligned pointers

2011-09-19 Thread Pierre Vittet
Hello, Ping! I would like to get a return on this patch. I don't know quite well the status of libiberty in GNU, please if I must this patch on another mailing list, please say me on which. Thanks! Pierre Vittet

[PATCH, MELT] correct meltgc_string_hex_md5sum_file_sequence

2011-09-19 Thread Pierre Vittet
multiple of 64 size, so we can call md5_process_block. We only call md5_process_bytes for the last data. Thanks! Pierre Vittet 2011-09-19 Pierre Vittet * melt-runtime.c (meltgc_string_hex_md5sum_file_sequence): Concatenate files stream to call md5_process_block, we only call

[PATCH, MELT] add pragma support in MELT plugin

2011-05-31 Thread Pierre Vittet
sg val1 "debugging melt pragma") ) (put_fields initial_system_data :sysdata_meltpragma_definer my_simple_pragma_handler ) Pierre Vittet Index: gcc/melt/warmelt-first.melt === --- gcc/melt/warmelt-first.melt (revision

Re: [PATCH] c-pragma: adding a data field to pragma_handler

2011-06-03 Thread Pierre Vittet
ws to keep a more clear code. I can do it, if you think it is better. I have successfully compiled gcc with my patch and I have tried it with a modified version of gcc/testsuite/g++.dg/plugin/pragma_plugin.c. Pierre Vittet On 02/06/2011 19:51, Tom Tromey wrote: "Pierre" ==

Re: [PATCH] c-pragma: adding a data field to pragma_handler

2011-06-03 Thread Pierre Vittet
comfortable with it for now ;). Pierre Vittet On 03/06/2011 17:47, Basile Starynkevitch wrote: On Fri, 03 Jun 2011 17:31:25 +0200 Pierre Vittet wrote: Thank you for your answer! I send you a new patch I have corrected the errors you raised. I have make my patch compatible with the old use of

Re: [PATCH] c-pragma: adding a data field to pragma_handler

2011-06-08 Thread Pierre Vittet
remark, please, send me it. Especially, I am not sure about the format of my ChangeLog, if there is an issue, I am ready to change it. Changelog gcc: 2011-06-08 Pierre Vittet * c-pragma.h (pragma_handler_1arg, pragma_handler_2arg, gen_pragma_handler, internal_pragma_handler

Re: [PATCH] c-pragma: adding a data field to pragma_handler

2011-06-09 Thread Pierre Vittet
end passes). Thanks. On 09/06/2011 08:16, Basile Starynkevitch wrote: On Wed, 08 Jun 2011 23:26:39 +0200 Pierre Vittet wrote: I have written a test for this patch and run it (it works correctly). I guess there is no reason why it should not be accepted now. To recap, this patch add a v

Re: [PATCH] c-pragma: adding a data field to pragma_handler

2011-06-10 Thread Pierre Vittet
thanks! I formatted as you requested. I cannot commit myself as I haven't a "write after approval" status, maye you can do it, or I can wait my GSOC mentor, Basile Starynkevitch to do this (He mights be busy for a few days). Pierre Vittet Index: gcc/c-fa

Re: [PATCH] c-pragma: adding a data field to pragma_handler

2011-06-10 Thread Pierre Vittet
I guess this is better now. Changelog (gcc/c-family): 2011-06-10 Pierre Vittet * c-pragma.h (pragma_handler_1arg, pragma_handler_2arg): New handler. (gen_pragma_handler): New union. (internal_pragma_handler): New type. (c_register_pragma_with_data

[APPROVED PATCH] c-pragma: adding a data field to pragma_handler

2011-06-17 Thread Pierre Vittet
Thoses two patchs have already been approved (see http://gcc.gnu.org/ml/gcc-patches/2011-06/msg01159.html). I haven't write permission currently, could someone commit them? ChangeLogs have to be applied on gcc/c-family/ChangeLog . Thanks ! Pierre Vittet Index: gcc/c-family/c-pra

[PATCH, MELT] fix minor issue with meltgc_new_split_string

2011-06-21 Thread Pierre Vittet
by another. I took this opportunity to add a small comment to the function (in the second diff). ChangeLog 2011-06-21 Pierre Vittet * melt-runtime.c (meltgc_new_split_string): Fix issue. 2011-06-21 Pierre Vittet * melt-runtime.c (meltgc_new_split_string): Add comment.

[PATCH, MELT] loading extra module before setting options

2011-06-23 Thread Pierre Vittet
change has been compiled and tested without errors. ChangeLog: 2011-06-22 Pierre Vittet * melt-runtime.c (load_melt_modules_and_do_mode): load extra module before setting options Pierre Vittet Index: gcc/melt-runtime.c

[PATCH, MELT] pragma support in MELT

2011-06-24 Thread Pierre Vittet
as parameters. For GCC<=4.6, there is a minimal pragma support, we can handle following pragma: #pragma GCCPLUGIN melt (,...) with only melt as name. ChangeLog: 2011-06-24 Pierre Vittet * melt-runtime.c (GCC_PRAGMA_BAD): Macro to return an error from the pragma handling

[PATCH, MELT] correct meltgc_read_from_val without location

2011-06-24 Thread Pierre Vittet
doesn't handle correctly the absence of file. This patch correct this, if there is no file, it create a "virtual" one which is named "stringBuffer". Pierre Vittet Index: gcc/melt-runtime.c === --- gcc/

Re: [PATCH, MELT] pragma support in MELT

2011-07-03 Thread Pierre Vittet
being registered. I also removed the PRAGMA_BAD macro as it was said to be less readable, and changed malformed pragma warnings into errors. I tested the patch without seing any error or regression. Pierre Vittet 2011-07-03 Pierre Vittet * melt-runtime.c: include c-pragma.h

Re: C++ mangling, function name to mangled name (or tree)

2011-07-06 Thread Pierre Vittet
On 06/07/2011 18:25, Kevin André wrote: On Wed, Jul 6, 2011 at 18:00, Pierre Vittet wrote: I would like user of the plugin to give in arguments the name of the functions on which he would like a test to be run. That means that I must convert the string containing a function name (like

[PATCH, MELT] new function register_data_handler

2011-07-07 Thread Pierre Vittet
care, as we can only register a single pragma named "melt" (maybe we could use another function specially for 4.6 ?). Thanks! Pierre Vittet 2011-07-07 Pierre Vittet * melt/warmelt-base.melt (register_pragma_handler ): new function. Index: gcc/melt/warmelt

[PATH, MELT] correct makefile, install-default-module-list

2011-07-15 Thread Pierre Vittet
/melt-default-modules-*.modlis was incorrect, a ';' was missing in the install instruction. Pierre Vittet 2011-07-15 Pierre Vittet * Makefile.in (install-melt-default-modules-list): Fix bad file call. Index:

[PATCH, MELT] Add PRE_GENERICIZE callback support in MELT

2011-07-15 Thread Pierre Vittet
warmelt-upgrade must be run in order to regenerate generated melt files. The add_pre_genericize_hook patch add a function (in melt-runtime.c) to be called on PLUGIN_PRE_GENERICIZE, which call the closure sysdata_pre_genericize defined by the users. Thanks Pierre Vittet 2011-07-15 Pierre

Re: [PATCH, MELT] Add PRE_GENERICIZE callback support in MELT

2011-07-16 Thread Pierre Vittet
Right, here is the new version of the patch (with the correct files). I added, a function register_pre_genericize_hook in melt/warmelt-base.melt to be called when we want to register a MELT function to handle the callback, so we don't manually set sysdata_pre_genericize field. Pierre V

[PATCH, MELT, minor] add a primitive read_strv

2011-07-19 Thread Pierre Vittet
Hello, This minor patch add a primitive to get a list of s-expression from a boxed C string of a strbuf. This is only the MELT part, as the called C code was already written. I compiled and test it. Thanks! Pierre Vittet 2011-07-18 Pierre Vittet * melt/warmelt-base.melt

[PATCH, MELT] correct function meltgc_string_hex_md5sum_file_sequence

2011-07-27 Thread Pierre Vittet
Hello, this patch correct the function meltgc_string_hex_md5sum_file_sequence, it now returns the same than "cat myfile1 myfile2 ... | md5sum". fread was not correctly used + it looks like you can't mix function md5_process_bytes and md5_process_blocks. Pierre Vittet

[PATCH, MELT] fix useless forcing of GCC garbage collector

2011-05-09 Thread Pierre Vittet
ing a MELT plugin with the patched version). I have also measured a small time improvement while compiling the file gcc.c (which is more that 8000 lines): Whithout the modification: usersys 1.563 0.145s With the modification: usersys 1.144 0.106s Changelog: 2011-05-09 Pierre V

Re: [PATCH, MELT] fix useless forcing of GCC garbage collector

2011-05-09 Thread Pierre Vittet
Thanks you for the correction, I will take care next time. Pierre On 09/05/2011 19:03, Basile Starynkevitch wrote: On Mon, 09 May 2011 14:15:30 +0200 Pierre Vittet wrote: This patch is for the MELT branch. The diff file was slightly wrong (diff run under gcc/). Pierre, you should

Re: [PATCH] comment precising need to use free_dominance_info

2011-05-17 Thread Pierre Vittet
So maybe this patch adding a comment on calculate_dominance_info is more adapted. ChangeLog: 2011-05-17 Pierre Vittet * dominance.c (calculate_dominance_info): Add comment precising when to free with free_dominance_info contributor number: 634276 Index: gcc/dominance.c

[PATCH, MELT] correcting path error in the Makefile.in

2011-05-17 Thread Pierre Vittet
This patch correct a bug in the current revision of MELT, which was preventing MELT to run correctly. This was a path problem in gcc/Makefile.in (melt-modules/ and melt-modules.mk) were not found. My contributor number is 634276. changelog : 2011-05-17 Pierre Vittet

[PATCH, MELT] add dominance functions

2011-05-18 Thread Pierre Vittet
se it). Unsafe functions are only for internal use and so are not exported. I have compiled GCC MELT with the patch and successfully test the functions. Changelog: 2011-05-17 Pierre Vittet * melt/xtramelt-ana-base.melt (is_dominance_info_available, is_post_dominance_info_avai

Re: [PATCH, MELT] add dominance functions

2011-05-20 Thread Pierre Vittet
that it puts an end of lines between the two informations. If you think there is a best way to do this, I am ok to try it. The new changelog: 2011-05-20 Pierre Vittet * melt/xtramelt-ana-base.melt (is_dominance_info_available, is_post_dominance_info_available

[Patch] get an order number on -fdump-tree-all

2011-03-23 Thread Pierre Vittet
function print_current_pass is only called on a fail and that debug_pass doesn't appear to be called at all. Maybe in DEBUG, or at least with an f*_dump_all, we could print the order of the pass. thanks Pierre Vittet Index: gcc/tree-d

[PATCH] build: Check for cargo when building rust language

2024-04-08 Thread pierre-emmanuel . patry
From: Pierre-Emmanuel Patry Hello, The rust frontend requires cargo to build some of it's components, it's presence was not checked during configuration. Best regards, Pierre-Emmanuel -- Prevent rust language from building when cargo is missing. config/ChangeLog:

Re: libgrust: 'AM_ENABLE_MULTILIB' only for target builds [PR113056]

2024-01-04 Thread Pierre-Emmanuel Patry
push the attached "libgrust: 'AM_ENABLE_MULTILIB' only for target builds [PR113056]"? These changes make sense, I'm fine with those being pushed. Regards, -- Patry Pierre-Emmanuel Compiler Engineer - Embecosm OpenPGP_0xD006124B2A7AEA23.asc Descri

Re: build: Don't check for host-prefixed 'cargo' program

2024-04-15 Thread Pierre-Emmanuel Patry
This is a mistake, we should use 'AC_CHECK_PROG'. OK to push "build: Don't check for host-prefixed 'cargo' program", see attached? Yes, attached patch looks good, thank you! Regards, -- Patry Pierre-Emmanuel Compiler Engineer - Embecosm

Re: build: Use of cargo not yet supported here in Canadian cross configurations

2024-04-15 Thread Pierre-Emmanuel Patry
imply wait for gcc to be able to compile those components entirely. Regards, -- Patry Pierre-Emmanuel Compiler Engineer - Embecosm OpenPGP_0xD006124B2A7AEA23.asc Description: OpenPGP public key OpenPGP_signature.asc Description: OpenPGP digital signature

Re: [PATCH, Ada] RISC-V: Initial riscv linux Ada port.

2018-07-12 Thread Pierre-Marie de Rodat
there, and I'd like to get back to working on that as soon as possible. No clue about debug11.adb, maybe Pierre-Marie could shed some light on it. I don’t have much more to say than debug11.adb’s comment ;-) This testcase checks that in the DWARF description of the variant type be

Re: [PATCH, Ada] RISC-V: Initial riscv linux Ada port.

2018-07-12 Thread Pierre-Marie de Rodat
cases. Maybe for some reason we don’t create the correct debug type in the Ada front end… Do you think I can reproduce this with a x86_64-linux compiler targetting something like riscv-elf? I don’t have access to a RISC-V board on which to build GCC. -- Pierre-Marie de Rodat

[Ada] Adjust growth factor from 1/32 to 1/2 for Unbounded_String

2018-07-16 Thread Pierre-Marie de Rodat
This will reduce significantly the number of allocations done when doing consecutive append operations. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-16 Nicolas Roche gcc/ada/ * libgnat/a-strunb.adb, libgnat/a-strunb__shared.adb: Adjust growth factor from 1/32 to

[Ada] Illegal deferred constant causes stack overflow

2018-07-16 Thread Pierre-Marie de Rodat
This patch prevents the compiler from entering infinite recursion when processing an illegal deferred constant. -- Source -- -- types.ads package Types is type Enum is (One, Two); end Types; -- types2.ads with Types; package Types2 is type Enum is private;

[Ada] Violation of No_Standard_Allocators_After_Elaboration not detected

2018-07-16 Thread Pierre-Marie de Rodat
The compiler fails to generate a call to detect allocators executed after elaboration in cases where the allocator is associated with Global_Pool_Object. The fix is to test for this associated storage pool as part of the condition for generating a call to System.Elaboration_Allocators.Check_Standar

[Ada] Adjust inlining in GNATprove mode for predicate/invariant/DIC

2018-07-16 Thread Pierre-Marie de Rodat
The frontend generates special functions for checking subtype predicates, type invariants and Default_Initial_Condition aspect. These are translated as predicates in GNATprove, and as such should no call inside these functions should be inlined. This is similar to the existing handling of calls ins

[Ada] Bit_Order cannot be defined for record extensions

2018-07-16 Thread Pierre-Marie de Rodat
This patch allows the compiler to report an error on Bit_Order when defined for a record extension. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-16 Javier Miranda gcc/ada/ * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Report an error on Bit_Order when def

[Ada] Crash processing sources under GNATprove debug mode

2018-07-16 Thread Pierre-Marie de Rodat
Processing sources under -gnatd.F the frontend may crash on an iterator of the form 'for X of ...' over an array if the iterator is located in an inlined subprogram. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-16 Javier Miranda gcc/ada/ * exp_ch5.adb (Expand_Iterator_Lo

[Ada] Segmentation_Fault with Integer'Wide_Wide_Value

2018-07-16 Thread Pierre-Marie de Rodat
This patch updates the routines which produce Wide_String and Wide_Wide_String from a String to construct a result of the proper maximum size which is later sliced. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-16 Hristian Kirtchev gcc/ada/ * libgnat/s-wchwts.adb (Wide_St

[Ada] Code cleanup on functions inlining

2018-07-16 Thread Pierre-Marie de Rodat
This patch is preventive: it improves checks on inline functions that return unconstrained type. It does not change the functionality of the compiler. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-16 Javier Miranda gcc/ada/ * inline.adb (Build_Body_To_Inline): Minor code

[Ada] Spurious possible contraint error warning with No_Exception_Propagation

2018-07-16 Thread Pierre-Marie de Rodat
This patch corrects an issue whereby spurious unhandled exception warnings on integer literals within static if and case expressions would be emitted when the restriction No_Exception_Propagation is enabled. -- Source -- -- gnat.adc pragma Restrictions (No_Exception_Pr

[Ada] Crash on Indefinite_Hashed_Maps with -gnata -gnateV

2018-07-16 Thread Pierre-Marie de Rodat
This patch corrects the generation of helper functions which verify the validity of record type scalar discriminants and scalar components when switches -gnata (assertions enabled) and -gnateV (validity checks on subprogram parameters) are in effect. Tested on x86_64-pc-linux-gnu, committed on tru

[Ada] Deconstruct always-false calls to Withed_Body in Walk_Library_Items

2018-07-16 Thread Pierre-Marie de Rodat
We previously removed the calls to Set_Withed_Body; this commit deconstructs calls to Withed_Body, which always returned False. The Set_Withed_Body/Withed_Body were helping the Walk_Library_Items routine traverse the AST of several compilation units such that declarations are visited before refere

[Ada] Spurious error with null Abstract_State

2018-07-16 Thread Pierre-Marie de Rodat
This patch corrects the mechanism which ensures that a package with a null Abstract_State does not introduce hidden state, by ignoring internal states and variables because they do not represent the "source" hidden state. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-16 Hristian Kirt

[Ada] Avoid crash when traversing units with -gnatd.WW debug switch

2018-07-16 Thread Pierre-Marie de Rodat
The debug switch -gnatd.WW enables extra info when traversing library units with Walk_Library_Items, which is used in the CodePeer and GNATprove. This routine was crashing when trying to print info about a unit with configuration pragmas (typically an .adc file). Now fixed. No test, as the crash o

[Ada] Deconstruct unused Withed_Body filed of N_With_Clause node

2018-07-16 Thread Pierre-Marie de Rodat
The Withed_Body field was added to N_With_Clause node to help the Walk_Library_Items routine, which was created for the CodePeer backend and later adopted by the GNATprove. This routine is meant to traverse all library units, such that declarations are visited before references. However, for compl

[Ada] Missing error on hidden state in instantiation

2018-07-16 Thread Pierre-Marie de Rodat
This patch modifies the analysis of package contracts to split processing which is specific to package instantiations on its own. As a result, the lack of indicator Part_Of can now be properly assessed. -- Source -- -- gen_pack.ads generic package Gen_Pack is Pack_V

[Ada] Fix Next_Actual when used on calls "inlined for proof"

2018-07-17 Thread Pierre-Marie de Rodat
The GNATprove backend needs to apply antialiasing checks to subprogram calls that have been rewritten into null statements while "inlining for proof". This requires the First_Actual/Next_Actual to use the Original_Node and not the N_Null_Statement that rewriting leaves as a parent. Only effective

[Ada] Add elaboration-related switches to GNAT UGN

2018-07-17 Thread Pierre-Marie de Rodat
This patch adds compiler switches -gnatH and -gnatJ to section "Alphabetical list of all switches" of the GNAT User Guide for Native. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-17 Hristian Kirtchev gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add

[Ada] Secondary stack leak in loop iterator

2018-07-17 Thread Pierre-Marie de Rodat
When the evaluation of the loop iterator invokes a function whose result relies on the secondary stack the compiler does not generate code to release the consumed memory as soon as the loop terminates. After this patch the following test works fine. with Text_IO; use Text_IO; pragma Warnings (Off

[Ada] Attach the special GNATprove HEAP entity to the Standard package

2018-07-17 Thread Pierre-Marie de Rodat
In GNATprove mode we use frontend cross-references to synthesize the Global contract of subprograms with SPARK_Mode => Off and represent a read/write via a pointer as a read/write of a special entity called HEAP. This entity is now attached to the Standard package, so that we can safely check the E

[Ada] Crash on case expression in build-in-place function

2018-07-17 Thread Pierre-Marie de Rodat
This patch modifies the recursive tree replication routine New_Copy_Tree to create new entities and remap old entities to the new ones for constructs in N_Expression_With_Actions nodes when requested by a caller. This in turn allows the build-in-place mechanism to avoid sharing entities between the

[Ada] New ignored Ghost code removal mechanism

2018-07-17 Thread Pierre-Marie de Rodat
This patch reimplements the mechanism which removes ignored Ghost code from the tree. The previous mechanism proved to be unreliable because it assumed that no new scoping constructs would be created after some ignored Ghost code had already notified its enclosing scoping constructs that they cont

[Ada] Spurious error on unused Part_Of constituent

2018-07-17 Thread Pierre-Marie de Rodat
This patch updates the analysis of indicator Part_Of (or the lack thereof), to ignore generic formal parameters for purposes of determining the visible state space because they are not visible outside the generic and related instances. -- Source -- -- gen_pack.ads gene

[Ada] Secondary stack leak in statements block located in a loop

2018-07-17 Thread Pierre-Marie de Rodat
When a loop iterator has a block declaration containing statements that invoke functions whose result is returned on the secondary stack (such as a string-returning function), the compiler fails to generate code to release the allocated memory when the loop terminates. After this patch the followi

[Ada] Spurious error on Part_Of indicator

2018-07-17 Thread Pierre-Marie de Rodat
This patch modifies the verification of a missing Part_Of indicator to avoid considering constants as visible state of a package instantiation because the compiler cannot determine whether their values depend on variable input. This diagnostic is left to GNATprove. -- Source -- --

[Ada] Avoid confusing warning on exception propagation in GNATprove mode

2018-07-17 Thread Pierre-Marie de Rodat
When compiling with the restriction No_Exception_Propagation, GNAT compiler may issue a warning about exceptions not being propagated. This warning is useless and confusing to users for GNATprove analysis, as GNATprove precisely detects possible exceptions, so disable the warning in that mode. Tes

[Ada] Crash processing abstract state aspect of a package

2018-07-17 Thread Pierre-Marie de Rodat
The compiler may crash processing an aspect Part_Of used in a package spec which has also an Initial_Condition aspect. After this patch the following test compiles fine. package P with SPARK_Mode => On, Abstract_State => (Count_State), Initial_Condition => (Get_Count = 0) -- Tes

[Ada] Missing check on illegal equality operation in subprogram

2018-07-17 Thread Pierre-Marie de Rodat
In Ada2012 it is illegal to declare an equality operation on an untagged type when the operation is primitive and the type is already frozem (see RM 4.5.2 (9.8)). previously the test to detect this illegality only examined declarations within a package. This patch covers the case where type and ope

[Ada] Argument_String_To_List creates empty items from whitespace

2018-07-17 Thread Pierre-Marie de Rodat
This patch corrects an issue whereby leading whitespace in a non-quoted argument list passed to Argument_String_To_List caused extraneous empty arguments to be returned. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-17 Justin Squirek gcc/ada/ * libgnat/s-os_lib.adb (Argum

[Ada] Minor fix for imported C++ constructors

2018-07-17 Thread Pierre-Marie de Rodat
C++ constructors are imported as functions and then internally rewritten into procedures taking the "this" pointer as first parameter. Now this parameter is not of an access type but of the type directly, so it must be In/Out and not just In. Tested on x86_64-pc-linux-gnu, committed on trunk 201

[Ada] Assertion_Policy for class-wide precondition

2018-07-17 Thread Pierre-Marie de Rodat
This patch fixes the compiler to that class-wide preconditions on primitive operations of interfaces are not checked at run time when the Assertion_Policy indicates that they should be ignored. This is required by the RM. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-17 Bob Duff g

[Ada] Configuration state not observed for instance bodies

2018-07-17 Thread Pierre-Marie de Rodat
This patch ensures that the processing of instantiated and inlined bodies uses the proper configuration context available at the point of the instantiation or inlining. Previously configuration pragmas which appear prior to the context items of a unit would lose their effect when a body is instant

[Ada] Use standard version of s-memory.adb for mingw32

2018-07-17 Thread Pierre-Marie de Rodat
This patch switches mingw32 targets to use the standard version of s-memory.adb as Windows now has the capability of limiting the amount of memory used by process. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-17 Patrick Bernardi gcc/ada/ * libgnat/s-memory__mingw.adb: Re

[Ada] Faulty ignored Ghost code removal

2018-07-17 Thread Pierre-Marie de Rodat
This patch ensures that removal of ignored Ghost code is the absolute last operation performed on the tree. Previously the removal was performed prior to issuing delayed warnings, however the warning mechanism may see a heavily modified tree and fail. No small reproducer available. Tested on x86_

[Ada] Fix incompatibility Default_Scalar_Storage_Order/tagged types

2018-07-17 Thread Pierre-Marie de Rodat
The pragma Default_Scalar_Storage_Order cannot reliably be used to set the non-default scalar storage order for a program that declares tagged types, if it also declares user-defined primitives. This is fixed by making Make_Tags use the same base array type as Make_DT and Make_Secondary_DT when ac

[Ada] Spurious error on prefixed call in an instantiation

2018-07-17 Thread Pierre-Marie de Rodat
This patch fixes a spurious error on a prefixed call in an instance, when the generic parameters include an interface type and an abstract operation of that type, and the actuals in the instance include an interface type and a corresponding abstract operation of it, with a different name than the c

[Ada] Spurious error -- "allocation from empty storage pool"

2018-07-31 Thread Pierre-Marie de Rodat
This patch fixes a bug in which if "pragma Default_Storage_Pool (null);" is given, then a build-in-place function will get an incorrect error message "allocation from empty storage pool" even though there is no such allocation in the source program. Tested on x86_64-pc-linux-gnu, committed on trun

[Ada] Deconstruct 'F' as a prefix for an ALI data

2018-07-31 Thread Pierre-Marie de Rodat
In GNATprove we used to store a variant of cross-reference information in the ALI file in lines that started with an 'F' letter. This is no longer the case, so the letter can be returned to the pool of unused prefixes. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-31 Piotr Trojanek

[Ada] Spurious warning on iteration over range of 64-bit modular type

2018-07-31 Thread Pierre-Marie de Rodat
This patch suppresses a spurious warning on the use of a 64-bit modular type in a quantified expression, where the range of iteration will include a bound that appears larger than the run-time representation of Universal_Integer'last. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-31

[Ada] Replace low-level calls to Ekind with high-level calls to Is_Formal

2018-07-31 Thread Pierre-Marie de Rodat
High-level wrappers are easier to read. This change came up while reading some code related to GNATprove, but then uniformly applied to the entire frontend. For the few remaining membership tests that could be replaced by Is_Formal it is not obvious whether the high-level routine makes the code bet

[Ada] Compiler failure on an extended_return_statement in a block

2018-07-31 Thread Pierre-Marie de Rodat
When compiling with an assertion-enabled compiler, Assert_Failure can be raised when expanded an extended_return_statement whose enclosing scope is not a function (such as when it's a block_statement). The simple fix is to change the Assert to test Current_Subprogram rather than Current_Scope. Thre

[Ada] Spurious error on the placement of aspect Global

2018-07-31 Thread Pierre-Marie de Rodat
This patch modifies the expansion of stand-alone subprogram bodies that appear in the body of a protected type to properly associate aspects and pragmas to the newly created spec for the subprogram body. As a result, the annotations are properly associated with the initial declaration of the subpro

[Ada] Wrong value after assignment of overlain record objects

2018-07-31 Thread Pierre-Marie de Rodat
This patch corrects an issue whereby objects of a record type with a representation clause which are overlain by address would fail to get assigned values properly when one or both of said objects were marked volatile. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-31 Justin Squirek

[Ada] Fix alignment of mutex_t and cond_t type on 32-bit SPARC/Solaris

2018-07-31 Thread Pierre-Marie de Rodat
The alignment of the couple of types from System.OS_Interface was wrongly set to 4 (32-bit) instead of 8 (64-bit) in 32-bit mode. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-31 Eric Botcazou gcc/ada/ * libgnarl/s-osinte__solaris.ads (upad64_t): New private type.

[Ada] Spurious error on default parameter in protected operation

2018-07-31 Thread Pierre-Marie de Rodat
This patch fixes a spurious compiler error on a call to a protected operation whose profile includes a defaulted in-parameter that is a call to another protected function of the same object. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-07-31 Ed Schonberg gcc/ada/ * exp_ch6.

[Ada] GNATmake fails to detect missing body

2018-07-31 Thread Pierre-Marie de Rodat
This patch corrects an issue whereby building a multi-unit compilation with missing sources resulted in a cryptic "code generation" error instead of the appropriate file not found error. -- Source -- -- main.adb with Types; procedure Main is begin null; end; -- ty

[Ada] Secondary stack leak with access-to-subprogram

2018-07-31 Thread Pierre-Marie de Rodat
This patch modifies call resolution to recognize when the designated type of an access-to-subprogram requires secondary stack management, and establish the proper transient block. -- Source -- -- leak7.adb procedure Leak7 is Max_Iterations : constant := 10_000;

[Ada] Remove inappropriate test from Is_By_Reference_Type

2021-09-20 Thread Pierre-Marie de Rodat
The result returned by the predicate may change depending on whether an error was posted on the type, which complicates further error reporting. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_aux.adb (Is_By_Reference_Type): Do not test Error_Posted.diff --git a/gcc/ada/

[Ada] usage.adb: make -gnatw.c description clearer

2021-09-20 Thread Pierre-Marie de Rodat
The term "unrepped" can be hard to understand for users. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * usage.adb (Usage): Update -gnatw.c messages.diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb --- a/gcc/ada/usage.adb +++ b/gcc/ada/usage.adb @@ -483,8 +483,10 @@ begin

[Ada] Move Build_And_Insert_Cuda_Initialization to Expand_CUDA_Package

2021-09-20 Thread Pierre-Marie de Rodat
This commit makes Build_And_Insert_Cuda_Initialization an internal procedure and creates a new Expand_CUDA_Package procedure which calls Build_And_Insert_Cuda_Initialization. This is a small, self-contained refactoring that does not impact any feature or fix any bug - it just makes future commits

[Ada] Only assign type to op if compatible

2021-09-20 Thread Pierre-Marie de Rodat
Before this commit, the following program would make the compiler crash: procedure Main is ConstantString1 : aliased String := "Class1"; My_Access : access String := ConstantString1'Access; begin if "Class1" = My_Access then null; end if; end Main; This was because when an acces

[Ada] Refactor scan_backend_switch to share logic across backends

2021-09-20 Thread Pierre-Marie de Rodat
This commit refactors scan_backend_switch to share logic across adabkend.adb and back_end.adb. A side effect of this refactor is that `-fdump-diagnostics-format` is now available with other backends. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * adabkend.adb (Scan_Back_End

[Ada] Spurious accessibility error on allocator in generic instance

2021-09-20 Thread Pierre-Marie de Rodat
This patch fixes an error in the compiler whereby an allocator for a limited type within a generic instance may cause spurious compile-time warnings and run-time errors. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch4.adb (Expand_N_Type_Conversion): Add guard to prot

[Ada] Fix assertion in GNATprove_Mode

2021-09-20 Thread Pierre-Marie de Rodat
Avoid calling List_Rep_Info in Generate_SCIL and GNATprove_Mode, because the representation info is not there. Otherwise, we fail an assertion. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gnat1drv.adb (Gnat1drv): Avoid calling List_Rep_Info in Generate_SCIL and G

[Ada] Don't examine all discriminants when looking for the first one

2021-09-20 Thread Pierre-Marie de Rodat
A minor performance improvement; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch3.adb (Build_Discriminant_Constraints): Exit once a first discriminant is found and the Discrim_Present flag is set.diff --git a/gcc/ada/sem_ch3.adb b/gcc/

[Ada] Work around CodePeer bug by declaring variable

2021-09-20 Thread Pierre-Marie de Rodat
This commit works around a CodePeer bug where CodePeer thinks Get_32_Bit_Val returns something uninitialized. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * atree.adb (Get_32_Bit_Field): Declare result before returning.diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb ---

[Ada] Small cleanup in System.Dwarf_Line

2021-09-20 Thread Pierre-Marie de Rodat
The unit has got "with" and "use" clauses both for Ada.Exceptions.Traceback and System.Traceback_Entries, but the former is essentially a forwarder for the latter so can be eliminated. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-dwalin.ads: Remove clause for Ad

[Ada] Implementation of Preelaborable_Initialization attribute for AI12-0409

2021-09-20 Thread Pierre-Marie de Rodat
This set of changes implements the Preelaborable_Initialization attribute, corresponding to the existing aspect/pragma, as defined by AI12-0409 (RM2022 10.2.1(11.6/5-11.8/5). This includes semantic checking of restrictions on the prefix, and support for the aspect expression being given by an expre

[Ada] Refine types of local constants that store Etype results

2021-09-20 Thread Pierre-Marie de Rodat
Calls to Etype return entities, even though the signature of the Etype routine says it returns nodes. Fixed automatically with: $ sed -i 's/ Node_Id := Etype/ Entity_Id := Etype/' *.adb Found while reviewing changes in GNATprove related to aliasing checks. Tested on x86_64-pc-linux-gnu, commit

  1   2   3   4   5   6   7   8   9   10   >