aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/libgnarl
AgeCommit message (Collapse)AuthorFilesLines
2 daysada: Remove redundant parentheses inside unary operatorsPiotr Trojanek1-1/+1
GNAT already emits a style warning when redundant parentheses appear inside logical and short-circuit operators. A similar warning will be soon emitted for unary operators as well. This patch removes the redundant parentheses to avoid future build errors. gcc/ada/ChangeLog: * checks.adb, exp_dist.adb, exp_imgv.adb, exp_util.adb, libgnarl/a-reatim.adb, libgnat/a-coinve.adb, libgnat/a-nbnbre.adb, libgnat/a-ngcoty.adb, libgnat/a-ngelfu.adb, libgnat/a-ngrear.adb, libgnat/a-strbou.ads, libgnat/a-strfix.ads, libgnat/a-strsea.adb, libgnat/a-strsea.ads, libgnat/a-strsup.ads, libgnat/a-strunb__shared.ads, libgnat/g-alleve.adb, libgnat/g-spitbo.adb, libgnat/s-aridou.adb, libgnat/s-arit32.adb, libgnat/s-dourea.ads, libgnat/s-genbig.adb, libgnat/s-imager.adb, libgnat/s-statxd.adb, libgnat/s-widthi.adb, sem_attr.adb, sem_ch10.adb, sem_ch3.adb, sem_ch6.adb, sem_ch7.adb, sem_dim.adb, sem_prag.adb, sem_res.adb, uintp.adb: Remove redundant parentheses inside NOT and ABS operators.
8 daysUpdate copyright years.Marc Poulhiès215-215/+215
10 daysAda: Fix build for dummy s-tapropEstevan Castilho (Tevo)1-9/+2
gcc/ada * libgnarl/s-taprop__dummy.adb: Remove use clause for System.Parameters. (Unlock): Remove Global_Lock formal parameter. (Write_Lock): Likewise.
2024-12-11Ada: Factorize bsd signal definitionsSamuel Thibault2-137/+1
They are all the same on all BSD-like systems (including GNU/Hurd). gcc/ada/ChangeLog: * libgnarl/a-intnam__freebsd.ads: Rename to... * libgnarl/a-intnam__bsd.ads: ... new file. * libgnarl/a-intnam__dragonfly.ads: Remove file. * Makefile.rtl (x86-kfreebsd, x86-gnuhurd, x86_64-kfreebsd, aarch64-freebsd, x86-freebsd, x86_64-freebsd): Use libgnarl/a-intnam__bsd.ads instead of libgnarl/a-intnam__freebsd.ads. (x86_64-dragonfly): Use libgnarl/a-intnam__bsd.ads instead of libgnarl/a-intnam__dragonfly.ads. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2024-11-12ada: Include design documentation within runtime sourcesPat Bernardi8-9/+32
The existing design documentation, required when generating the Software Architecture Design Specification and Software Component Design Specification documents for the light and light-tasking runtimes, has been included directly within runtime sources. gcc/ada/ChangeLog: * libgnarl/a-dynpri.ads: Add design annotations. * libgnarl/a-reatim.ads: Likewise. * libgnarl/a-synbar.ads: Likewise. * libgnarl/a-taside.ads: Likewise. * libgnarl/s-tarest.ads: Likewise. * libgnarl/s-tasinf.ads: Likewise. * libgnarl/s-taspri__posix.ads: Likewise. * libgnarl/s-tpobmu.ads: Likewise. * libgnat/a-assert.ads: Likewise. * libgnat/a-comlin.ads: Likewise. * libgnat/a-nbnbig.ads: Likewise. * libgnat/a-nubinu.ads: Likewise. * libgnat/a-numeri.ads: Likewise. * libgnat/a-unccon.ads: Likewise. * libgnat/a-uncdea.ads: Likewise. * libgnat/ada.ads: Likewise. * libgnat/g-debuti.ads: Likewise. * libgnat/g-sestin.ads: Likewise. * libgnat/g-souinf.ads: Likewise. * libgnat/gnat.ads: Likewise. * libgnat/i-cexten.ads: Likewise. * libgnat/i-cexten__128.ads: Likewise. * libgnat/i-cstrin.adb: Likewise. * libgnat/i-cstrin.ads: Likewise. * libgnat/interfac__2020.ads: Likewise. * libgnat/machcode.ads: Likewise. * libgnat/s-addope.ads: Likewise. * libgnat/s-aridou.ads: Likewise. * libgnat/s-arit32.ads: Likewise. * libgnat/s-arit64.ads: Likewise. * libgnat/s-assert.ads: Likewise. * libgnat/s-atacco.ads: Likewise. * libgnat/s-atocou.ads: Likewise. * libgnat/s-atocou__builtin.adb: Likewise. * libgnat/s-atopri.ads: Likewise. * libgnat/s-bitops.ads: Likewise. * libgnat/s-boarop.ads: Likewise. * libgnat/s-bytswa.ads: Likewise. * libgnat/s-carsi8.ads: Likewise. * libgnat/s-carun8.ads: Likewise. * libgnat/s-casi16.ads: Likewise. * libgnat/s-casi32.ads: Likewise. * libgnat/s-casi64.ads: Likewise. * libgnat/s-caun16.ads: Likewise. * libgnat/s-caun32.ads: Likewise. * libgnat/s-caun64.ads: Likewise. * libgnat/s-exnint.ads: Likewise. * libgnat/s-exnllf.ads: Likewise. * libgnat/s-exnlli.ads: Likewise. * libgnat/s-expint.ads: Likewise. * libgnat/s-explli.ads: Likewise. * libgnat/s-expllu.ads: Likewise. * libgnat/s-expmod.ads: Likewise. * libgnat/s-exponn.ads: Likewise. * libgnat/s-expont.ads: Likewise. * libgnat/s-exponu.ads: Likewise. * libgnat/s-expuns.ads: Likewise. * libgnat/s-fatflt.ads: Likewise. * libgnat/s-fatgen.ads: Likewise. * libgnat/s-fatlfl.ads: Likewise. * libgnat/s-fatllf.ads: Likewise. * libgnat/s-flocon.ads: Likewise. * libgnat/s-geveop.ads: Likewise. * libgnat/s-imageb.ads: Likewise. * libgnat/s-imaged.ads: Likewise. * libgnat/s-imagef.ads: Likewise. * libgnat/s-imagei.ads: Likewise. * libgnat/s-imagen.ads: Likewise. * libgnat/s-imageu.ads: Likewise. * libgnat/s-imagew.ads: Likewise. * libgnat/s-imde128.ads: Likewise. * libgnat/s-imde32.ads: Likewise. * libgnat/s-imde64.ads: Likewise. * libgnat/s-imen16.ads: Likewise. * libgnat/s-imen32.ads: Likewise. * libgnat/s-imenu8.ads: Likewise. * libgnat/s-imfi32.ads: Likewise. * libgnat/s-imfi64.ads: Likewise. * libgnat/s-imgbiu.ads: Likewise. * libgnat/s-imgboo.ads: Likewise. * libgnat/s-imgcha.ads: Likewise. * libgnat/s-imgint.ads: Likewise. * libgnat/s-imgllb.ads: Likewise. * libgnat/s-imglli.ads: Likewise. * libgnat/s-imgllu.ads: Likewise. * libgnat/s-imgllw.ads: Likewise. * libgnat/s-imgrea.ads: Likewise. * libgnat/s-imguns.ads: Likewise. * libgnat/s-imguti.ads: Likewise. * libgnat/s-imgwiu.ads: Likewise. * libgnat/s-maccod.ads: Likewise. * libgnat/s-multip.ads: Likewise. * libgnat/s-pack03.ads: Likewise. * libgnat/s-pack05.ads: Likewise. * libgnat/s-pack06.ads: Likewise. * libgnat/s-pack07.ads: Likewise. * libgnat/s-pack09.ads: Likewise. * libgnat/s-pack10.ads: Likewise. * libgnat/s-pack100.ads: Likewise. * libgnat/s-pack101.ads: Likewise. * libgnat/s-pack102.ads: Likewise. * libgnat/s-pack103.ads: Likewise. * libgnat/s-pack104.ads: Likewise. * libgnat/s-pack105.ads: Likewise. * libgnat/s-pack106.ads: Likewise. * libgnat/s-pack107.ads: Likewise. * libgnat/s-pack108.ads: Likewise. * libgnat/s-pack109.ads: Likewise. * libgnat/s-pack11.ads: Likewise. * libgnat/s-pack110.ads: Likewise. * libgnat/s-pack111.ads: Likewise. * libgnat/s-pack112.ads: Likewise. * libgnat/s-pack113.ads: Likewise. * libgnat/s-pack114.ads: Likewise. * libgnat/s-pack115.ads: Likewise. * libgnat/s-pack116.ads: Likewise. * libgnat/s-pack117.ads: Likewise. * libgnat/s-pack118.ads: Likewise. * libgnat/s-pack119.ads: Likewise. * libgnat/s-pack12.ads: Likewise. * libgnat/s-pack120.ads: Likewise. * libgnat/s-pack121.ads: Likewise. * libgnat/s-pack122.ads: Likewise. * libgnat/s-pack123.ads: Likewise. * libgnat/s-pack124.ads: Likewise. * libgnat/s-pack125.ads: Likewise. * libgnat/s-pack126.ads: Likewise. * libgnat/s-pack127.ads: Likewise. * libgnat/s-pack13.ads: Likewise. * libgnat/s-pack14.ads: Likewise. * libgnat/s-pack15.ads: Likewise. * libgnat/s-pack17.ads: Likewise. * libgnat/s-pack18.ads: Likewise. * libgnat/s-pack19.ads: Likewise. * libgnat/s-pack20.ads: Likewise. * libgnat/s-pack21.ads: Likewise. * libgnat/s-pack22.ads: Likewise. * libgnat/s-pack23.ads: Likewise. * libgnat/s-pack24.ads: Likewise. * libgnat/s-pack25.ads: Likewise. * libgnat/s-pack26.ads: Likewise. * libgnat/s-pack27.ads: Likewise. * libgnat/s-pack28.ads: Likewise. * libgnat/s-pack29.ads: Likewise. * libgnat/s-pack30.ads: Likewise. * libgnat/s-pack31.ads: Likewise. * libgnat/s-pack33.ads: Likewise. * libgnat/s-pack34.ads: Likewise. * libgnat/s-pack35.ads: Likewise. * libgnat/s-pack36.ads: Likewise. * libgnat/s-pack37.ads: Likewise. * libgnat/s-pack38.ads: Likewise. * libgnat/s-pack39.ads: Likewise. * libgnat/s-pack40.ads: Likewise. * libgnat/s-pack41.ads: Likewise. * libgnat/s-pack42.ads: Likewise. * libgnat/s-pack43.ads: Likewise. * libgnat/s-pack44.ads: Likewise. * libgnat/s-pack45.ads: Likewise. * libgnat/s-pack46.ads: Likewise. * libgnat/s-pack47.ads: Likewise. * libgnat/s-pack48.ads: Likewise. * libgnat/s-pack49.ads: Likewise. * libgnat/s-pack50.ads: Likewise. * libgnat/s-pack51.ads: Likewise. * libgnat/s-pack52.ads: Likewise. * libgnat/s-pack53.ads: Likewise. * libgnat/s-pack54.ads: Likewise. * libgnat/s-pack55.ads: Likewise. * libgnat/s-pack56.ads: Likewise. * libgnat/s-pack57.ads: Likewise. * libgnat/s-pack58.ads: Likewise. * libgnat/s-pack59.ads: Likewise. * libgnat/s-pack60.ads: Likewise. * libgnat/s-pack61.ads: Likewise. * libgnat/s-pack62.ads: Likewise. * libgnat/s-pack63.ads: Likewise. * libgnat/s-pack65.ads: Likewise. * libgnat/s-pack66.ads: Likewise. * libgnat/s-pack67.ads: Likewise. * libgnat/s-pack68.ads: Likewise. * libgnat/s-pack69.ads: Likewise. * libgnat/s-pack70.ads: Likewise. * libgnat/s-pack71.ads: Likewise. * libgnat/s-pack72.ads: Likewise. * libgnat/s-pack73.ads: Likewise. * libgnat/s-pack74.ads: Likewise. * libgnat/s-pack75.ads: Likewise. * libgnat/s-pack76.ads: Likewise. * libgnat/s-pack77.ads: Likewise. * libgnat/s-pack78.ads: Likewise. * libgnat/s-pack79.ads: Likewise. * libgnat/s-pack80.ads: Likewise. * libgnat/s-pack81.ads: Likewise. * libgnat/s-pack82.ads: Likewise. * libgnat/s-pack83.ads: Likewise. * libgnat/s-pack84.ads: Likewise. * libgnat/s-pack85.ads: Likewise. * libgnat/s-pack86.ads: Likewise. * libgnat/s-pack87.ads: Likewise. * libgnat/s-pack88.ads: Likewise. * libgnat/s-pack89.ads: Likewise. * libgnat/s-pack90.ads: Likewise. * libgnat/s-pack91.ads: Likewise. * libgnat/s-pack92.ads: Likewise. * libgnat/s-pack93.ads: Likewise. * libgnat/s-pack94.ads: Likewise. * libgnat/s-pack95.ads: Likewise. * libgnat/s-pack96.ads: Likewise. * libgnat/s-pack97.ads: Likewise. * libgnat/s-pack98.ads: Likewise. * libgnat/s-pack99.ads: Likewise. * libgnat/s-parame.ads: Likewise. * libgnat/s-rident.ads: Likewise. * libgnat/s-spark.ads: Likewise. * libgnat/s-spcuop.ads: Likewise. * libgnat/s-stoele.ads: Likewise. * libgnat/s-traent.ads: Likewise. * libgnat/s-unstyp.ads: Likewise. * libgnat/s-vaispe.ads: Likewise. * libgnat/s-valspe.ads: Likewise. * libgnat/s-vauspe.ads: Likewise. * libgnat/s-veboop.ads: Likewise. * libgnat/s-vector.ads: Likewise. * libgnat/s-vs_int.ads: Likewise. * libgnat/s-vs_lli.ads: Likewise. * libgnat/s-vs_llu.ads: Likewise. * libgnat/s-vs_uns.ads: Likewise. * libgnat/s-vsllli.ads: Likewise. * libgnat/text_io.ads: Likewise. * libgnat/unchconv.ads: Likewise. * libgnat/unchdeal.ads: Likewise. * s-pack.ads.tmpl: Likewise.
2024-11-12ada: Make Interrupt and Attach Handlers Obsolescent in VXWorksViljar Indus2-1/+281
In order to trigger an obsolescent feature warning in VXWorks if either the pragma or aspect of Interrupt_Handler or Attach_Handler is used, the spec of the Register_Interrupt_Handler method needs to be marked as obsolescent in a VXWorks specific version of the file. gcc/ada/ChangeLog: * libgnarl/s-interr__vxworks.ads (new): A VXWorks specific version of the file where Register_Interrupt_Handler is marked with the Obsolescent pragma. * libgnarl/s-interr__vxworks.adb: Remove pragma Obsoloescent that had no effect. * Makefile.rtl: Add entries for using the libgnarl/s-interr__vxworks.ads file.
2024-11-04ada: CheriBSD: add SIGPROT handlerDaniel King1-1/+1
gcc/ada/ChangeLog: * libgnarl/s-intman__cheribsd.adb: Add SIGPROT to interrupt list.
2024-11-04ada: Tweak CPU affinity handlingRonan Desplanques7-23/+63
The primary motivation for this change is making the taskset command line tool work as expected for tasking programs that don't use features from section D.16 of the Ada reference manual. A couple of components are added to the ATCB record to make it possible to tell values that come from explicit aspects and subprogram calls from values that are inherited from activating tasks. gcc/ada/ChangeLog: * libgnarl/s-mudido__affinity.adb (Unchecked_Set_Affinity): Set new ATCB component. * libgnarl/s-taprop__linux.adb (Create_Task): Only set CPU affinity when required. (Requires_Affinity_Change): New subprogram. (Set_Task_Affinity): Likewise. * libgnarl/s-tarest.adb (Create_Restricted_Task): Adapt to Initialize_ATCB change. * libgnarl/s-taskin.adb (Initialize_ATCB): Update parameter list. Record whether aspects were explicitly specified. * libgnarl/s-taskin.ads (Common_ATCB): Add component. * libgnarl/s-tassta.adb (Create_Task): Update call to Initialize_ATCB. * libgnarl/s-tporft.adb (Register_Foreign_Thread): Likewise.
2024-11-04ada: Build and runtime support for CheriBSDDaniel King2-0/+1015
SIGPROT is a new signal on CheriBSD that signals a CHERI protection violation. The full runtime converts these to the appropriate Ada exception declared in Interfaces.CHERI.Exceptions. gcc/ada/ChangeLog: * Makefile.rtl: Build support for Morello CheriBSD. * libgnarl/s-intman__cheribsd.adb: New file for CheriBSD. * libgnarl/s-osinte__cheribsd.ads: New file for CheriBSD.
2024-10-25ada: Fix ATC with timed delay from Ada.Real_TimeEric Botcazou1-0/+4
An Asynchronous Transfer of Control blocks with a timed delay that is computed by means of the Ada.Real_Time unit (instead of the default Ada.Calendar unit) because of a missing abort deferral in the unit. gcc/ada/ChangeLog: PR ada/43485 * libgnarl/a-retide.adb: Add with clause for System.Soft_Links. (Delay_Until): Defer and undefer abort around the call to the Timed_Delay routine of System.Task_Primitives.Operations.
2024-10-25ada: Increase stack size for Windows tasking programssquirek1-5/+5
This patch increases the default tasking stack size for Windows tasking program to 8 mb to avoid use of pragma Linker_Options in the general case. gcc/ada/ChangeLog: * libgnarl/s-taprop__mingw.adb: Modify stack size and update documentation.
2024-10-09Remove support for HP-UX 10Eric Botcazou4-2297/+0
gcc/ada * Makefile.rtl: Remove HP-UX 10 section. * libgnarl/s-osinte__hpux-dce.ads: Delete. * libgnarl/s-osinte__hpux-dce.adb: Likewise. * libgnarl/s-taprop__hpux-dce.adb: Likewise. * libgnarl/s-taspri__hpux-dce.ads: Likewise. * libgnat/s-oslock__hpux-dce.ads: Likewise.
2024-10-08ada: Add System definitions of SIGSYS for AndroidOlivier Hainque3-0/+3
This allows reusing a-intnam__linux.ads for Android. gcc/ada/ChangeLog: * libgnarl/s-linux__android-arm.ads: Define SIGSYS. * libgnarl/s-linux__android-aarch64.ads: Define SIGSYS. * libgnarl/s-osinte__android.ads: Expose SIGSYS value.
2024-10-08ada: Rework s-linux/osinte for arm/aarch64-android sigactionsOlivier Hainque3-4/+139
Building an aarch64-android compiler with the current sources initially intended for arm-android expectedly trips on problems. This change is meant to address: ``` .../gcc/ada/rts % ../../gnat1 -quiet ... a-stbufi.adb -I. s-osinte.ads:591:07: error: component "sa_flags" overlaps "sa_mask" at line 590 ``` s-linux__android.ads makes hardcoded assumptions on the size of sigset_t, based on observations performed in the course of the arm port. Then sysem headers show sa_flags placed VERY differently between the 32 and the 64 bits variants. See android-sysroot/usr/include/bits/signal_types.h ``` %if defined(__LP64__) int sa_flags; \ union { \ sighandler_t sa_handler; \ void (*sa_sigaction)(int, struct siginfo*, void*); \ }; \ sigset_t sa_mask; \ void (*sa_restorer)(void); \ %else union { sighandler_t sa_handler; void (*sa_sigaction)(int, struct siginfo*, void*); }; sigset_t sa_mask; int sa_flags; void (*sa_restorer)(void); ``` gcc/ada/ChangeLog: * libgnarl/s-linux__android-arm.ads: New file, renaming of ... * libgnarl/s-linux__android.ads: ... this file. * libgnarl/s-linux__android-aarch64.ads: New file. Based on the -arm variant, with sa_ field positions adjusted. * Makefile.rtl (arm/aarch64-android pairs): Adjust accordingly. * libgnarl/s-osinte__android.ads: Rather than making assumptions on the actual type of the C sigset_t, use Os_Constants.SIZEOF_sigset_t to define an Ada sigset_t type of the proper size. Use C.int instead of unsigned_long for sa_flags.
2024-08-08Ada, libgnarl: Fix s-taprop__posix.adb compilation.Iain Sandoe1-1/+1
Bootstrap on Darwin, and likely any other targets using the posix implementation of s-taprop was broken by commits between r15-2743 and r15-2747: s-taprop.adb:297:15: error: "size_t" is not visible s-taprop.adb:297:15: error: multiple use clauses cause hiding s-taprop.adb:297:15: error: hidden declaration at s-osinte.ads:58 s-taprop.adb:297:15: error: hidden declaration at i-c.ads:9 This seems to be caused by an omitted change to use Interfaces.C.size_t instead of just size_t. Fixed thus. gcc/ada/ChangeLog: * libgnarl/s-taprop__posix.adb (Stack_Guard): Use Interfaces.C.size_t for the type of Page_Size. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2024-08-08ada: Fix s-taprop__solaris.adb compilationRainer Orth1-1/+1
Solaris Ada bootstrap is broken as of 2024-08-06 with s-taprop.adb:1971:23: error: "int" is not visible s-taprop.adb:1971:23: error: multiple use clauses cause hiding s-taprop.adb:1971:23: error: hidden declaration at s-osinte.ads:51 s-taprop.adb:1971:23: error: hidden declaration at i-c.ads:62 because one instance of int isn't qualified. This patch fixes this. Bootstrapped without regressions on i386-pc-solaris2.11 and sparc-sun-solaris2.11. 2024-08-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> gcc/ada: * libgnarl/s-taprop__solaris.adb (Set_Task_Affinity): Fully quality int.
2024-08-06ada: Use fully qualified in more library filesViljar Indus2-6/+7
gcc/ada/ * libgnarl/s-interr__hwint.adb: Use fully qualified names to avoid ambiguity. * libgnarl/s-taprop__qnx.adb: Likewise.
2024-08-06ada: Use fully qualified in the runtime libraryViljar Indus4-12/+12
gcc/ada/ * libgnarl/s-taprop__mingw.adb: Use fully qualified names to avoid ambiguity. * libgnarl/s-taprop__posix.adb: Likewise. * libgnarl/s-taprop__qnx.adb: Likewise. * libgnarl/s-taprop__rtems.adb: Likewise.
2024-08-06ada: Reject use-clause conflicts in the run-time libraryBob Duff1-2/+2
This patch fixes a bug where GNAT would fail to detect certain errors when compiling the run-time library. In particular, if two overloaded homographs are both directly visible, it would pick one, rather than complaining about the ambiguity. The problem was that some special-purpose code in Sem_Ch8 was trying to make a user name take precedence over some run-time library declaration that (incorrectly) appears to be visible because of rtsfind. The solution is to disable that code while compiling the run-time library itself. In addition, we fix the newly-found errors in the run-time library. gcc/ada/ * sem_ch8.adb (Find_Direct_Name): Disable the special-purpose code when we are actually compiling the run-time library itself. * libgnarl/a-exetim__posix.adb: Fix newly-found use-clause conflicts. * libgnat/a-direct.adb: Likewise. * libgnat/a-nbnbin.adb: Likewise. * libgnat/a-timoio__128.adb: Likewise. * libgnat/a-timoio.adb: Likewise. * libgnat/a-wtmoio__128.adb: Likewise. * libgnat/a-wtmoio.adb: Likewise. * libgnat/a-ztmoio__128.adb: Likewise. * libgnat/a-ztmoio.adb: Likewise.
2024-06-20ada: New pragma to default all interrupts to system.Doug Rupp1-1/+23
New pragma Interrupts_System_By_Default defaults all interrupts/signals to system (which will inhibit the installation of default signal handlers). Note this changes the ALI format: it optionally adds an identifier to the 'P' line (similar to pragma Unreserve_All_Interrupts). As per comment in lib-writ spec regarding new modifiers, adding modifiers to the P line is always safe. Also note this does not introduce a bootstrap problem because the compiler and binder do not set the underlying _gl global nor do they use this pragma. gcc/ada/ * ali.ads (Interrupts_Default_To_System): New boolean. (Interrupts_Default_To_System_Specified): New boolean. * ali.adb (Interrupts_Default_To_System_Specified): Initialize. (Interrupts_Default_To_System): Initialize. (Scan_ALI): Processing for "ID". * bindgen.adb: Coallesce comments on interrupt settings to ... (Gen_Adainit): Import Interrupts_Default_To_System flag and set if pragma specified. (Gen_Output_File_Ada): Generate Local_Interrupt_States according to pragma. * init.c: ... here. [vxworks] (__gnat_install_handler): Test for interrupt_state. (__gl_interrupts_default_to_system): New global flag. (__gnat_get_interrupt_State): return interrupt state according to new global flag. * lib-writ.ads: Document "ID". * lib-writ.adb: Write out "ID". * opt.ads (Interrupts_System_By_Default): New boolean, defaulted to False. * par-prag.adb (Pragma_Interrupts_System_By_Default): New. * sem_prag.adb (Pragma_Interrupts_System_By_Default): Handle it. (Pragma_Interrupts_System_By_Default): Default it. * snames.ads-tmpl (Name_Interrupts_System_By_Default): New name. (Pragma_Interrupts_System_By_Default): New * libgnarl/s-intman__posix.adb (Initialize): Ensure the Keep_Unmasked signal is sigset-able. * doc/gnat_rm/implementation_defined_pragmas.rst: Document pragma Interrupts_System_By_Default. * doc/gnat_ugn/the_gnat_compilation_model.rst (Configuration pragmas): Add Interrupts_System_By_Default. (Partition-Wide Settings): Mention pragma Interrupts_System_By_Default. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-06-10ada: Fix usage of SetThreadAffinityMaskRonan Desplanques1-3/+3
This patches fixes the signature of the binding to SetThreadAffinityMask in the run-time library. It also fixes the error checking after calls to SetThreadAffinityMask. The previous code behaved as if SetThreadAffinityMask returned 1 on success, but it in fact returns a pointer value on success and 0 on failure. gcc/ada/ * libgnarl/s-taprop__mingw.adb (Set_Task_Affinity): Fix usage of SetThreadAffinityMask. * libgnat/s-winext.ads (SetThreadAffinityMask): Fix binding signature.
2024-06-10ada: Fix usage of SetThreadIdealProcessorRonan Desplanques1-2/+11
This patches fixes the way the run-time library checks the return value of SetThreadIdealProcessor. gcc/ada/ * libgnarl/s-taprop__mingw.adb (Set_Task_Affinity): Fix usage of SetThreadIdealProcessor.
2024-05-21Fix Ada runtime library breakage on Solaris (bis)Eric Botcazou1-1/+1
Recent changes made to the runtime library broke again its build on Solaris because it uses Solaris threads instead of POSIX threads on this platform. gcc/ada/ PR ada/115168 * libgnarl/s-taprop__solaris.adb (Initialize): Fix pasto. * libgnat/s-oslock__solaris.ads (Owner_Int): Delete. (Owner_ID): Change the designated type to Integer.
2024-05-21ada: Remove some explicit yields in tasking run-timeRonan Desplanques2-36/+0
This patch removes three occurrences where tasking run-time subprograms yielded control shortly before conditional calls to Sleep, in order to avoid these calls more often. It was intended as an optimization on systems where calls to Sleep are costly and in particular VMS. A problem was that two of the yields contained data races that were reported by thread sanitizing tools on some platforms, and that's the motivation for removing them. gcc/ada/ * libgnarl/s-taenca.adb (Wait_For_Completion): Remove call to Yield. * libgnarl/s-tasren.adb (Timed_Selective_Wait, Wait_For_Call): Remove calls to Yield.
2024-05-21ada: Add new Mingw task priority mappingJustin Squirek2-1/+13
This patch adds a new mapping (Non_FIFO_Underlying_Priorities) for dynamically setting task priorities in Windows when pragma Task_Dispatching_Policy (FIFO_Within_Priorities) is not present. Additionally, it documents the requirement to specify the pragma in order to use Set_Priority in the general case. gcc/ada/ * doc/gnat_ugn/platform_specific_information.rst: Add note about different priority level granularities under different policies in Windows and move POSIX related info into new section. * libgnarl/s-taprop.ads: Add note about Task_Dispatching_Policy. * libgnarl/s-taprop__mingw.adb: (Set_Priority): Add use of Non_FIFO_Underlying_Priorities. * libgnat/system-mingw.ads: Add documentation for modifying priority mappings and add alternative mapping Non_FIFO_Underlying_Priorities. * gnat_ugn.texi: Regenerate.
2024-05-20ada: Tweak handling of thread ID on POSIXRonan Desplanques11-61/+78
This patch changes the task initialization subprograms on POSIX platforms so that the thread ID of an ATCB is only set once. This has the advantage of getting rid of the Atomic aspect on the corresponding record component, and silences a Helgrind warning about a data race. gcc/ada/ * libgnarl/s-taprop__linux.adb (Enter_Task): Move setting of thread ID out of Enter_Task. (Initialize): Set thread ID for the environment task. (Create_Task): Remove now unnecessary Unrestricted_Access attribute and add justification for a memory write. * libgnarl/s-taprop__posix.adb: Likewise. * libgnarl/s-taprop__qnx.adb: Likewise. * libgnarl/s-taprop__rtems.adb: Likewise. * libgnarl/s-taprop__solaris.adb: Likewise. * libgnarl/s-taspri__posix.ads: Remove pragma Atomic for Private_Data.Thread, and update documentation comment. * libgnarl/s-taspri__lynxos.ads: Likewise. * libgnarl/s-taspri__posix-noaltstack.ads: Likewise. * libgnarl/s-taspri__solaris.ads: Likewise. * libgnarl/s-tporft.adb (Register_Foreign_Thread): Adapt to Enter_Task not setting the thread ID anymore. * libgnarl/s-tassta.adb (Task_Wrapper): Update comment.
2024-05-20ada: Fix incorrect free with Task_Info pragmaRonan Desplanques1-6/+11
Before this patch, on Linux, the procedure System.Task_Primitives.Operations.Set_Task_Affinity called CPU_FREE on instances of cpu_set_t_ptr that it didn't own when the obsolescent Task_Info pragma was in play. This patch fixes that issue. gcc/ada/ * libgnarl/s-taprop__linux.adb (Set_Task_Affinity): Fix decision about whether to call CPU_FREE.
2024-05-18Fix Ada runtime library breakage on SolarisEric Botcazou4-5/+11
The recent changes made to the runtime library broke its build on Solaris because it uses Solaris threads instead of POSIX threads on this platform. gcc/ada/ PR ada/115133 * libgnarl/s-osinte__solaris.ads (mutex_t): Fix typo. * libgnarl/s-taprop__solaris.adb (Record_Lock): Add conversion. (Check_Sleep): Likewise. (Record_Wakeup): Likewise. (Check_Unlock): Likewise. * libgnarl/s-tasini.adb (Initialize_RTS_Lock): Add pragma Import on the overlaid variable. (Finalize_RTS_Lock): Likewise. (Acquire_RTS_Lock): Likewise. (Release_RTS_Lock): Likewise. * libgnarl/s-taspri__solaris.ads (To_RTS_Lock_Ptr): New instance of Ada.Unchecked_Conversion. * libgnat/s-oslock__solaris.ads: Add with clause for Ada.Unchecked_Conversion. (array_type_9): Add missing name qualification. (record_type_3): Likewise. (mutex_t): Fix formatting.
2024-05-17ada: Start the initialization of the tasking runtime earlierEric Botcazou1-9/+21
This installs the tasking versions of the RTS_Lock manipulation routines very early, before the elaboration of all the Ada units of the program, including those of the runtime, because this elaboration may require the initialization of RTS_Lock objects. gcc/ada/ * bindgen.adb (Gen_Adainit): Generate declaration and call to the imported procedure __gnat_tasking_runtime_initialize if need be. * libgnat/s-soflin.ads (Locking Soft-Links): Add commentary. * libgnarl/s-tasini.adb (Tasking_Runtime_Initialize): New procedure exported as __gnat_tasking_runtime_initialize. Initialize RTS_Lock manipulation routines here instead of... (Init_RTS): ...here.
2024-05-17ada: Restore dependency on System.OS_Interface in System.Task_PrimitivesEric Botcazou1-1/+2
The dependency is relied upon by the binder to drag the tasking runtime. gcc/ada/ * libgnarl/s-taspri__mingw.ads: Add clause for System.OS_Interface. (Private_Data): Change type of Thread component.
2024-05-17ada: Replace spinlocks with fully-fledged locks in finalization collectionsEric Botcazou37-353/+251
This replaces spinlocks with fully-fledged locks in finalization collections because the former are deemed problematic with tasks that can be preempted. Because of the requirement to avoid dragging the tasking runtime when it is not necessary, the implementation goes through the usual soft links, with an additional hurdle that space must be reserved for the lock in any case since it is part of the ABI. This entails the introduction of the System.OS_Locks unit in the non-tasking runtime and the modification of the tasking runtime to also use this unit. This in turn requires a small adjustment: because of the presence of pre- and post-conditions in Interfaces.C and of the limitations of the RTSfind mechanism, the System.Finalization_Primitives unit must be preloaded, as what is done for the Ada.Strings.Text_Buffers unit. This effectively reverts the implementation to using the global task lock on bare board platforms. gcc/ada/ * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-oslock$(objext). (LIBGNAT_TARGET_PAIRS): Use s-oslock__dummy.ads by default. Set specific s-oslock.ads source file for all the platforms. * exp_ch7.ads (Preload_Finalization_Collection): New procedure. * exp_ch7.adb (Allows_Finalization_Collection): Return False if System.Finalization_Primitives has not been preloaded. (Preload_Finalization_Collection): New procedure. * opt.ads (Interface_Seen): New boolean variable. * s-oscons-tmplt.c: Use "N" string for pragma Style_Checks. * scng.adb (Scan): Set Interface_Seen upon seeing "interface". * sem_ch10.adb: Add clause for Exp_Ch7. (Analyze_Compilation_Unit): Call Preload_Finalization_Collection after the context of the unit is analyzed. * libgnarl/a-rttiev.adb: Add with clause for System.OS_Locks and alphabetize others. (Event_Queue_Lock): Adjust qualified name of subtype. * libgnarl/s-osinte__aix.ads: Add with clause for System.OS_Locks and change pthread_mutex_t into a local subtype. * libgnarl/s-osinte__android.ads: Likewise. * libgnarl/s-osinte__darwin.ads: Likewise. * libgnarl/s-osinte__dragonfly.ads: Likewise. * libgnarl/s-osinte__freebsd.ads: Likewise. * libgnarl/s-osinte__gnu.ads: Likewise. * libgnarl/s-osinte__hpux-dce.ads: Likewise. * libgnarl/s-osinte__hpux.ads: Add Likewise. * libgnarl/s-osinte__kfreebsd-gnu.ads: Likewise. * libgnarl/s-osinte__linux.ads: Likewise. * libgnarl/s-osinte__lynxos178e.ads: Likewise. * libgnarl/s-osinte__qnx.ads: Likewise. * libgnarl/s-osinte__rtems.ads: Likewise. * libgnarl/s-osinte__mingw.ads: Add with clause for System.OS_Locks and change CRITICAL_SECTION into a local subtype. Add declarations for imported procedures dealing with CRITICAL_SECTION. * libgnarl/s-osinte__solaris.ads: Add with clause for System.OS_Locks and change mutex_t into a local subtype. * libgnarl/s-osinte__vxworks.ads: Add missing blank line. * libgnarl/s-taprop.ads: Alphabetize clauses and package renamings. Use qualified name for RTS_Lock throughout. * libgnarl/s-taprop__dummy.adb: Add use clause for System.OS_Locks and alphabetize others. * libgnarl/s-taprop__hpux-dce.adb: Likewise. * libgnarl/s-taprop__linux.adb: Likewise. * libgnarl/s-taprop__posix.adb: Likewise. * libgnarl/s-taprop__qnx.adb: Likewise. * libgnarl/s-taprop__rtems.adb: Likewise. * libgnarl/s-taprop__solaris.adb: Likewise. * libgnarl/s-taprop__vxworks.adb: Likewise. * libgnarl/s-taprop__mingw.adb: Likewise. Remove declarations for imported procedures dealing with CRITICAL_SECTION. * libgnarl/s-tarest.adb: Add with clause for System.OS_Locks and alphabetize others. (Global_Task_Lock): Adjust qualified name of subtype. * libgnarl/s-tasini.adb: Add clause for System.OS_Locks. (Initialize_RTS_Lock): New procedure. (Finalize_RTS_Lock): Likewise. (Acquire_RTS_Lock): Likewise. (Release_RTS_Lock): Likewise. (Init_RTS): Add compile-time assertions for RTS_Lock types. Set the soft links for the RTS lock manipulation routines. * libgnarl/s-taspri__dummy.ads: Add with clause for System.OS_Locks. (RTS_Lock): Delete and adjust throughout accordingly. * libgnarl/s-taspri__hpux-dce.ads: Likewise. * libgnarl/s-taspri__lynxos.ads: Likewise. * libgnarl/s-taspri__mingw.ads: Likewise. * libgnarl/s-taspri__posix-noaltstack.ads: Likewise. * libgnarl/s-taspri__posix.ads: Likewise. * libgnarl/s-taspri__solaris.ads: Likewise. * libgnarl/s-taspri__vxworks.ads: Likewise. * libgnat/s-finpri.ads: Add clause for System.OS_Locks. (Finalization_Collection): Change type of Lock. * libgnat/s-finpri.adb (Initialize): Call Initialize_RTS_Lock. (Lock_Collection): Call Acquire_RTS_Lock. (Unlock_Collection): Call Release_RTS_Lock. * libgnat/s-oslock__dummy.ads: New file. * libgnat/s-oslock__hpux-dce.ads: Likewise. * libgnat/s-oslock__mingw.ads: Likewise. * libgnat/s-oslock__posix.ads: Likewise. * libgnat/s-oslock__solaris.ads: Likewise. * libgnat/s-oslock__vxworks.ads: Likewise. * libgnat/s-soflin.ads (Null_Set_Address): New null procedure. (Initialize_RTS_Lock): New soft link. (Finalize_RTS_Lock): Likewise. (Acquire_RTS_Lock): Likewise. (Release_RTS_Lock): Likewise. * exp_ch4.adb (Expand_N_Allocator): In the subtype indication case, call Apply_Predicate_Check on the resulting access value if need be.
2024-05-17ada: Factor out duplicated code in bodies of System.Task_Primitives.OperationsEric Botcazou5-129/+90
The duplication is present in some POSIX-like implementations (POSIX and RTEMS) while it has already been eliminated in others (Linux, QNX). The latter implementations are also slightly modified for consistency's sake. No functional changes. gcc/ada/ * libgnarl/s-taprop__dummy.adb (Initialize_Lock): Fix formatting. * libgnarl/s-taprop__linux.adb (RTS_Lock_Ptr): Delete. (Init_Mutex): Rename into... (Initialize_Lock): ...this. (Initialize_Lock [Lock]): Call above procedure. (Initialize_Lock [RTS_Lock]): Likewise. (Initialize_TCB): Likewise. * libgnarl/s-taprop__posix.adb (Initialize_Lock): New procedure factored out from the other two homonyms. (Initialize_Lock [Lock]): Call above procedure. (Initialize_Lock [RTS_Lock]): Likewise. * libgnarl/s-taprop__qnx.adb (RTS_Lock_Ptr): Delete. (Init_Mutex): Rename into... (Initialize_Lock): ...this. (Initialize_Lock [Lock]): Call above procedure. (Initialize_Lock [RTS_Lock]): Likewise. (Initialize_TCB): Likewise. * libgnarl/s-taprop__rtems.adb (Initialize_Lock): New procedure factored out from the other two homonyms. (Initialize_Lock [Lock]): Call above procedure. (Initialize_Lock [RTS_Lock]): Likewise.
2024-05-13ada: Remove deprecated VxWorks interrupt connection APIAshley Gay4-106/+5
The VxWorks 7 API to use hardware interrupts is the VxBus subsystem. GNAT API still provides bindings for the deprecated (VxWorks 6) routines. A direct consequence of this change is that Attach_Handler cannot be used anymore (the VxBus subsystem should be used instead). This patch removes all the functions that are not supported by VxWorks 7 anymore. To warn for the usage of Attach_Handler, it adds the 'Obsolescent' pragma to to this routine so the comiler will advise the user if this function is called directly or through a pragma. gcc/ada/ * Makefile.rtl: remove i-vxinco.* from the build * doc/gnat_rm/the_gnat_library.rst: Remove i-vxinco.ads from the units documentation. * impunit.adb: Remove i-vxinco from the list of available units in GNATstudio. * libgnarl/i-vxinco.adb: Remove. * libgnarl/i-vxinco.ads: Ditto. * libgnarl/s-interr__vxworks.adb: enrich comment * libgnarl/s-vxwext__kernel.ads: fix comment * libgnat/i-vxwork.ads: Remove deprecated interrupt connections API, as well as an example. * libgnat/i-vxwork__x86.ads: Ditto and add the paragma Obscolescent to Attach_Handler * gnat_rm.texi: Regenerate.
2024-05-06ada: Replace references to PO_Simple by Protected_Objects in commentsEric Botcazou3-4/+10
The child unit was renamed a while ago. gcc/ada/ * libgnarl/s-taprob.ads (Protection): Add cross-reference to the counterpart in System.Tasking.Protected_Objects.Entries. * libgnarl/s-taskin.ads (Locking Rules): Replace PO_Simple by Protected_Objects. * libgnarl/s-tpoben.ads (Protection_Entries): Likewise.
2024-01-22Update copyright years.Marc Poulhiès219-219/+219
2023-11-30ada: Add comment describing Partition_Elaboration_Policy dependency.Steve Baird1-0/+6
Add a comment in the spec for the default (as opposed to hie) version of Ada.Real_Time.Timing_Events indicating that it is incompatible with a a Partition_Elaboration_Policy specification specifying a policy other than Concurrent. gcc/ada/ * libgnarl/a-rttiev.ads: add a comment
2023-11-07ada: Fix extra whitespace after END keywordsPiotr Trojanek4-4/+4
Style cleanup. gcc/ada/ * exp_pakd.adb, libgnarl/s-osinte__android.ads, libgnarl/s-osinte__linux.ads, libgnarl/s-osinte__qnx.ads, libgnarl/s-osinte__rtems.ads, libgnat/s-gearop.adb, libgnat/s-poosiz.adb, sem_util.adb: Fix style.
2023-09-05ada: Support setting task affinity on QNXJohannes Kliemann1-5/+40
QNX does not support setting the thread affinity via a POSIX API. This implementation uses QNX's native Thread_Ctl API to set the thread affinity for Ada tasks. gcc/ada/ * libgnarl/s-taprop__qnx.adb: Implement Set_Task_Affinity.
2023-09-05ada: Handle GNATcheck violationsSheri Bernstein2-6/+9
For the GNATcheck rule "Improper_Returns", either use pragma Annotate to exempt the violation with the rationale "early returns for performance", or refactor the code by replacing multiple returns by a single return statement with a conditional expression; this is more readable and maintainable, and also conformant with a Highly Recommended design principle of ISO 26262-6. For the GNATcheck rule "Discriminated_Records", use pragma Annotate to exempt the violation with the rationale "only variant records are disallowed". gcc/ada/ * libgnarl/a-reatim.adb (Time_Of): Add pragma to exempt Discriminated_Records. * libgnat/s-imguti.adb (Round, Set_Decimal_Digits): Likewise. * libgnat/s-multip.adb (Number_Of_CPUs): Likewise. * libgnarl/s-tpopsp__posix-foreign.adb (Self): Refactor multiple returns.
2023-09-05ada: Tweak comment about tasking corner caseRonan Desplanques1-2/+2
This patch adjusts a comment that could have misleadingly suggested that a corner case related to tasks could not exist in Ada 2012 or Ada 2022. gcc/ada/ * libgnarl/s-tassta.adb: Tweak comment.
2023-09-05LoongArch: initial ada support on linuxYang Yujie1-0/+134
gcc/ada/ChangeLog: * Makefile.rtl: Add LoongArch support. * libgnarl/s-linux__loongarch.ads: New file. * libgnat/system-linux-loongarch.ads: New file. gcc/ChangeLog: * config/loongarch/loongarch.h (CC1_SPEC): Mark normalized options passed from driver to gnat1 as explicit for multilib.
2023-07-28ada: Add an assert in Posix Interrupt_WaitClément Chigot1-0/+1
All functions but Interrupt_Wait in s-inmaop__posix are checking the result of their syscalls with an assert. However, any return code of sigwait different than 0 means that something went wrong for it. From sigwait man: > RETURN VALUE > On success, sigwait() returns 0. On error, it returns a > positive error number (listed in ERRORS). gcc/ada/ * libgnarl/s-inmaop__posix.adb: Add assert after sigwait in Interrupt_Wait
2023-07-28ada: Fix race condition in protected entry callRonan Desplanques1-2/+8
This patch only affects the single-entry implementation of protected objects. Before this patch, there was a race condition where a task that called an entry could put itself to sleep right after another task had executed the entry as a proxy and signalled the not-yet-waiting first task, which caused the first task to enter a deadlock. Note that this race condition has been identified and fixed before for the implementations of the run-time that live under hie/. This patch reworks the locking sequence so that it is closer to the one that's used in the multiple-entry implementation of protected objects. The code for the multiple-entry implementation is spread across multiple subprograms. To draw a parallel with the section this patch modifies, one can read the following subprograms: - System.Tasking.Protected_Objects.Operations.Protected_Entry_Call - System.Tasking.Entry_Calls.Wait_For_Completion - System.Tasking.Entry_Calls.Check_Pending_Actions_For_Entry_Call This patch also adds a comment that explicitly states the locking constraint that must hold in the affected section. gcc/ada/ * libgnarl/s-tposen.adb: Fix race condition. Add comment to justify the locking timing.
2023-07-18ada: Tweak CPU affinity handling on LinuxRonan Desplanques1-31/+7
Before this patch, the run-time assumed that not specifying a CPU affinity mask when creating a thread was equivalent to specifying a CPU affinity mask that included all CPUs. As documented in the man pages for pthread_create and pthread_setaffinity_np, this assumption is incorrect: a thread created using pthread_create inherits the CPU affinity mask of the creating thread by default. There was a comment in Set_Task_Affinity that acknowledged this behavior, but the actual code made the erroneous assumption mentioned above. That assumption caused the run-time to behave incorrectly when tasks were explicity assigned to Not_A_Specific_CPU: those tasks were assigned to the same CPUs as their parents instead of being allowed to run on any CPU. This patch fixes that behavior. This patch has the negative effect of making the runtime issue sched_setaffinity syscalls that are not necessary. gcc/ada/ * libgnarl/s-taprop__linux.adb (Set_Task_Affinity, Create_Task): Tweak handling of CPU affinities.
2023-06-20ada: Remove outdated commentRonan Desplanques1-4/+0
The Preelaborate pragma the removed comment was referring to was indeed present in AI 167, as well as in clause 5.3 of the rationale for Ada 2012, but it never made it into the 2012 version of the reference manual. gcc/ada/ * libgnarl/s-mudido.ads: Remove outdated comment.
2023-06-20ada: Remove references to Might_Not_Return and Always_ReturnClaire Dross1-2/+2
The Might_Not_Return and Always_Return annotations for GNATprove should now be replaced by the two more precise aspects Exceptional_Cases and Always_Terminates. They allow to specify whether a subprogram is allowed to raise exceptions or fail to complete. gcc/ada/ * libgnat/a-strfix.ads: Replace Might_Not_Return annotations by Exceptional_Cases and Always_Terminates aspects. * libgnat/a-tideio.ads: Idem. * libgnat/a-tienio.ads: Idem. * libgnat/a-tifiio.ads: Idem. * libgnat/a-tiflio.ads: Idem. * libgnat/a-tiinio.ads: Idem. * libgnat/a-timoio.ads: Idem. * libgnat/a-textio.ads: Idem. Also mark functions Name, Col, Line, and Page as out of SPARK as they might raise Layout_Error. * libgnarl/a-reatim.ads: Replace Always_Return annotations by Always_Terminates aspects. * libgnat/a-chahan.ads: Idem. * libgnat/a-nbnbig.ads: Idem. * libgnat/a-nbnbin.ads: Idem. * libgnat/a-nbnbre.ads: Idem. * libgnat/a-ngelfu.ads: Idem. * libgnat/a-nlelfu.ads: Idem. * libgnat/a-nllefu.ads: Idem. * libgnat/a-nselfu.ads: Idem. * libgnat/a-nuelfu.ads: Idem. * libgnat/a-strbou.ads: Idem. * libgnat/a-strmap.ads: Idem. * libgnat/a-strsea.ads: Idem. * libgnat/a-strsup.ads: Idem. * libgnat/a-strunb.ads: Idem. * libgnat/a-strunb__shared.ads: Idem. * libgnat/g-souinf.ads: Idem. * libgnat/i-c.ads: Idem. * libgnat/interfac.ads: Idem. * libgnat/interfac__2020.ads: Idem. * libgnat/s-aridou.adb: Idem. * libgnat/s-arit32.adb: Idem. * libgnat/s-atacco.ads: Idem. * libgnat/s-spcuop.ads: Idem. * libgnat/s-stoele.ads: Idem. * libgnat/s-vaispe.ads: Idem. * libgnat/s-vauspe.ads: Idem. * libgnat/i-cstrin.ads: Add a precondition instead of a Might_Not_Return annotation.
2023-06-15ada: Adjust QNX Ada priorities to match QNX system prioritiesJohannes Kliemann1-1/+1
The Ada priority range of the QNX runtime started from 0, differing from the QNX system priorities range starting from 1. As this may cause confusion, especially if used in a mixed language environment, the Ada priority range now starts at 1. The default priority of Ada tasks as mandated is the middle of the priority range. On QNX this means the default priority of Ada tasks is 30. This is much higher than the default QNX priority of 10 and may cause unexpected system interruptions when Ada tasks take a lot of CPU time. gcc/ada/ * libgnarl/s-osinte__qnx.adb: Adjust priority conversion function. * libgnat/system-qnx-arm.ads: Adjust priority range and default priority.
2023-05-26ada: Use computed value from os_constants to define sigset_tDoug Rupp1-1/+3
Remove hard coded definition and conform to standard usage of using computed os_constants for opaque type declarations. gcc/ada/ * libgnarl/s-osinte__qnx.ads (sigset_t): Modify declaration to use system.os_constants computed value. Align it.
2023-05-23ada: Fix address manipulation issue in the tasking runtimeEric Botcazou4-33/+33
The implementation of task attributes in the runtime defines an atomic clone of System.Address, which is awkward for targets where addresses and pointers have a specific representation, so this change replaces that with a pragma Atomic_Components on the Attribute_Array type. gcc/ada/ * libgnarl/s-taskin.ads (Atomic_Address): Delete. (Attribute_Array): Add pragma Atomic_Components. (Ada_Task_Control_Block): Adjust default value of Attributes. * libgnarl/s-tasini.adb (Finalize_Attributes): Adjust type of local variable. * libgnarl/s-tataat.ads (Deallocator): Adjust type of parameter. (To_Attribute): Adjust source type. * libgnarl/a-tasatt.adb: Add clauses for System.Storage_Elements. (New_Attribute): Adjust return type. (Deallocate): Adjust type of parameter. (To_Real_Attribute): Adjust source type. (To_Address): Add target type. (To_Attribute): Adjust source type. (Fast_Path): Adjust tested type. (Finalize): Compare with Null_Address. (Reference): Likewise. (Reinitialize): Likewise. (Set_Value): Likewise. Add conversion to Integer_Address. (Value): Likewise.
2023-05-23ada: Add new switch -gnatyzArnaud Charlet2-2/+2
Improve -gnatyx to check additional complete conditions, and introduce a new switch -gnatyz to check for unnecessary parentheses according to operator precedence rules. Enable -gnatyz as part of -gnatyg. gcc/ada/ * par-ch5.adb, style.ads, styleg.adb, styleg.ads (Check_Xtra_Parens): Remove extra parameter Enable. (Check_Xtra_Parens_Precedence): New. (P_Case_Statement): Add -gnatyx style check. * sem_ch4.adb: Replace calls to Check_Xtra_Parens by Check_Xtra_Parens_Precedence. * stylesw.ads, stylesw.adb, usage.adb: Add support for -gnatyz. * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update -gnatyxzg doc. * sem_prag.adb, libgnat/s-regpat.adb, libgnarl/s-interr__hwint.adb, libgnarl/s-interr__vxworks.adb: Remove extra parens. * par-ch3.adb (P_Discrete_Range): Do not emit a style check if the expression is not a simple expression. * gnat_ugn.texi: Regenerate.