aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-11-06c++: correct __has_attribute(init_priority)Patrick Palka2-13/+17
Currently __has_attribute(init_priority) always returns true, even on targets that don't actually support init priorities, and when using the attribute on such targets we just get a hard error about them being unsupported. This makes it impossible to conditionally use the attribute by querying __has_attribute. This patch fixes this by including init_priority in the attribute table only if the target supports init priorities. Thus on such targets __has_attribute(init_priority) will now return false and we'll treat it as just another unrecognized attribute (e.g. using it gives a -Wattribute warning instead of a hard error). gcc/cp/ChangeLog: * tree.cc (cxx_attribute_table): Include init_priority entry only if SUPPORTS_INIT_PRIORITY. (handle_init_priority_attribute): Add ATTRIBUTE_UNUSED. Assert SUPPORTS_INIT_PRIORITY is true. gcc/testsuite/ChangeLog: * g++.dg/special/initpri3.C: New test.
2022-11-06Manually add ChangeLog entries from ↵Jakub Jelinek5-0/+56
r13-3652-ge4cba49413ca429dc82f6aa2e88129ecb3fdd943 This commit caused failure of update_version_git due to the removal of liboffloadmic with ChangeLog in it, so I had to blacklist that commit and here I'm adding ChangeLog entries manually.
2022-11-06Daily bump.GCC Administrator12-1/+616
2022-11-06Add another commit to ignoreJakub Jelinek1-1/+2
We can't handle r13-3652-ge4cba49413ca429dc82f6aa2e88129ecb3fdd943 * gcc-changelog/git_update_version.py: Add e4cba49413ca429dc82f6aa2e88129ecb3fdd943 to ignored commits.
2022-11-06LoongArch: Add fcopysign instructionsXi Ruoyao2-1/+37
Add fcopysign.{s,d} with the names copysign{sf,df}3 so GCC will expand __builtin_copysign{f,} to a single instruction. Link: https://sourceware.org/pipermail/libc-alpha/2022-November/143177.html gcc/ChangeLog: * config/loongarch/loongarch.md (UNSPEC_FCOPYSIGN): New unspec. (type): Add fcopysign. (copysign<mode>3): New instruction template. gcc/testsuite/ChangeLog: * gcc.target/loongarch/fcopysign.c: New test.
2022-11-06Plug memory leak in attribute target_clonesBernhard Reutner-Fischer1-4/+8
It looks like there was some memory leak in the handling of attribute target_clones. Ok for trunk if testing passes? gcc/ChangeLog: * multiple_target.cc (expand_target_clones): Free memory. Signed-off-by: Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
2022-11-06cgraph_node: Remove redundant section clearingBernhard Reutner-Fischer2-2/+0
Ok for trunk if testing passes? gcc/ChangeLog: * cgraph.cc (cgraph_node::make_local): Remove redundant set_section. * multiple_target.cc (create_dispatcher_calls): Likewise. Signed-off-by: Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
2022-11-05d: Adjust test to pass when compiling with -m32Iain Buclaw1-2/+2
Noticed when running on x86_64-linux-gnu with `-m32', this test triggered other errors. Adjusted the test to use a different register that is common between x86 and x86_64. gcc/testsuite/ChangeLog: * gdc.dg/attr_register2.d: Adjust test.
2022-11-05d: Add support for vector comparison operatorsIain Buclaw15-186/+79
The front-end added semantic support to permit comparing two vector expressions. This removes the restriction in the code generator, as well as the intrisics that previously exposed the same operation. gcc/d/ChangeLog: * d-target.cc (Target::isVectorOpSupported): Remove cases for comparison operators. * intrinsics.cc (maybe_set_intrinsic): Remove cases for vector comparison intrinsics. (maybe_warn_intrinsic_mismatch): Likewise. (expand_intrinsic_vec_cond): Remove. (maybe_expand_intrinsic): Remove cases for vector comparison intrinsics. * intrinsics.def (INTRINSIC_EQUALMASK): Remove. (INTRINSIC_NOTEQUALMASK): Remove. (INTRINSIC_GREATERMASK): Remove. (INTRINSIC_GREATEREQUALMASK): Remove. libphobos/ChangeLog: * libdruntime/gcc/simd.d (equalMask): Implement using generics. (notEqualMask): Likewise. (greaterMask): Likewise. (greaterOrEqualMask): Likewise. (notMask): Likewise. (andAndMask): Likewise. (orOrMask): Likewise. gcc/testsuite/ChangeLog: * gdc.dg/Wbuiltin_declaration_mismatch2.d: Remove comparision tests. * gdc.dg/simd2a.d: Update comparison tests. * gdc.dg/simd2b.d: Likewise. * gdc.dg/simd2c.d: Likewise. * gdc.dg/simd2d.d: Likewise. * gdc.dg/simd2e.d: Likewise. * gdc.dg/simd2f.d: Likewise. * gdc.dg/simd2g.d: Likewise. * gdc.dg/simd2h.d: Likewise. * gdc.dg/simd2i.d: Likewise. * gdc.dg/simd2j.d: Likewise.
2022-11-05c++: libcpp: Support raw strings with newlines in directives [PR55971]Lewis Hyatt4-10/+148
It's not currently possible to use a C++11 raw string containing a newline as part of the definition of a macro, or in any other preprocessing directive, such as: #define X R"(two lines)" #error R"(this error has two lines)" Add support for that by relaxing the conditions under which _cpp_get_fresh_line() refuses to get a new line. For the case of lexing a raw string, it's OK to do so as long as there is another line within the current buffer. The code in cpp_get_fresh_line() was refactored into a new function get_fresh_line_impl(), so that the new logic is applied only when processing a raw string and not any other times. libcpp/ChangeLog: PR preprocessor/55971 * lex.cc (get_fresh_line_impl): New function refactoring the code from... (_cpp_get_fresh_line): ...here. (lex_raw_string): Use the new version of get_fresh_line_impl() to support raw strings containing new lines when processing a directive. gcc/testsuite/ChangeLog: PR preprocessor/55971 * c-c++-common/raw-string-directive-1.c: New test. * c-c++-common/raw-string-directive-2.c: New test. gcc/c-family/ChangeLog: PR preprocessor/55971 * c-ppoutput.cc (adjust_for_newlines): Update comment.
2022-11-05libstdc++: fix pointer type exception catch (no RTTI) [PR105387]Jakob Hasse3-1/+94
__pbase_type_info::__do_catch(), used to catch pointer type exceptions, did not check if the type info object to compare against is a pointer type info object before doing a static down-cast to a pointer type info object. If RTTI is disabled, this leads to the following situation: Since a pointer type info object has additional fields, they would end up being undefined if the actual type info object was not a pointer type info object. A simple check has been added before the down-cast happens. Note that a consequence of this check is that exceptions of type pointer-to-member cannot be caught anymore. In case RTTI is enabled, this does not seem to be a problem because RTTI-based checks would run before and prevent running into the bad down-cast. Hence, the fix is disabled if RTTI is enabled and exceptions of type pointer-to-member can still be caught. libstdc++-v3/ChangeLog: PR libstdc++/105387 * libsupc++/pbase_type_info.cc (__do_catch) [!__cpp_rtti]: Add check that the thrown type is actually a pointer. * testsuite/18_support/105387.cc: New test. * testsuite/18_support/105387_memptr.cc: New test. Signed-off-by: Jakob Hasse <jakob.hasse@espressif.com>
2022-11-05libstdc++: Do not use SFINAE for propagate_const conversions [PR107525]Jonathan Wakely2-22/+113
As the PR notes, the current conversion operators are defined as function templates so that we can use SFINAE. But this changes how they are considered for overload resolution. This moves those operators into base classes that can be specialized so the operators are obsent unless the constraints are satisfied. libstdc++-v3/ChangeLog: PR libstdc++/107525 * include/experimental/propagate_const (operator element_type*()): Move into base class that can be partially specilized to iompose constraints. (operator const element_type*()): Likewise. * testsuite/experimental/propagate_const/observers/107525.cc: New test.
2022-11-05doc: Document correct -fwide-exec-charset defaults [PR41041]Jonathan Wakely1-3/+4
As shown in the PR, the default is not UTF-32 but rather UTF-32BE or UTF-32LE, avoiding the need for a byte order mark in literals. gcc/ChangeLog: PR c/41041 * doc/cppopts.texi: Document -fwide-exec-charset defaults correctly.
2022-11-05Support multilib-aware target lib flags self-specs overridingAlexandre Oliva4-2/+42
This patch introduces -fmultiflags, short for multilib TFLAGS, as an option that does nothing by default, but that can be added to TFLAGS and mapped to useful options by driver self-specs. for gcc/ChangeLog * common.opt (fmultiflags): New. * doc/invoke.texi: Document it. * gcc.cc (driver_self_specs): Discard it. * opts.cc (common_handle_option): Ignore it in the driver.
2022-11-04testsuite: Add testcase from C++23 P2314R4 - Character sets and encodingsJakub Jelinek1-0/+10
I've read the paper and I believe we just implement it with no changes needed (at least since PR67224 and similar libcpp changes in GCC 10), but I could be wrong. The following patch at least adds a testcase from the start of the paper. 2022-11-04 Jakub Jelinek <jakub@redhat.com> * g++.dg/cpp23/charset1.C: New testcase from C++23 P2314R4.
2022-11-04libcpp: Update to Unicode 15Jakub Jelinek4-16992/+17225
The following pseudo-patch regenerates the libcpp tables with Unicode 15.0.0 which added 4489 new characters. As mentioned previously, this isn't just a matter of running the two libcpp/make*.cc programs on the new Unicode files, but one needs to manually update a table inside of makeuname2c.cc according to a table in Unicode text (which is partially reflected in the text files, but e.g. in Unicode 14.0.0 not 100% accurately, in 15.0.0 actually accurately). I've also added some randomly chosen subset of those 4489 new characters to a testcase. 2022-11-04 Jakub Jelinek <jakub@redhat.com> gcc/testsuite/ * c-c++-common/cpp/named-universal-char-escape-1.c: Add tests for some characters newly added in Unicode 15.0.0. libcpp/ * makeuname2c.cc (struct generated): Update from Unicode 15.0.0 table 4-8. * ucnid.h: Regenerated for Unicode 15.0.0. * uname2c.h: Likewise.
2022-11-04AArch64: Fix testcaseWilco Dijkstra1-3/+3
gcc/testsuite/ * gcc.target/aarch64/mgeneral-regs_3.c: Fix testcase.
2022-11-04input: add get_source_text_betweenJeff Chapman II2-0/+93
The c++-contracts branch uses this to retrieve the source form of the contract predicate, to be returned by contract_violation::comment(). Co-authored-by: Jason Merrill <jason@redhat.com> gcc/ChangeLog: * input.cc (get_source_text_between): New fn. * input.h (get_source_text_between): Declare.
2022-11-04Set nonzero bits for multiplication and divisions by a power of 2.Aldy Hernandez3-0/+96
We're missing a lot of TLC in keeping track of nonzero bits across range-ops. It isn't an oversight, but just limited amount of hours to implement stuff. This patch keeps better track of the nonzero mask (really maybe_nonzero bits as discussed) across multiplication and division when the RHS is a power of 2. It fixes PR107342 and also touches on PR55157. In the latter, the nonzero mask is being set quite late (CCP2) but could be set by evrp time if we enhanced range-ops. I have added tests from both PRs. Tested PR tree-optimization/107342 gcc/ChangeLog: * range-op.cc (operator_mult::fold_range): New. (operator_div::fold_range): New. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/vrp122.c: New test. * gcc.dg/tree-ssa/vrp123.c: New test.
2022-11-04Fix recent thinko in operand_equal_pEric Botcazou5-14/+61
There is a thinko in a recent improvement made to operand_equal_p where the code just looks at operand 2 of COMPONENT_REF, if it is present, to compare addresses. That's wrong because operand 2 contains the number of DECL_OFFSET_ALIGN-bit-sized words so, when DECL_OFFSET_ALIGN > 8, not all the bytes are included and some of them are in DECL_FIELD_BIT_OFFSET, see get_inner_reference for the model computation. In other words, you would need to compare operand 2 and DECL_OFFSET_ALIGN and DECL_FIELD_BIT_OFFSET in this situation, but I'm not sure this is worth the hassle in practice so the fix just removes this alternate handling. gcc/ * fold-const.cc (operand_compare::operand_equal_p) <COMPONENT_REF>: Do not take into account operand 2. (operand_compare::hash_operand) <COMPONENT_REF>: Likewise. gcc/testsuite/ * gnat.dg/opt99.adb: New test. * gnat.dg/opt99_pkg1.ads, gnat.dg/opt99_pkg1.adb: New helper. * gnat.dg/opt99_pkg2.ads: Likewise.
2022-11-04Do not use subword paradoxical subregs in emit_group_storeEric Botcazou1-13/+13
The goal of the trick is to make life easier for the combiner, but subword paradoxical subregs make it harder for the register allocator instead. gcc/ * expr.cc (emit_group_store): Do not use subword paradoxical subregs
2022-11-04libstdc++: Simplify lifetime of eh_globals variable [PR107500]Jonathan Wakely1-15/+5
Since this is a trivial type, we probably don't need to do anything to ensure it's still accessible after other static dtors. libstdc++-v3/ChangeLog: PR libstdc++/107500 * libsupc++/eh_globals.cc (eh_globals): Remove immortalizing wrapper. (__cxxabiv1::__cxa_get_globals_fast): Adjust. (__cxxabiv1::__cxa_get_globals): Adjust.
2022-11-04libstdc++: Define _GNU_SOURCE for secure_getenv on Cygwin [PR107511]Jonathan Wakely1-0/+5
As in r12-6867-ge20486d508afdf we need to define _GNU_SOURCE explicitly for Cygwin, because configure finds it in libc but it isn't declared unless we request it. libstdc++-v3/ChangeLog: PR libstdc++/107511 * libsupc++/eh_alloc.cc (_GNU_SOURCE): Define.
2022-11-04ada: Fix for validity checks combined with aliasing checksJustin Squirek1-5/+11
Attribute Overlaps_Storage, which can appear implicitly in expansion of aliasing checks, is now excluded from operand validity checks. Likewise for attribute Has_Same_Storage. gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference): Skip operand validity checks for attributes Has_Same_Storage and Overlaps_Storage.
2022-11-04ada: Fix couple of issues with arrays indexed by enumeration typeEric Botcazou2-15/+5
The first one is that Remove_Warning_Messages reinstates the Original_Node of an N_Raise_Constraint_Error node in the tree for no clear reasons, and the Original_Node may contain constructs whose expansion has been stopped when the Constraint_Error was asserted, eventually causing gigi to stop. The second one is that a path in Build_Array_Aggr_Code.Gen_Loop does not copy the loop bounds, unlike other paths, thus triggering a sharing issue. gcc/ada/ * errout.adb (Remove_Warning_Messages.Check_For_Warning): Do not reinstate the Original_Node in the tree. * exp_aggr.adb (Build_Array_Aggr_Code.Gen_Loop): Copy the bounds on all paths.
2022-11-04ada: Fix typo in comment referring to pragma RestrictionsPiotr Trojanek1-3/+2
Comment cleanup only. gcc/ada/ * libgnat/g-excact.ads (Register_Global_Action): Refill comment. (Name_To_Id): Change pragma Restriction from singular to plural.
2022-11-04ada: Cleanup code for warnings about unreferenced formal parametersPiotr Trojanek1-9/+0
Cleanup related to new checks for unset references. gcc/ada/ * sem_warn.adb (Check_References): Remove redundant guard, as it is implied by a preceding call to Referenced_Check_Spec.
2022-11-04ada: Cleanup code for unreferenced variablesPiotr Trojanek1-19/+10
Further cleanups related to warnings about unreferenced objects. gcc/ada/ * sem_warn.adb (Check_References): Remove useless query for "spec" of a variable; refactor nested if-statements into a single condition.
2022-11-04ada: Cleanup code for warnings about unset referencesPiotr Trojanek2-12/+19
Cleanup related to new checks for unset references. gcc/ada/ * sem_util.adb (In_Pragma_Expression): Add standard guard against searching too far. (In_Quantified_Expression): Likewise. * sem_warn.adb (May_Need_Initialized_Actual): Remove redundant parens. (Check_References): Remove guard that duplicates a condition from the enclosing if-statement; only assign E1T variable when necessary. (Within_Postcondition): Fix layout. (No_Warn_On_In_Out): Balance parens in comment.
2022-11-04ada: Static intrinsic functions are a core language extension.Steve Baird4-3/+9
GNAT-defined Ada extensions are divided into two categories: those that are enabled by either -gnatX or -gnatX0 and those which require -gnatX0. Move static intrinsic functions from the second category into the first. gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: Add the standard '... "On" enables this extension.' sentence to the description of static intrinsic functions. * sem_ch13.adb (Analyze_Aspect_Spec): In the call to Error_Msg_GNAT_Extension for a Static aspect specification for an intrinsic function, specify Is_Core_Extension => True. * sem_eval.adb (Eval_Intrinsic_Call): Test Core_Extensions_Allowed instead of testing All_Extensions_Allowed. * gnat_rm.texi: Regenerate.
2022-11-04ada: Remove redundant calls in handling of aspect specificationsPiotr Trojanek3-4/+0
Routine Set_Aspect_Specifications sets the Has_Aspect flag, so there is no need to set this flag again afterwards. Code cleanup; semantics is unaffected. gcc/ada/ * aspects.adb (Relocate_Aspect): Remove call to Set_Has_Aspects. * sem_ch12.adb (Analyze_Formal_Package_Declaration): Likewise. * sem_util.adb (Copy_Ghost_Aspect, Copy_SPARK_Mode_Aspect): Likewise.
2022-11-04ada: Flag unsupported dispatching constructor callsJavier Miranda3-9/+55
gcc/ada/ * exp_intr.adb (Expand_Dispatching_Constructor_Call): Report an error on unsupported dispatching constructor calls and report a warning on calls that may fail at run time. gcc/testsuite/ * gnat.dg/abstract1.ads: Cleanup whitespaces. * gnat.dg/abstract1.adb: Likewise and add -gnatws to silence new warning.
2022-11-04ada: Avoid repeated iteration over private protected componentsPiotr Trojanek1-14/+11
The First_Entity/Next_Entity chain includes private entities, so there it no need to iterate starting both from First_Entity and First_Private_Entity. Code cleanup related to improved detection of references to uninitialized objects; behavior is unaffected. gcc/ada/ * sem_util.adb (Check_Components): Iterate using First/Next_Component_Or_Discriminant. (Has_Preelaborable_Initialization): Avoid repeated iteration with calls to Check_Components with First_Entity and First_Private_Entity. (Is_Independent_Object_Entity): Tune indentation.
2022-11-04ada: Cleanup clearing flags on package variablesPiotr Trojanek1-12/+9
When killing flags on assignable entities we iterated from First_Entity and then again from First_Private_Entity. This second iteration was unnecessary, because the entity chain that starts with First_Entity contains all entities, including the private ones. This is just a performance improvement; the behavior is unchanged. gcc/ada/ * sem_ch7.adb (Clear_Constants): Only iterate from First_Entity through Next_Entity; only examine variables because packages have no assignable formal parameters.
2022-11-04ada: Fix various typos in GNAT User's GuidePiotr Trojanek4-16/+18
Fix uncontroversial typos. gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix typos. * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Fix typos and refill as necessary; remove trailing whitespace. * doc/gnat_ugn/gnat_and_program_execution.rst: Fix typos. * gnat_ugn.texi: Regenerate.
2022-11-04ada: Fix loop unnesting issue.Marc Poulhiès3-8/+16
During loop unnesting, when the loop statements are wrapped in a code block, the newly created block's scope must be set to the loop scope (instead of the previous 'Current_Scope' that would point to an upper scope). gcc/ada/ * sem_util.ads (Add_Block_Identifier): Add new extra Scope argument. * sem_util.adb (Add_Block_Identifier): Likewise and use this scope variable instead of Current_Scope. * exp_util.adb (Wrap_Statements_In_Block): Add new scope argument to Add_Block_Identifier call.
2022-11-04ada: Fix repeated killing of private entity valuesPiotr Trojanek1-29/+9
When killing known values of assignable entities we iterated from First_Entity and then again from First_Private_Entity. This second iteration was unnecessary, because the entity chain that starts with First_Entity contains all entities, including the private ones. This is just a performance improvement; the behavior is unchanged. gcc/ada/ * sem_util.adb (Kill_Current_Values): Only iterate from First_Entity through Next_Entity.
2022-11-04ada: Simplify detection of controlling formalsPiotr Trojanek1-3/+3
When detecting controlling formals we are only interested in formal parameters and not in other entities. gcc/ada/ * sem_ch6.adb (Controlling_Formal): Iterate with First/Next_Formal and not with First/Next_Entity.
2022-11-04ada: Skip dynamic interface conversion under configurable runtimeJavier Miranda1-1/+1
gcc/ada/ * exp_disp.adb (Expand_Interface_Conversion): Fix typo in comment.
2022-11-04ada: Skip dynamic interface conversion under configurable runtimeJavier Miranda2-14/+33
gcc/ada/ * exp_disp.adb (Expand_Interface_Conversion): Under configurable runtime, when the target type is an interface that is an ancestor of the operand type, skip generating code to displace the pointer to reference the target dispatch table. * sem_disp.adb (Propagate_Tag): Handle class-wide types when checking for the addition of an implicit interface conversion.
2022-11-04ada: Fix typoRonan Desplanques2-2/+2
Fix typo in documentation. gcc/ada/ * doc/gnat_rm/standard_library_routines.rst: Fix typo. * gnat_rm.texi: Regenerate.
2022-11-04ada: Remove sa_messagesGhjuvan Lacambre2-806/+0
Spark and CodePeer do not depend on this unit anymore. gcc/ada/ * sa_messages.ads, sa_messages.adb: Remove files.
2022-11-04ada: Refactor: replace uses of `not Present(X)` with `No (X)`Ghjuvan Lacambre27-77/+74
`No (X)` is essentially `not Present (X)`, there's no reason for not using this shorter form. gcc/ada/ * checks.adb, exp_atag.adb, exp_attr.adb, exp_ch4.adb, exp_ch6.adb, exp_ch7.adb, exp_dbug.adb, exp_disp.adb, exp_unst.adb, exp_util.adb, freeze.adb, layout.adb, pprint.adb, rtsfind.adb, sem_aggr.adb, sem_attr.adb, sem_case.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb, sem_ch5.adb, sem_ch6.adb, sem_ch8.adb, sem_dim.adb, sem_prag.adb, sem_util.adb, sem_warn.adb: Replace uses of `not Present (X)` with `No (X)`.
2022-11-04ada: Fix various typos in node and entity description commentsPiotr Trojanek2-12/+14
Fix typos in units that describe GNAT abstract syntax tree. gcc/ada/ * einfo.ads: Fix typos in comments; refill as necessary. * sinfo.ads: Likewise.
2022-11-04ada: Fix various typos in GNAT RMPiotr Trojanek6-22/+22
List of unknown words in files can be produced with: $ cat *.rst | ispell -l | tr '[:upper:]' '[:lower:]' | sort | uniq | less and can be easily filtered with eyes. gcc/ada/ * doc/gnat_rm/implementation_defined_aspects.rst: Fix typos. * doc/gnat_rm/implementation_defined_attributes.rst: Likewise * doc/gnat_rm/implementation_defined_characteristics.rst: Likewise * doc/gnat_rm/implementation_defined_pragmas.rst: Likewise * doc/gnat_rm/standard_library_routines.rst: Likewise. * gnat_rm.texi: Regenerate.
2022-11-04ada: Improve efficiency of scope stack restorationPiotr Trojanek1-2/+2
We save/restore visibility by setting the Is_Immediately_Visible flag and appending entities to / removing them from the tail of an element list. However, the Is_Immediately_Visible flag can be restored in any order, while the element list is singly-linked and removal from the tail is inefficient. This change removes a performance hot spot, which accounted for up to 10% of compilation time of complex applications (e.g. QGen), at least as measured on GNAT built with profiling support. gcc/ada/ * sem_ch8.adb (Restore_Scope_Stack): Remove elements from the head and not the tail of an element list.
2022-11-04ada: Small editorial changes to documentation commentsRonan Desplanques1-4/+4
gcc/ada/ * sinfo.ads: Small editorial changes.
2022-11-04ada: Allow enabling a restricted set of language extensions.Steve Baird22-95/+212
The -gnatX switch (and the related Extensions_Allowed pragma) is currently a two-valued all-or-nothing option. Add support for enabling a curated subset of language extensions without enabling others via the -gnatX switch and for enabling all language extensions via the new -gnatX0 switch. Similarly, the existing "ON" argument for the Extensions_Allowed pragma now only enables the curated subset; the new argument "ALL" enables all language extensions. The subset of language extensions currently includes prefixed-view notation with an untagged prefix, fixed-low-bound array subtypes, and casing on composite values. gcc/ada/ * opt.ads: Replace Ada_Version_Type enumeration literal Ada_With_Extensions with two literals, Ada_With_Core_Extensions and Ada_With_All_Extensions. Update uses of the deleted literal. Replace Extensions_Allowed function with two functions: All_Extensions_Allowed and Core_Extensions_Allowed. * errout.ads, errout.adb: Add Boolean parameter to Error_Msg_GNAT_Extension to indicate whether the construct in question belongs to the curated subset. * exp_ch5.adb, par-ch4.adb, sem_case.adb, sem_ch3.adb: * sem_ch4.adb, sem_ch5.adb, sem_ch8.adb: Replace calls to Extensions_Allowed with calls to Core_Extensions_Allowed for constructs that are in the curated subset. * sem_attr.adb, sem_ch13.adb, sem_eval.adb, sem_util.adb: Replace calls to Extensions_Allowed with calls to All_Extensions_Allowed for constructs that are not in the curated subset. * par-ch3.adb: Override default for new parameter in calls to Error_Msg_GNAT_Extension for constructs in the curated subset. * par-prag.adb: Add Boolean parameter to Check_Arg_Is_On_Or_Off to also allow ALL. Set Opt.Ada_Version appropriately for ALL or ON arguments. * sem_prag.adb: Allowed ALL argument for an Extensions_Allowed pragma. Set Opt.Ada_Version appropriately for ALL or ON arguments. * switch-c.adb: The -gnatX switch now enables only the curated subset of language extensions (formerly it enabled all of them); the new -gnatX0 switch enables all of them. * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Document new "-gnatX0" switch and update documentation for "-gnatX" switch. * doc/gnat_rm/implementation_defined_pragmas.rst: Document new ALL argument for pragma Extensions_Allowed and update documentation for the ON argument. Delete mention of Ada 2022 Reduce attribute as an extension. * gnat_rm.texi, gnat_ugn.texi: Regenerate.
2022-11-04ada: Generate missing object decls for adainit/adafinal registration callsSteve Baird1-5/+14
A previous change on this ticket introduced calls to CUDA_Register_Function for adainit and adafinal, but failed to introduce declarations for the C string variables that are initialized and then passed as actual parameters in this call. Provide the missing declarations (and, incidentally, change the names of the two variables). gcc/ada/ * bindgen.adb: Introduce two new string constants for the names of the C-String variables that are assigned the names for adainit and adafinal. Replace string literals in Gen_CUDA_Init with references to these constants. In Gen_CUDA_Defs, generate C-String variable declarations where these constants are the names of the variables.
2022-11-04ada: Support lock-free protected objects with pragma Initialize_ScalarsPiotr Trojanek1-0/+9
In general, protected subprograms are only eligible for a lock-free expansion if they do not reference global assignable objects. However, it seems reasonable to ignore references to variables in System.Scalar_Values, which are generated when pragma Initialize_Scalars is active. Such references appear, for example, when protected subprogram has formal parameters of mode out. gcc/ada/ * sem_ch9.adb (Satisfies_Lock_Free_Requirements): Ignore references to global variables inserted due to pragma Initialize_Scalars.